2014-05-07 42 views
0

使用REST API創建審批付款時出現問題。 我創建與pyment_method =「貝寶」Paypal內部服務器錯誤其餘審批付款

while i'm sending to paypal server my json file as 

"{"transactions":[ 
{"amount":{"currency":"USD","total":"12","details":{}}, 
"description":"This is the payment transaction description."} 
] 
,"links":[], 
"intent":"sale","payer":{ 
"funding_instruments":[],"payment_method":"paypal"} 
}" 

this is 
result: Object 
debug_id: "086b180fbe2f1" 
information_link: "https://developer.paypal.com/webapps/developer/docs/api/#INTERNAL_SERVICE_ERROR" 
message: "An internal service error has occurred" 
name: "INTERNAL_SERVICE_ERROR" 

回答

0

你,包括你不應該元素的支付,以及缺少重要的。如果你正在建立一個支付寶付款,你需要有取消並返回網址:

{ 
    "redirect_urls":{ 
     "return_url":"http://<return URL here>", 
     "cancel_url":"http://<cancel URL here>" 
    }, 
    "transactions":[ 
     { 
      "amount":{ 
       "currency":"USD", 
       "total":"12.00" 
      }, 
      "description":"This is the payment transaction description." 
     } 
    ], 
    "intent":"sale", 
    "payer":{ 
     "payment_method":"paypal" 
    } 
} 

爲指導

0

在我來說,我的Content-Type頭設置爲application/json,並得到有意義的響應:

{"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":"688b8ab4b2895"} 

相反的:

<ns1:XMLFault xmlns:ns1="http://cxf.apache.org/bindings/xformat"><ns1:faultstring xmlns:ns1="http://cxf.apache.org/bindings/xformat">java.lang.NullPointerException</ns1:faultstring></ns1:XMLFault>