在生产中处理贝宝付款时出错

时间:2016-09-23 21:30:54

标签: paypal

我们使用paypal的SOAP API来处理付款,沙盒付款处理工作正常,但在生产中失败并带有以下响应。我不了解transactions.amount.details字段

请求:

{"transactions": [
{
  "description": "",
  "amount": {
    "total": "1.00",
    "currency": "USD",
    "details": null
  }
}
],
"payer": {
"payment_method": "credit_card",
"funding_instruments": [
  {
    "credit_card": {
      "type": "visa",
      "last_name": "xxxxx",
      "first_name": "xxxx",
      "expire_year": "xxxx",
      "expire_month": "xx",
      "cvv2": "701",
      "number": "xxxxxxxxxxxxxxx",
      "billing_address": {
        "state": "CA",
        "postal_code": "94704",
        "phone": null,
        "line2": null,
        "line1": "xxxxxxxxxxx",
        "country_code": "xx",
        "city": "xxxxxxxx"
      }
    }
  }
]
},
"intent": "sale"}

响应:

"status": 400,
"duration_time": 113,
"body": {
    "message": "Invalid request - see details",
    "information_link": "https://developer.paypal.com/docs/api/#VALIDATION_ERROR",
    "details": [
        {
            "field": "transactions.amount.details",
            "issue": "This field name is not defined for this resource type"
        }
    ],
    "name": "VALIDATION_ERROR",
    "debug_id": "251e5ad7494cf"
},
"additional_properties": {},
"header": {
    "Content-Length": "289",
    "Content-Language": "*",
    "CORRELATION-ID": "251e5ad7494cf",
    "Date": "Tue, 20 Sep 2016 09:25:17 GMT",
    "Connection": "close",
    "Paypal-Debug-Id": "251e5ad7494cf",
    "PROXY_SERVER_INFO": "host=dcg12javapapi9720.dcg12.slc.paypalinc.com;threadId=329",
    "Content-Type": "application/json"
}

1 个答案:

答案 0 :(得分:1)

根据概述here,它希望将对象逐项列入小计,运费等。

示例:

"amount": {
     "total": "7.47",
     "currency": "USD",
     "details": {
         "subtotal": "7.41",
         "tax": "0.03",
         "shipping": "0.03"
     }
 }