我正在尝试使用PayPal - OmniPay将自定义值传递给付款
下面是我使用的代码:
$response = $gateway->purchase(
array(
'cancelUrl'=>base_url().'checkout/cancel',
'returnUrl'=>base_url().'checkout/confirm',
'amount' => number_format($retn['invoiceDatas']['price'], 2, '.', ''),
'description' => 'Facture #'.$id,
'currency' => 'EUR',
'transactionid'=> $id,
'custom' => $id,
'description' => 'Facture'
)
)->send();
$response->redirect();
下面是结帐页面中的代码:
$response = $gateway->completePurchase(array('amount' => 75.00, 'currency' => 'EUR'))->send();
$data = $response->getData(); // this is the raw response object
echo '<pre>';
print_r($data);
echo '</pre>';
但是在数据打印数组中,我有很多信息,但是没有关于"transactionID“或"custom”变量的信息。
请帮帮忙。谢谢
发布于 2014-06-16 04:34:06
在Omnipay/PayPal中没有custom
参数这样的东西。
您应该将此数据存储在数据库中,然后根据transactionId进行查找。参数。
由于PayPal不会将其传回给您,因此最简单的解决方案是创建自定义returnUrl
。例如:
'returnUrl' => base_url().'checkout/confirm/'.$id,
然后,当您的客户登录returnUrl时,您可以根据段3(交易ID)从数据库中查找交易,并将其标记为已支付。
发布于 2014-06-09 01:44:21
我认为你应该用大写字母传递'transactionID'=> $id,
,而不是'transactionid'=> $id,
。
https://stackoverflow.com/questions/24108899
复制相似问题