ange007 / omnipay-interkassa
用于Omnipay PHP支付处理库的InterKassa驱动程序
0.1.1
2017-03-19 14:12 UTC
Requires
- omnipay/common: ~2.3
Requires (Dev)
- omnipay/tests: ~2.0
This package is not auto-updated.
Last update: 2024-09-14 20:30:34 UTC
README
用于Omnipay PHP支付处理库的InterKassa驱动程序
Omnipay是一个PHP 5.3+多网关支付处理库,不依赖于任何框架。
本包实现了InterKassa对Omnipay的支持。
安装
安装此库的首选方式是通过composer。
运行以下命令:
php composer.phar require "ange007/omnipay-interkassa"
或添加以下内容到你的composer.json文件中的require部分:
"ange007/omnipay-interkassa": "*"
基本用法
本包提供了以下网关:
有关一般使用说明,请参阅Omnipay的主要仓库。
示例
public function payResponse( $serviceID, $status, $data ) { // Load Gateway $gateway = Omnipay::gateway( $serviceID ); // Read data if( $status === 'notify' && $gateway->supportsAcceptNotification( ) ) { $request = $gateway->acceptNotification( $data ); } else if( $gateway->supportsCompleteAuthorize( ) ) { $request = $gateway->completeAuthorize( $data ); } else if( $gateway->supportsCompletePurchase( ) ) { $request = $gateway->completePurchase( $data ); } // Send request try { $response = $request->send( ); } catch( Exception $ex ) { } // Need wait server notification if( $response->isPending( ) ) { //... } // Paid successful else if( $response->isSuccessful( ) ) { $payID = $response->getTransactionId( ); //... } // Pay cancelled from user else if( $request->isCancelled( ) ) { //... } // Error or other else { $message = $response->getMessage( ); //... } }
支持
如果您遇到Omnipay的一般问题,建议在Stack Overflow上发布。请确保添加omnipay标签,以便更容易找到。
如果您想及时了解发布公告、讨论项目想法或提出更详细的问题,还有一个邮件列表,您可以订阅。
如果您认为发现了错误,请使用GitHub问题跟踪器报告,或者更好的是,分支库并提交pull请求。
许可证
版权© 2017, ange007 (原作者:HiQDev - hiqdev/omnipay-interkassa)。