【发布时间】:2019-09-11 20:56:26
【问题描述】:
我对新的 PayPal API (v2) 和沙盒有疑问
1- 创建订单https://api.sandbox.paypal.com/v2/checkout/orders
{
"intent": "CAPTURE",
"purchase_units": [
{
"amount": {
"currency_code": "USD",
"value": 10
},
"payee": {
"email": "xxxx@gmail.com",
"merchant_id": "xxxx"
}
}
],
"application_context": {
"shipping_preference": "NO_SHIPPING"
}
}
2- 转到响应中的approve 链接
如果沙盒帐户有信用卡,PayPal 会显示:“抱歉,我们无法处理您的请求。请稍后再试”
3- 登录并批准订单
沙盒帐户没有信用卡
单击继续按钮时,页面显示加载指示符,然后再次消失,没有任何反应
4- 查看订单状态,APPROVED
{
...
"status": "APPROVED"
...
}
5- 尝试捕获付款https://api.sandbox.paypal.com/v2/checkout/orders/xxx/capture
{
"name": "UNPROCESSABLE_ENTITY",
"details": [
{
"issue": "TRANSACTION_REFUSED",
"description": "The request was refused"
}
],
"message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
"debug_id": "939b641049ad2",
"links": [
{
"href": "https://developer.paypal.com/docs/api/orders/v2/#error-TRANSACTION_REFUSED",
"rel": "information_link",
"method": "GET"
}
]
}
【问题讨论】:
-
你试过旧的 API 吗?
-
他们说它在 v1 的文档中已被弃用
标签: paypal paypal-sandbox