PayPal-PHP-SDK代码错误

时间:2016-02-03 23:48:58

标签: php paypal

我使用的是Paypal-PHP。 SDK,我希望得到代码错误。当我输入错误的信用卡数据时,我得到这个JSON作为答案:

{
"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"}

但我需要错误代码。我怎么能得到它?

由于

1 个答案:

答案 0 :(得分:1)

REST API通常不会返回错误代码,例如经典API。没有与错误消息关联的错误代码。

它只返回错误对象name debug_id message information_link details