tink/omnipay-paytm

Omnipay PHP支付处理库的Paytm驱动程序

v1.0.1 2018-05-30 02:42 UTC

This package is not auto-updated.

Last update: 2024-09-29 06:02:32 UTC


README

Omnipay PHP支付处理库的Paytm驱动程序

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

使用方法

开始交易

$gateway = Omnipay::create('Paytm_Express');

$gateway->setMid('TRANSS******');
$gateway->setKey('6u*****');
$gateway->setIndustryTypeId('Retail');
$gateway->setChannelId('WEB');
$gateway->setWebSite('WEB_STAGING');
$gateway->setEnvironment('staging');


$params = [
	'orderId' => 'ORDS83028539',
	'CustID' => 'CUST001',
	'amount' => 1
];
$response = $gateway->purchase($params)->send();

$response->redirect();

交易通知

$gateway = Omnipay::create('Paytm_Express');
$gateway->setMid('TRANSS********');
$gateway->setKey('6u*******');

$response = $gateway->completePurchase(['request_params' => $_REQUEST])->send();
if ($response->isPaid()) { // 成功
...
} elseif ($response->isFailure()) { // 失败
...
} else { // 进行中
...
}

订单查询

$gateway = Omnipay::create('Paytm_Express');
$gateway->setMID('TRANSS********');

$response = $gateway->queryOrder(['orderId' => 'xxx'])->send();
if ($response->isPaid()) {
...
} elseif ($response->isFailure()) {
...
} else {
...
}