hexters / coinpayment
CoinPayment 是一个 Laravel 模块,用于处理 CoinPayment 交易,如创建交易、历史交易等。
v3.0.0
2021-01-09 22:09 UTC
- dev-master
- v3.0.0
- v2.1.1
- 2.1.0
- 2.0.x-dev
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- 1.0.19
- 1.0.18
- 1.0.17
- 1.0.16
- v1.0.15
- v1.0.14
- v1.0.13.1
- v1.0.13
- v1.0.12
- v1.0.11
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-dependabot/npm_and_yarn/express-4.18.2
- dev-dependabot/npm_and_yarn/qs-6.5.3
- dev-dependabot/npm_and_yarn/decode-uri-component-0.2.2
- dev-dependabot/npm_and_yarn/loader-utils-1.4.2
- dev-dependabot/npm_and_yarn/minimatch-3.0.8
- dev-dependabot/npm_and_yarn/moment-timezone-0.5.35
- dev-dependabot/npm_and_yarn/moment-2.29.4
- dev-dependabot/npm_and_yarn/async-2.6.4
- dev-dependabot/npm_and_yarn/minimist-1.2.6
- dev-dependabot/npm_and_yarn/url-parse-1.5.10
- dev-dependabot/npm_and_yarn/path-parse-1.0.7
- dev-dependabot/npm_and_yarn/dns-packet-1.3.4
- dev-dependabot/npm_and_yarn/lodash-4.17.21
- dev-dependabot/npm_and_yarn/hosted-git-info-2.8.9
- dev-dependabot/npm_and_yarn/y18n-3.2.2
- dev-dependabot/npm_and_yarn/elliptic-6.5.4
This package is auto-updated.
Last update: 2024-08-30 01:26:06 UTC
README
Coinpayment Laravel 包
CoinPayment 是一个 Laravel 包,用于处理来自 CoinPayment 的交易,如创建交易、历史交易等。
版本支持
安装
您可以通过 composer 安装此包
$ composer require hexters/coinpayment
发布供应商
$ php artisan vendor:publish --tag=coinpayment
安装 CoinPayment 配置
$ php artisan coinpayment:install
安装完成。
入门指南
创建按钮交易。示例放置在您的控制器中
use Hexters\CoinPayment\CoinPayment; . . . /* * @required true */ $transaction['order_id'] = uniqid(); // invoice number $transaction['amountTotal'] = (FLOAT) 37.5; $transaction['note'] = 'Transaction note'; $transaction['buyer_name'] = 'Jhone Due'; $transaction['buyer_email'] = 'buyer@mail.com'; $transaction['redirect_url'] = url('/back_to_tarnsaction'); // When Transaction was comleted $transaction['cancel_url'] = url('/back_to_tarnsaction'); // When user click cancel link /* * @required true * @example first item */ $transaction['items'][] = [ 'itemDescription' => 'Product one', 'itemPrice' => (FLOAT) 7.5, // USD 'itemQty' => (INT) 1, 'itemSubtotalAmount' => (FLOAT) 7.5 // USD ]; /* * @example second item */ $transaction['items'][] = [ 'itemDescription' => 'Product two', 'itemPrice' => (FLOAT) 10, // USD 'itemQty' => (INT) 1, 'itemSubtotalAmount' => (FLOAT) 10 // USD ]; /* * @example third item */ $transaction['items'][] = [ 'itemDescription' => 'Product Three', 'itemPrice' => (FLOAT) 10, // USD 'itemQty' => (INT) 2, 'itemSubtotalAmount' => (FLOAT) 20 // USD ]; $transaction['payload'] = [ 'foo' => [ 'bar' => 'baz' ] ]; return CoinPayment::generatelink($transaction); . . .
监听交易状态
打开 Job 文件 App\Jobs\CoinpaymentListener
以监听我们的交易并进行处理
无 IPN 的手动检查
此功能将在不等待 IPN 处理的情况下执行订单
如果我们不使用 IPN,我们还可以通过 cron 运行此功能
use Hexters\CoinPayment\CoinPayment; . . . /** * this is triger function for running Job proccess */ return CoinPayment::getstatusbytxnid("CPDA4VUGSBHYLXXXXXXXXXXXXXXX"); // output example: "celled / Timed Out"
获取交易历史记录 Eloquent
use Hexters\CoinPayment\CoinPayment; . . . CoinPayment::gettransactions()->where('status', 0)->get();
IPN 路由
将此路径 /coinpayment/ipn
从 App\Http\Middleware\VerifyCsrfToken
中的 csrf 处理中排除
. . . /** * The URIs that should be excluded from CSRF verification. * * @var array */ protected $except = [ '/coinpayment/ipn' ]; . . .
推广新功能
现在您可以将 coinpayment 交易与 Ladmin (Laravel Admin 框架) 集成。您只需为每个版本支付 $ 36.25 的包价格即可。
功能有哪些?
- 根据数据库显示 CoinPayment 交易的列表
- 从管理页面创建新的交易并发送至买家邮箱
- 您可以通过管理页面手动检查交易状态
- 删除挂起的交易
- 显示 CoinPayment 余额列表
- 充值余额
- 易于快速安装
有关详细信息,请访问 Ladmin CoinPayment
故障排除
无法将 Illuminate\Http\JsonResponse 对象用作数组
访问 CoinPayment API 密钥 页面,在 操作 下,点击 编辑权限 按钮。在 限制为 IP/IP 范围 输入中输入您的 API 端点的 IP 地址(例如,您的网站服务器)。留空可能会导致此错误发生。
支持项目
您可以通过以下推荐链接支持此项目的维护者