2014-05-07 44 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>