evolutionscript/metamaskipn
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>';
evolutionscript/metamaskipn 适用场景与选型建议
evolutionscript/metamaskipn 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 17 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 07 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「tokens」 「binance」 「metamask」 「bsc」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 evolutionscript/metamaskipn 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 evolutionscript/metamaskipn 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 evolutionscript/metamaskipn 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Binance API Like the official document interface, Support for arbitrary extension.
Laravel token auth cached.
Estimate AI API costs before making expensive calls
Support metamask personal_sign verify
Borobudur JWT Encryption Component
登录组件封装,适配uniapp、小程序后台接口
统计信息
- 总下载量: 17
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 221
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-07-06