alsharie/cashpay-payment
Composer 安装命令:
composer require alsharie/cashpay-payment
包简介
CashPay payment gateway
README 文档
README
laravel package for CashPay payment getway
install the package
composer require alsharie/cashpay-payment
You can publish using the following command
php artisan vendor:publish --provider="Alsharie\CashPayPayment\CashPayServiceProvider"
When published, the config/cashPay.php config file contains:
return [ 'auth' => [ 'UserName' => env('CASHPAY_MERCHANT_USERNAME'), 'SpId' => env('CASHPAY_MERCHANT_SPID'), 'encPassword' => env('CASHPAY_MERCHANT_ENCPASSWORD'), ], 'cert' => [ 'path' => env('CASHPAY_CERT_PATH'), 'password' => env('CASHPAY_CERT_PASSWORD'), ], 'url' => [ 'base' => env('CASHPAY_BASE_URL', 'https://www.tamkeen.com.ye:33291/CashPG'), ] ];
when you are ready to release your application, you should set the CASHPAY_BASE_URL to release-url
and they give you a certificate file and password to use it in CASHPAY_CERT_PATH and CASHPAY_CERT_PASSWORD respectively
To purchase using CashPay payment
1. Purchase
$cashPay = new CashPay(); $response = $cashPay ->setRequestId(/*request id*/) //Request unique identifier that should be generated by sp ->setCustomerPhone(/*phone */) // TargetMSISDN ->setCustomerCashPayCode(/*code*/) ->setAmount(/*amount*/) ->setCurrency(2) ->setDescription(/*desc*/) ->initPayment(); if ($response->isSuccess()) { $tran_ref = $response->getTransactionRef(); .... .... }
2. Confirm purchase
$cashPay = new CashPay(); $response = $cashPay ->setRequestId(/*request id*/) //Request unique identifier that should be generated by sp ->setOtp(/*otp */) // customer otp ->setTransactionRef(/*tran ref*/) //Transaction Code returned in InitPayment response ->confirmPayment(); if ($response->isSuccess()) { $code = $response->code(); .... .... }
you can get the full response body using $response->body() for all requests
alsharie/cashpay-payment 适用场景与选型建议
alsharie/cashpay-payment 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 134 次下载、GitHub Stars 达 12, 最近一次更新时间为 2022 年 10 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 alsharie/cashpay-payment 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 alsharie/cashpay-payment 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 134
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-10-05
