rest - 通过 Paypal REST API 使用 Paypal 付款不会在 Paypal 沙盒或实时网站上显示付款说明

标签 rest paypal paypal-sandbox

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

付款执行得很好,完全按照它应该的方式执行。用户选择使用 Paypal 付款,然后被重定向到 Paypal 站点,他需要在该站点登录并批准付款。我发送给 Paypal 的 JSON 数据几乎就是上面链接中指定的内容,我的数据如下所示:

{
  "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 网站时,描述和总金额列显示为空白

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

这是它的样子:

enter image description here

对于那些想表明用户尚未登录的人,好吧,即使登录后,描述和当前购买栏仍然是空白。

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

注意:此问题在实时服务器和沙盒服务器中都存在。

最佳答案

上面页面的左手平移显示: 1.订单中的项目详细信息。您可以将项目列表作为支付资源中交易详细信息的一部分。同样会在这里显示。 2. 交易金额的构成运费、税金等,如果您在请求中包含它们。

尝试此请求以查看示例:

{
    "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"
                    }
                ]
            }
        }
    ]
}

关于rest - 通过 Paypal REST API 使用 Paypal 付款不会在 Paypal 沙盒或实时网站上显示付款说明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15885742/

相关文章:

paypal - 3D Security 使用 Paypal 为美国商户帐户

具有不同权限的 RESTful 端点

rest - Grails 3应用程序中使用Spring Security Rest对 “refresh_token”请求的403响应

javascript - 如何使用 ngResource 为集合和单个记录指定不同的 URL

php - 我们很抱歉。该卖家不接受以您的货币付款

php paypal pro(高级)集成问题

javascript - Cockpit-CMS:如何访问简单 HTML 页面上的数据

php - Paypal html按钮自定义字段限制

此商家已禁用 PayPal DPRP

python - 显式等待在基于 Angular 的 PayPal 沙箱上不起作用