paypal - 快速结账、交易详情、购物车不显示选项

标签 paypal

产品信息通过 SetExpressCheckout 传递并全部显示在支付页面上,所有相同的信息通过 DoExpressCheckoutPayment 发送并且交易成功。 在卖家沙盒帐户中审查交易时,使用 L_PAYMENTREQUEST_n_DESCm 发送的信息不会出现在购物车内容的“选项”部分,但是来自所有其他参数的信息 (L_PAYMENTREQUEST_n_NAMEm, L_PAYMENTREQUEST_n_NUMBERm, L_PAYMENTREQUEST_n_AMTm, L_PAYMENTREQUEST_n_QTYm) 显示。我也尝试过使用 L_DESCm 但结果相同。

我尝试了一个基于 this guide 的非常基本的示例.

我使用 3 个 HTML 表单完成了一个交易,该交易复制了所列问题。

<form method=post action=https://api-3t.sandbox.paypal.com/nvp>
    <input type=hidden name=USER value=yourusr>
    <input type=hidden name=PWD value=yourpwd>
    <input type=hidden name=SIGNATURE value=yoursig>
    <input type=hidden name=VERSION value=93>
    <input type=hidden name=PAYMENTREQUEST_0_PAYMENTACTION value=Sale>
    <input type=hidden name=L_PAYMENTREQUEST_0_NAME0 value="Decaf Coffee Blend">
    <input type=hidden name=L_PAYMENTREQUEST_0_NUMBER0 value=623083>
    <input type=hidden name=L_PAYMENTREQUEST_0_DESC0 value="8oz vacuum pack">
    <input type=hidden name=L_PAYMENTREQUEST_0_AMT0 value=19.95>
    <input type=hidden name=L_PAYMENTREQUEST_0_QTY0 value=1>

    <input type=hidden name=PAYMENTREQUEST_0_AMT value=19.95>

    <input type=hidden name=PAYMENTREQUEST_0_CURRENCYCODE value=GBP>
    <input type=hidden name=RETURNURL value=http://www.yourdomain.co.uk/return.html>
    <input type=hidden name=CANCELURL value=http://www.yourdomain.co.uk/home.html>


    <input type=submit  name=METHOD value=SetExpressCheckout>
</form>








<form method=post action=https://api-3t.sandbox.paypal.com/nvp>
    <input type=hidden name=USER value=yourusr>
    <input type=hidden name=PWD value=yourpwd>
    <input type=hidden name=SIGNATURE value=yoursig>
    <input type=hidden name=VERSION value=93.0>
    <input name=TOKEN value=overtype with your token>
    <input type=submit name=METHOD value=GetExpressCheckoutDetails>
</form>




<form method=post action=https://api-3t.sandbox.paypal.com/nvp>
    <input type=hidden name=USER value=yourusr>
    <input type=hidden name=PWD value=yourpwd>
    <input type=hidden name=SIGNATURE value=yoursig>
    <input type=hidden name=VERSION value=93>
    <input type=hidden name=PAYMENTREQUEST_0_PAYMENTACTION value=Sale>
    <input name=PAYERID value=overtype with your payerid>
    <input name=TOKEN value=overtype with your token>

        <input type=hidden name=L_PAYMENTREQUEST_0_NAME0 value="Decaf Coffee Blend">
    <input type=hidden name=L_PAYMENTREQUEST_0_NUMBER0 value=623083>
    <input type=hidden name=L_PAYMENTREQUEST_0_DESC0 value="8oz vacuum pack">
    <input type=hidden name=L_PAYMENTREQUEST_0_AMT0 value=19.95>
    <input type=hidden name=L_PAYMENTREQUEST_0_QTY0 value=1>

    <input type=hidden name=PAYMENTREQUEST_0_AMT value=19.95>

    <input type=hidden name=PAYMENTREQUEST_0_CURRENCYCODE value=GBP>


    <input type=submit name=METHOD value=DoExpressCheckoutPayment>
</form>

最佳答案

DESC 参数在 Express Checkout 中基本上被忽略了。多年来,他们把它包括在内但似乎没有使用它,这让我很恼火。

如果您想在 PayPal 付款中提供有关商品的详细信息,您需要在请求中包含实际的购物车商品详细信息。

看看我的Express Checkout demo对于我的 PHP class library for PayPal ,顺便说一下,这将使对 PayPal 的 API 调用比您正在做的更快、更容易。

无论如何,该演示包括一个基本的快速结帐以及一个带有订单项的结帐。您应该查看带有行项目的那个,以便您可以重现它在做什么。

你也可以只看 API documentation specific to cart items in Express Checkout .就像您提到的那样,您需要确保在 SEC 和 DECP 中包含所有这些详细信息,以便它们显示在最终付款详细信息中。

关于这一点,DECP 确实包含一个 USESESSIONPAYMENTDETAILS 参数,您可以将其设置为 true。完成此操作后,它将继续使用包含在 SEC 中的详细信息,因此您不必将它们再次包含在 DECP 中。

希望对您有所帮助!

关于paypal - 快速结账、交易详情、购物车不显示选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28325533/

相关文章:

api - 如何从 PayPal 获取 API 用户名、密码和签名以在第三方插件中使用

Paypal Rest api : billing plan, payment_definitions "cycles"的含义

php - Sandbox Paypal Pro 不工作

javascript - Paypal 快速结帐集成安全问题

Paypal Buy Now 会触发收到付款的 webhooks 吗?

angular - 如何在paypal angular 4中的onAuthorize内部调用外部函数

asp.net-mvc-3 - 为什么 PayPal 忽略 discount_amount_cart?

php - Paypal 与 PHP 集成

paypal - 使用 Paypal 沙箱测试应用程序

php - 通过oauth的paypal rest api凭据