【问题标题】:Infinity loop in paypal multi seller贝宝多卖家中的无限循环
【发布时间】:2021-09-17 10:50:43
【问题描述】:

我目前正在使用 paypal api v2 编写一个 paypal 多卖家结账程序。在结帐时,我总是在单击继续后陷入循环。它只是说处理并保持不变。我也尝试创建另一个 Paypal 应用程序但同样的问题。我该如何解决这个问题?我使用以下代码生成订单:

const axios = require('axios')

axios
  .post('https://api-m.sandbox.paypal.com/v2/checkout/orders', {
        "intent":"CAPTURE",
        "application_context":{
        "return_url":"C:\Users\Felix\Desktop\index.html",
        "cancel_url":"C:\Users\Felix\Desktop\index.html"
    },
        "purchase_units":[
          {
             "reference_id":"test1",
             "payee": {
                    "email_address": "sb-lgj1x6610750@business.example.com"
             },
             "amount":{
                "currency_code":"EUR",
                "value":"100.00"
             },
             "payment_instruction":{
                "disbursement_mode":"INSTANT",
                "platform_fees":[
                   {
                      "amount":{
                         "currency_code":"EUR",
                         "value":"2.00"
                      }
                   }
                ]
             }
          },
          {
             "reference_id":"test2",
             "payee": {
                    "email_address": "sb-bong06236339@business.example.com"
             },
             "amount":{
                "currency_code":"EUR",
                "value":"7.00"
             },
             "payment_instruction":{
                "disbursement_mode":"INSTANT",
                "platform_fees":[
                   {
                      "amount":{
                         "currency_code":"EUR",
                         "value":"2.00"
                      }
                   }
                ]
             }
          }
        ]
  },{
      headers:{
            'Content-Type': "application/json",
            'Authorization': "Bearer A21AAJwo7sZjHVhLX3jHjR3HQzE-ojoUzbJUe--WXulQqOzEoV8sF0wNgCUqhOO3N3mDQl5pjnogxOBFmwywr3iXPpj9_VmGA",
            'PayPal-Partner-Attribution-Id': 'FLAVORsb-7vgls6637891_MP'
      }
  })
  .then(res => {
    console.log(`statusCode: ${res.statusCode}`)
    console.log(res.data)
  })
  .catch(error => {
    console.error(error)
  })

【问题讨论】:

  • return_url 必须是有效的 HTTP url,否则将被忽略。
  • 谢谢。我现在遇到的唯一问题是,在扣款后,付款人会转帐,但没有转给买方。有什么想法有什么问题吗?

标签: api rest paypal


【解决方案1】:

return_url 必须是有效的 HTTP/S

收款(卖家)账户的电子邮件必须在沙盒环境中确认,https://www.sandbox.paypal.com/businessprofile/settings/email - 如果他们没有交易货币(本例中为欧元)的余额,他们必须接受以他们账户的接口以打开此类余额,或启用收款首选项以自动将收到的付款转换为其帐户的主要余额(通常为美元,取决于国家/地区)

【讨论】:

    猜你喜欢
    • 2013-03-09
    • 1970-01-01
    • 2012-06-25
    • 2014-07-11
    • 2012-09-12
    • 2012-05-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多