通过 Paypal REST API 使用 Paypal 付款不会在 Paypal Sandbox 或实时网站上显示付款说明 [英] Pay with Paypal through Paypal REST API does not show up payment description on Paypal Sandbox or live sites

查看:25
本文介绍了通过 Paypal REST API 使用 Paypal 付款不会在 Paypal Sandbox 或实时网站上显示付款说明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在实施 Paypal 的新 REST API Pay with Paypal 方法,可在此处引用:https://developer.paypal.com/webapps/developer/docs/integration/web/accept-paypal-payment/

I am implementing Paypal's new REST API Pay with Paypal method that can be referenced here: https://developer.paypal.com/webapps/developer/docs/integration/web/accept-paypal-payment/

付款执行得很好,完全应该是这样.用户选择使用 Paypal 支付,然后被重定向到 Paypal 站点,在那里他需要登录并批准付款.我发送 Paypal 的 JSON 数据几乎是上面链接中指定的数据,我的看起来像这样:

The payment executes fine, exactly the way it should be. The user chooses to pay with Paypal and is then redirected to the Paypal site where he is expected to log in and approve the payment. The JSON data that I am sending Paypal is pretty much what is specified in the above link and mine looks like this:

{
  "intent":"sale",
  "redirect_urls":{
    "return_url":"http://<return URL here>",
    "cancel_url":"http://<cancel URL here>"
  },
  "payer":{
    "payment_method":"paypal"
  },
  "transactions":[
    {
      "amount":{
        "total":"7.47",
        "currency":"USD"
      },
      "description":"This is the payment description."
    }
  ]

}

当它将用户重定向到 paypal 网站时,描述和总金额列显示为空白

As it redirects the user to the paypal website, the description and total amount column is shown blank

我不确定这是否是 Paypal 的 REST API 上的错误,但我相信我提供了必要的描述 + 付款金额以反映在此页面上.如果未显示此信息,通常会对用户产生威慑作用,因为他们肯定希望看到他们在 Paypal 网站上支付的金额,即使该金额列在我的网站上.

I am not sure if this is a mistake on Paypal's REST API but I believe I am providing the necessary description + amount payment to be reflected on this page. If this information is not shown, it is typically a deterrent to the user since they would definitely like to see the amount they are paying on the Paypal site even though this amount is listed on my website.

这是它的样子:

对于那些想表明用户尚未登录的人,好吧,即使登录后,描述和当前购买一栏也保持空白.

For those who would like to indicate that the user has not logged in, well, even after logging in, the description and the current purchase column remain blank.

我是否遗漏了需要发送到 Paypal 以指示此描述数据的任何参数?

Am I missing any parameters that need to be sent to Paypal in order to indicate this description data?

注意:此问题在实时服务器和沙盒服务器上仍然存在.

Note: This issue persists for both the live and sandbox servers.

推荐答案

上图左侧平移显示:1. 订单中的商品详情.您可以在付款资源中包含项目列表作为交易详细信息的一部分.此处将显示相同的内容.2. 交易金额的组成部分,例如运费、税金等(如果您将它们包含在请求中).

The left hand pan in above page displays: 1. Item details from order. You can include item list as part of the transaction details in payment resource. The same will be displayed here. 2. Components of the transaction amount e.g. shipping amount, tax, etc. if you include them in request.

尝试此请求以查看示例:

Try this request to see example:

{
    "intent": "sale",
    "payer": {
        "payment_method": "paypal"
    },
    "redirect_urls": {
        "return_url": "http://<return url>",
        "cancel_url": "http://<cancle url>"
    },
    "transactions": [
        {
            "amount": {
                "total": "8.00",
                "currency": "USD",
                "details": {
                    "subtotal": "6.00",
                    "tax": "1.00",
                    "shipping": "1.00"
                }
            },
            "description": "This is payment description.",
            "item_list": { 
                "items":[
                    {
                        "quantity":"3", 
                        "name":"Hat", 
                        "price":"2.00",  
                        "sku":"product12345", 
                        "currency":"USD"
                    }
                ]
            }
        }
    ]
}

这篇关于通过 Paypal REST API 使用 Paypal 付款不会在 Paypal Sandbox 或实时网站上显示付款说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆