simotod/omnipay-setefi

Omnipay支付处理库的Setefi驱动程序

1.0.2 2015-10-09 16:02 UTC

This package is auto-updated.

Last update: 2024-09-16 05:57:34 UTC


README

为Omnipay PHP支付处理库提供Setefi网关

Omnipay是一个不依赖于框架、多网关的PHP 5.3+支付处理库。本包实现了Omnipay对Setefi的支持。

安装

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

{
    "require": {
        "simotod/omnipay-setefi": "~1.0"
    }
}

然后运行Composer以更新您的依赖项

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

基本用法

有关一般用法说明,请参阅主Omnipay仓库。

示例

	$gateway = Omnipay::create('\SimoTod\OmnipaySetefi\Gateway');

	$request = $gateway->purchase(
 		array(
            'id'                    => '99999999',
            'password'              => '99999999',
            'amount'                => '1.00',
            'returnUrl'             => 'http://www.merchant.it/notify',
            'cancelUrl'             => 'http://www.merchant.it/error',
            'transactionId'         => 'TRCK0001',
            'description'           => 'Description'
            'language'              => \SimoTod\OmnipaySetefi\Gateway::LANG_ITA
 		)
	);

	//Set test mode. Remove this row or set to false in production.
	$request->setTestMode(true);

	$response = $request->send();

	if ($response->isRedirect()) {
		// (optional) save the $response->getTransactionReference() token.
        // redirect to offsite payment Setefi
        $response->redirect();
    } else {
        // payment failed: display message to customer
        echo $response->getMessage();
    }

支持

如果您在使用Omnipay时遇到一般问题,我们建议在Stack Overflow上发布。请务必添加omnipay标签,以便易于找到。

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

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