gpt4 book ai didi

PayPal 收据不显示使用 SetExpressCheckout 的描述信息

转载 作者:太空宇宙 更新时间:2023-11-03 16:00:51 26 4
gpt4 key购买 nike

我正在使用 PayPal 的 API 通过 SetExpressCheckout 方法处理付款。

$requestParams = array(
'RETURNURL' => 'SUCCESS_PAGE_URL',
'CANCELURL' => 'CANCE_PAGE_URL'
);

$orderParams = array(
'PAYMENTREQUEST_0_AMT' => $price,
'PAYMENTREQUEST_0_SHIPPINGAMT' => '0',
'PAYMENTREQUEST_0_CURRENCYCODE' => 'USD',
'PAYMENTREQUEST_0_ITEMAMT' => $price
);

$item = array(
'L_PAYMENTREQUEST_0_NAME0' => $item_name,
'L_PAYMENTREQUEST_0_DESC0' => $item_description,
'L_PAYMENTREQUEST_0_AMT0' => $price,
'L_PAYMENTREQUEST_0_QTY0' => '1'
);

$paypal = new Paypal();
$response = $paypal -> request('SetExpressCheckout',$requestParams + $orderParams + $item);

一切正常,但即使描述显示在 PayPal 的结帐页面中,我收到的电子邮件收据也缺少描述信息。

有谁知道我怎样才能让描述显示在收据上?

最佳答案

想通了。当 SetExpressCheckout 完成并返回“成功”时,它会被重定向到 PayPal,然后返回到您指定的 RETURNURL。在此 RETURNURL 页面上,对于 DoExpressCheckoutPayment,您需要指定订单详细信息,这就是发票中显示的内容。这是代码:

 // Complete the checkout transaction
$requestParams = array(
'TOKEN' => $_GET['token'],
'PAYMENTACTION' => 'Sale',
'PAYERID' => $_GET['PayerID'],
'PAYMENTREQUEST_0_AMT' => '1', // Same amount as in the original request
'PAYMENTREQUEST_0_CURRENCYCODE' => 'USD' // Same currency as the original request

);

$item = array(
'L_PAYMENTREQUEST_0_NAME0' => $name,
'L_PAYMENTREQUEST_0_DESC0' => $desc, // <-- this is the description
'L_PAYMENTREQUEST_0_AMT0' => $price,
'L_PAYMENTREQUEST_0_QTY0' => '1'
);

$response = $paypal -> request('DoExpressCheckoutPayment',$requestParams + $item);

关于PayPal 收据不显示使用 SetExpressCheckout 的描述信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28910051/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com