Laravel 4 Omnipay Payfast notify_url Laravel 4
我正在努力完成我的omnipay laravel 4和Payfast集成。我已经到了可以成功进行交易的时候了,但是我很难让notify_url正常工作Laravel 4 Omnipay Payfast notify_url Laravel 4,laravel-4,omnipay,Laravel 4,Omnipay,我正在努力完成我的omnipay laravel 4和Payfast集成。我已经到了可以成功进行交易的时候了,但是我很难让notify_url正常工作 $gateway = Omnipay::create('PayFast'); $gateway->setMerchantId = '10000100'; $gateway->setMerchantKey = '46f0cd694581a'; $response = $gateway->purchase(
$gateway = Omnipay::create('PayFast');
$gateway->setMerchantId = '10000100';
$gateway->setMerchantKey = '46f0cd694581a';
$response = $gateway->purchase([
'merchant_id' => '10000100',
'merchant_key' => '46f0cd694581a',
'return_url' => 'http://signup.areweup.co.za/return',
'cancel_url' => 'http://signup.areweup.co.za/cancel',
'notify_url' => 'http://signup.areweup.co.za/notify',
'name_first' => 'Warren',
'name_last' => 'Hansen',
'm_payment_id' => '8542',
'amount' => '39.00',
'item_name' => 'Are We Up',
'description' => 'Peace of mind at just R39 a month.'
])->send();
if ($response->isSuccessful()) {
// payment was successful: update database
print_r($response);
} elseif ($response->isRedirect()) {
// redirect to offsite payment gateway
$response->redirect();
} else {
// payment failed: display message to customer
echo $response->getMessage();
}
我有一个后路由设置来接收ITN响应
$gateway = Omnipay::create('PayFast');
$gateway->setMerchantId = '10000100';
$gateway->setMerchantKey = '46f0cd694581a';
$response = $gateway->CompletePurchase([
'merchant_id' => '10000100',
'merchant_key' => '46f0cd694581a',
'return_url' => 'http://signup.areweup.co.za/return',
'cancel_url' => 'http://signup.areweup.co.za/cancel',
'notify_url' => 'http://signup.areweup.co.za/notify',
'name_first' => 'Warren',
'name_last' => 'Hansen',
'm_payment_id' => '8542',
'amount' => '39.00',
'item_name' => 'Are We Up',
'description' => 'Peace of mind at just R39 a month.'
])->send();
if ($response->isSuccessful()) {
// payment was successful: update database
print_r($response);
} elseif ($response->isRedirect()) {
// redirect to offsite payment gateway
$response->redirect();
} else {
// payment failed: display message to customer
echo $response->getMessage();
}
notify_url的唯一区别是我调用CompletePurchase方法。这里的任何帮助都将不胜感激。ITN Payfast文档位于此处:Payfast使用
返回URL
进行支付返回和通知:
因此,您只需将
completePurchase()
请求放在返回URL上,并删除通知URL。Heya Adrian,感谢帮助人员,我已根据您的信息进行了设置,但我收到一个:缺少PDT或ITN变量错误。不过,使用PDT方法时,我可以让它工作,不过,这在Payfast上已被折旧,ITN只返回丢失的PDT ITN错误。