【发布时间】: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,否则将被忽略。
-
谢谢。我现在遇到的唯一问题是,在扣款后,付款人会转帐,但没有转给买方。有什么想法有什么问题吗?