【发布时间】:2017-09-24 01:07:30
【问题描述】:
我正在尝试使用omnipay/paypal,我将此代码用于returnUrl 页面:
public function completePayment(Request $request)
{
//return 'pagina dopo acquisto';
$gateway = Omnipay::create('PayPal_Express');
$gateway->setUsername('blastor_89-facilitator_api1.msn.com');
$gateway->setPassword('BEWB2BEW9CHCV3EQ');
$gateway->setSignature('AFcWxV21C7fd0v3bYYYRCpSSRl31AC5Dp4AnVYBnMIkNFxSQTj8h.lqD');
$gateway->setTestMode(true);
$params = session()->get('params');
$response = $gateway->completePurchase($params)->send();
$paypalResponse = $response->getData();
//$this->store($paypalResponse);
if(isset($paypalResponse['PAYMENTINFO_0_ACK']) && $paypalResponse['PAYMENTINFO_0_ACK'] === 'Success') {
// here you process the response. Save to database ...
}
else {
// Failed transaction ...
}
}
它以 $paypalResponse 响应,而如果我使用 notifyUrl 页面, notifyUrl 会响应什么?有什么区别?
【问题讨论】:
标签: paypal paypal-ipn paypal-sandbox omnipay