转到PayPal REST API格式错误的请求

时间:2017-01-11 14:06:24

标签: json rest go paypal

我正在尝试使用REST API创建付款。我正在生成有效的JSON,但PayPal使用

响应我的请求
{"name":"MALFORMED_REQUEST","message":"Incoming JSON request does not map to API request","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#MALFORMED_REQUEST","debug_id":"2cfe09ef6f5db"}

这是JSON请求

{
   "intent":"sale",
   "payer":{
      "payment_method":"paypal"
   },
   "transactions":[
      {
         "reference_id":"",
         "amount":{
            "currency":"EUR",
            "total":"10",
            "details":{
               "subtotal":"",
               "shipping":"",
               "tax":"",
               "handling_fee":"",
               "shipping_discount":"",
               "insurance":"",
               "gift_wrap":""
            }
         },
         "description":"gopaypal create payment test",
         "note_to_payee":"",
         "custom":"gopaypal-test",
         "invoice_number":"",
         "soft_descriptor":"",
         "payment_options":{
            "allowed_payment_method":""
         },
         "item_list":{
            "items":[
               {
                  "sku":"",
                  "name":"Item test",
                  "description":"",
                  "quantity":"",
                  "price":"10",
                  "currency":"EUR",
                  "tax":"",
                  "url":""
               }
            ],
            "shipping_method":"",
            "shipping_phone_number":""
         },
         "notify_url":"",
         "order_url":""
      }
   ],
   "redirect_urls":{
      "return_url":"http://dev.tudescontento.es/paypal/return",
      "cancel_url":"http://dev.tudescontento.es/paypal/return"
   }
}

请求没有问题。我的问题是我传递给我的请求的JSON。

查看文档我的请求似乎完全符合PayPal所期望的

0 个答案:

没有答案