fomvasss/omnipay-interkassa

此包已被弃用且不再维护。未建议替代包。

为Omnipay PHP支付处理库提供的InterKassa驱动器

0.1.1 2017-03-19 14:12 UTC

This package is auto-updated.

Last update: 2020-08-19 22:51:56 UTC


README

为Omnipay PHP支付处理库提供的InterKassa驱动器

Latest Stable Version Total Downloads Build Status Scrutinizer Code Quality Dependency Status

Omnipay是一个适用于PHP 5.3+的多网关支付处理库,不依赖于任何框架。

此包实现了InterKassa对Omnipay的支持。

安装

通过composer安装此库是首选方式。

运行以下命令

php composer.phar require "ange007/omnipay-interkassa"

或添加以下内容到你的composer.json文件的require部分

"ange007/omnipay-interkassa": "*"

to the require section of your composer.json.

基本用法

此包提供以下网关

有关一般用法说明,请参阅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问题跟踪器报告,或者更好的方法是分叉库并提交拉取请求。

许可

此项目根据MIT许可条款发布。更多信息请参阅此处

版权© 2017, ange007 (原作者:HiQDev - hiqdev/omnipay-interkassa).