PayPal付款请求返回HTTP 400响应

时间:2020-03-04 11:02:33

标签: python paypal httprequest

我尝试通过https://api.paypal.com/v1/payments/payment为不同的用户进行付款重新设置,但是对于某些请求(40%),PayPal api返回HTTP 400响应,其余的都很好。请求正文类似于:

{
"intent": "sale",
"payer": {
    "payment_method": "PAYPAL",
    "funding_instruments": [
        {
            "billing": {
                "billing_agreement_id": "B-XXXXX"
            }
        }
    ]
},
"transactions": [
    {
        "amount": {
            "currency": "EUR",
            "details": {
                "subtotal": "11.99",
                "tax": "0.0",
                "shipping": "0.0",
                "handling_fee": "0.0",
                "shipping_discount": "0.0",
                "insurance": "0.0"
            },
            "total": "11.99"
        },
        "invoice_number": "pp_XXXX",
        "custom": "\"{\"payment_id\": \"6102645598795\", \"user_id\": \"28233184743\", \"cid\": \"DE:282331858548:30\"}\""
    }
],
"redirect_urls": {
    "return_url": "https://example.com/return",
    "cancel_url": "https://example.com/cancel"
}
}

并且响应类似于

{
"name": "TRANSACTION_REFUSED",
"message": "The request was refused",
"information_link": "https://developer.paypal.com/docs/api/payments/#errors",
"debug_id": "8e0a927a12",
"code": "TRANSACTION_REFUSED"
}

响应不是信息iv。 有什么主意吗?

1 个答案:

答案 0 :(得分:0)

在联系贝宝支持并共享debug_id之后,他们通知我该错误与无效的资金来源有关。此问题意味着资金来源,信用卡或银行帐户被删除。