1

我正在尝试将自定义值传递给使用 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”或“自定义”变量的信息。

请帮忙。谢谢

4

2 回答 2

1

customOmnipay/PayPal 中没有参数之类的东西。

您应该将此数据存储在数据库中,然后根据 transactionId 进行查找。范围。

由于 PayPal 不会将此返回给您,因此最简单的解决方案是创建一个自定义returnUrl. 例如:

'returnUrl' => base_url().'checkout/confirm/'.$id,

然后,当您的客户登陆 returnUrl 时,您可以根据段 3(交易 ID)从数据库中查找交易,并将其标记为已付款。

于 2014-06-15T20:34:05.810 回答
0

我认为您应该'transactionID'=> $id,使用大写字母,而不是'transactionid'=> $id,.

于 2014-06-08T17:44:20.750 回答