evolutionscript/metamaskipn 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

evolutionscript/metamaskipn

最新稳定版本:1.0.2

Composer 安装命令:

composer require evolutionscript/metamaskipn

包简介

Accept payments from Metamask wallets with Binance Smart Chain (BSC) tokens, use it with FIAT or other cryptos.

README 文档

README

MetamaskIPN allows you to receive instant payment notifications (IPN) in your site every time you receive a payment from Metamask wallets.

This library allows you convert FIAT or other cryptocurrencies to the supported tokens of MetamaskIPN and generate the payment button or shopping cart link.

Installation:

composer require evolutionscript/metamaskipn

Usage:

use EvolutionScript\MetamaskIPN as MetamaskIPN;
//Initialize MetamaskIPN Class
$metamaskIPN = new MetamaskIPN\MetamaskIPN();

//Specify cache directory to save data from FIAT rates and make a request once per day. It is optional but prevents exceeding the API usage limit. 
$metamaskIPN->cacheDirectory(__DIR__.'/cache');

//Connect with Currency Layer and as optional connect with OpenExchangeRates. The optional provider is useful if the primary provider fails.
$metamaskIPN->currencyProviders(
	new \EvolutionScript\CurrencyAPI\Providers\CurrencyLayer('CURRENCY_LAYER_API'),
	new \EvolutionScript\CurrencyAPI\Providers\OpenExchangeRates('OPEN_EXCHANGE_RATES_API')
);


//If we are going to use fiat and deposit will be in Litecoin (LTC):
$button_code = $metamaskIPN->from_fiat(10, 'PEN')
	->to_crypto('LTC')
	->site_id(0)
	->custom_1('my_optional_parameter')
	->custom_2('other_option_parameter')
	->custom_3('another_option_parameter')
	->lang('en') //For supported languages go to https://metamaskipn.com/docs
	->button_code('Pay Now');

echo $button_code;

//If we are going to use a cryptocurrency like Solana (SOL) and deposit in in BTCB (BTC)
$button_code_2 = $metamaskIPN->from_crypto(1,'SOL')
	->to_crypto('BTCB')
	->site_id(0)
	->custom_1('custom_parameter')
	->lang('es')
	->button_code();
echo $button_code_2;

//If we are going to use the shopping cart URL, then we can specify item name and other items.
$shopping_car_url = $metamaskIPN->from_crypto(55,'XRP')
	->to_crypto('BNB')
	->site_id(0)
	->custom_1('custom_parameter')
	->lang('en')
	->item_name('Make a donation')
	->item_description('Support our project')
	->logo('https://www.evolutionscript.com/assets/evolution/images/logo.png') //URL of your logo
	->cancel_url('https://mysite.com/cart')
	->success_url('https://mysite.com/success')
	->shopping_cart();
echo '<br><a href="'.$shopping_car_url.'">Click here to redirect to shopping cart</a>';

统计信息

  • 总下载量: 17
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 88
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固