leonardjke / omnipay-yoomoney
Omnipay PHP支付库的Yoomoney驱动程序
1.6
2022-03-19 11:52 UTC
Requires
- omnipay/common: v3.1.2
Requires (Dev)
- omnipay/tests: ^v4.1.0
- phpunit/phpunit: ^9.5.10
- squizlabs/php_codesniffer: 3.*
README
Omnipay PHP支付库的YooMoney驱动程序
Omnipay是一个不依赖于框架的多网关支付处理库,适用于PHP 5.3+。本软件包为Omnipay实现了Yoomoney支持。
安装
使用require安装网关。需要包含league/omnipay
基础包和此网关。
$ composer require league/omnipay leonardjke/omnipay-yoomoney
用法
创建购买
$gateway = Omnipay::create('Yoomoney'); $gateway->setReceiver('410011122244470'); $gateway->setPaymentType('PC'); $gateway->setQuickpayForm('shop'); $gateway->setSuccessUrl('https://example.com'); $response = $gateway->purchase([ 'amount' => $payment->price, 'transactionId' => $payment->id, 'description' => 'Оплата товара', 'currency' => 'RUB', ])->send();
###继续购买
$gateway = Omnipay::create('Yoomoney'); $gateway->setReceiver('410011122244470'); $gateway->setPaymentType('PC'); $gateway->setQuickpayForm('shop'); $gateway->setSuccessUrl('https://example.com'); $response = $gatewayManager->acceptNotification(); // Impotant! Verify hash of the request if (!$response->isValid()) { // return error } $data = $response->getData(); $status = $response->getTransactionStatus(); $id = $response->getTransactionReference();
有关通用使用说明,请参阅主Omnipay仓库。
支持
如果您在使用Omnipay时遇到一般性问题,我们建议您在Stack Overflow上发帖。确保添加omnipay标签,以便更容易找到。
如果您想了解发布公告,讨论项目的想法或提出更详细的问题,还有一个您可以订阅的邮件列表。
如果您认为您发现了一个错误,请使用GitHub问题跟踪器报告,或者更好的方法是分支库并提交一个pull request。
测试
$ composer test
安全
如果您发现任何与安全相关的问题,请通过电子邮件a@minedonate.ru报告,而不是使用问题跟踪器。
致谢
许可证
MIT许可证(MIT)。有关更多信息,请参阅许可证文件。