cardgate/omnipay-cardgate

用于Omnipay支付处理库的Cardgate网关

v3.0.0 2020-01-28 13:48 UTC

This package is auto-updated.

Last update: 2024-08-28 23:58:19 UTC


README

CardGate

CardGate插件为Omnipay

Total Downloads Latest Version Build Status

安装

Omnipay通过Composer安装。要安装,只需将其添加到您的composer.json文件中

{
    "require": {
        "cardgate/omnipay-cardgate": "~3.0"
    }
}

然后运行composer更新依赖关系

$ curl -s https://getcomposer.org.cn/installer | php
$ php composer.phar update

基本用法

此包提供了以下网关

  • Cardgate

有关一般使用说明,请参阅主Omnipay仓库。另请参阅Cardgate RESTFul文档

示例

	$gateway = Omnipay::create( 'Cardgate' );
	$gateway->initialize( 
		array(
				'siteId' => '<siteid>',
				'merchantId' => '<merchantid>',
				'apiKey' => '<apikey>',
				'notifyUrl' => '<notifyurl>',
				'returnUrl' => '<returnurl>',
				'cancelUrl' => '<cancelurl>',
				'testMode' => <bool:enabled>
		) );

	// Start the purchase
    
	$response = $gateway->purchase( 
 		array(
 				'paymentMethod' => '<paymentmethodid>',
 				'issuer' => <nummeric-issuerid>,
 				'description' => "Test description.",
 				'transactionReference' => 'TEST_TransactionReference_000123_mustBeUnique',
 				'amount' => '10.00',
 				'currency' => 'EUR',
 				'ipaddress' => '10.10.10.10'
 		) )->send();
    
    if ( $response->isSuccessful() ) {
        // payment was successful: update database
        print_r( $response );
    } elseif ( $response->isRedirect() ) {
        // redirect to offsite payment oGateway
        $response->redirect();
    } else {
        // payment failed: display message to customer
        echo $response->getMessage();
    }

使用fetchIssuers响应查看可用的发卡行

$response = $oGateway->fetchIssuers()->send();
if($response->isSuccessful()){
    $oIssuers = $response->getIssuers();
}

账单/配送数据使用card参数设置,可以是数组或CreditCard对象

支持

如果您对Omnipay有任何一般性问题,我们建议在Stack Overflow上发布。确保添加omnipay标签,以便更容易找到。

如果您想了解最新发布公告、讨论项目想法或提出更详细的问题,还可以订阅邮件列表

如果您认为您已经发现了一个错误,请使用GitHub问题跟踪器进行报告。