tink/omnipay-mobikwik

mobikwik driver for the Omnipay PHP payment processing library

v1.0.0 2018-05-29 09:08 UTC

This package is not auto-updated.

Last update: 2024-11-24 06:35:13 UTC


README

Mobikwik driver for the Omnipay PHP payment processing library

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements Mobikwik support for Omnipay.

用法

发起交易

$gateway = Omnipay::create('Mobikwik_Express');
$gateway->setMid('MBK9002');
$gateway->setKey('xxxxx');
$gateway->setEnvironment('test');


$params = [
	'email' => "7291994120@nocash.mobikwik.com",
	'orderId' => 'order' . time(),
	'amount' => 0.01,
	'redirecturl' => "http://example.com/callback",
	'showmobile' => 'true',
	'version' => 2,
];


$response = $gateway->purchase($params)->send();
$response->redirect();

交易通知

$gateway->setMid('MBK9002');
$gateway->setKey('xxxxx');
$gateway->setEnvironment('test');

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

订单查询

$gateway->setMid('MBK9002');
$gateway->setKey('xxxxx');
$gateway->setEnvironment('test');

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

发起退款

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

$gateway->setMid('MBK9002');
$gateway->setKey('xxxxx');
$gateway->setEnvironment('test');
$params = [
	'orderId' => 'order0011521618722233',
	'amount' => 0.01
];

$response = $gateway->refund($params)->send();
if ($response->isPaid()) { // 成功
...
} elseif ($response->isFailure()) { // 失败
...
} else { // 进行中
...
}