litlife/enot-io-payments
Composer 安装命令:
composer require litlife/enot-io-payments
包简介
Package for working with the payment aggregator api enot.io
README 文档
README
Package for working with the payment aggregator API enot.io
Installation
Use the package manager composer to install enot-io-payments.
composer require litlife/enot-io-payments
Usage
Generate a payment URL
In this example, you can see how to generate a link that the user can click to make a payment
use Litlife\EnotIoPayments\EnotIoApi; $orderAmount = 42.2; $orderId = 4242; $currency = 'RUB'; $comment = 'Some text'; $url = (new EnotIoApi()) ->setMerchantId(424242) ->setSecretKey('secret key') ->getPaymentUrl($orderAmount, $orderId, $currency, $comment); print_r($url);
Output:
https://enot.io/pay?m=424242&oa=42.2&o=4242&s=8a7d38fa09963aaadd32a8422fbfd397&cr=RUB&c=Some+text
Notifications after payment (webhook, callback)
use Litlife\EnotIoPayments\EnotIoApi; $postArray = [ 'merchant' => 150, 'amount' => 200.00, 'credited' => 196.00, 'intid' => 1545855, 'merchant_id' => 99, 'method' => 'cd', 'sign' => 'cd1d6b67f3335038656d9009ab4ecfa9', 'sign_2' => 'b86410d16a20bb57366d29b0d884bcb2', 'currency' => 'RUB', 'commission' => 0.00, 'payer_details' => '539175******7523', 'custom_field' => [ 'email' => 'test@email.ru', 'id_user' => '125454' ] ]; $paymentStatus = (new EnotIoApi()) ->setSecretKey2('secret key 2') // validate params with secret key 2 ->paymentStatus($postArray); print_r($request->getAmount()); print_r($request->getCredited()); print_r($request->getIntId());
Output:
200.00 196.00 1545855
Payment information
use Litlife\EnotIoPayments\EnotIoApi; $shopId = 4242; $enotTransactionId = 123; $yourTransactionId = 456; $paymentInfo = (new EnotIoApi()) ->setEmail('test@test.com') ->setApiKey('api key') ->paymentInfo($shopId, $enotTransactionId, $yourTransactionId); print_r($paymentInfo->getStatus()); print_r($paymentInfo->getCredited()); ...
Testing
composer test
License
litlife/enot-io-payments 适用场景与选型建议
litlife/enot-io-payments 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 08 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 litlife/enot-io-payments 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 litlife/enot-io-payments 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-08-02