2016-02-03 70 views
1

我正在使用Paypal-PHP。 SDK,我想獲取代碼錯誤。當我把錯誤的信用卡數據,我得到這個JSON作爲答案:PayPal-PHP-SDK代碼錯誤

{ 
"name":"CREDIT_CARD_REFUSED", 
"message":"Credit card was refused", 
    "information_link":"https://developer.paypal.com/webapps/developer/docs/api /#CREDIT_CARD_REFUSED", 
"debug_id":"63a9cf220d272" 
} 

或本:

{"name":"VALIDATION_ERROR", 
     "details":[ 
      {"field":"payer.funding_instruments[0].credit_card.expire_month","issue":"Must not be blank"}, 
      {"field":"payer.funding_instruments[0].credit_card.expire_year","issue":"Must not be blank"}, 
      {"field":"payer.funding_instruments[0].credit_card.cvv2","issue":"Must be numeric"}], 
     "message":"Invalid request - see details","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#VALIDATION_ERROR","debug_id":"8e61a15a1bf4a"} 

但我需要的錯誤代碼。我怎麼才能得到它?

謝謝

+0

我會建議用了一段時間親自經典API堅持錯誤對象。這個[PayPal PHP SDK](https://www.angelleye.com/product/paypal-sdk-php/)使得這些調用對您來說非常快速和簡單,而且它仍然具有比REST更多的功能。 –

回答

1

REST API通常不會像傳統API那樣返回錯誤代碼。沒有與錯誤消息關聯的錯誤代碼。

它只是返回與namedebug_idmessageinformation_linkdetails