2017-08-16 178 views
9

在eBay訂單API --inititCheckoutSession(來賓結帳)中,添加信用卡信息會返回錯誤。我正在沙箱環境中測試。eBay訂單API在沙箱環境中拋出錯誤

API:https://api.sandbox.ebay.com/buy/order/v1/guest_checkout_session/initiate 請求正文:

 { 
"creditCard": 
    { 
    "accountHolderName": "Frank Smith", 
    "cardNumber": "5100000001598174", 
    "cvvNumber": "012", 
    "expireMonth": 10, 
    "expireYear": 2019, 
    "brand": "MASTERCARD", 
    "billingAddress": 
    { 
     "firstName": "Frank", 
     "lastName": "Smith", 
     "addressLine1": "3737 Any St", 
     "city": "San Jose", 
     "stateOrProvince": "CA", 
     "postalCode": "95134", 
     "country": "US" 
    } 
}, 
    "contactEmail": "[email protected]", 
    "contactFirstName": "Frank", 
    "contactLastName": "Smith", 
    "shippingAddress": { 
    "recipient": "Frank Smith", 
    "phoneNumber": "617 555 1212", 
    "addressLine1": "3737 Any St", 
    "city": "San Jose", 
    "stateOrProvince": "CA", 
    "postalCode": "95134", 
    "country": "US" 
    }, 
    "lineItemInputs": [ 
    { 
     "quantity": 1, 
     "itemId": "v1|110188913683|0" 
    } 
    ] 
} 

響應:如果信用卡的詳細信息不在要求

{ 
    "errors": [ 
     { 
      "errorId": 15000, 
      "domain": "API_ORDER", 
      "category": "APPLICATION", 
      "message": "There was a problem with an eBay internal system or process. Contact eBay developer support for assistance.", 
      "parameters": [ 
       { 
        "name": "code", 
        "value": "1042" 
       } 
      ] 
     } 
    ] 
} 

API工作正常。有人可以幫忙嗎?

+0

您的要求似乎是正確的格式。我認爲最好能夠坦誠地聯繫ebay支持。 –

+0

您的測試項目有運費?嘗試將固定價格的運送選項添加到您的測試項目。 –

+0

嗨岡薩雷斯Gokhan,你可以請教如何添加固定定價選項項目? – Rini

回答

1

根據eBay訂單API文檔,您的請求有效負載很好,但是如果您檢查了來賓結帳樣本,它們在請求中沒有信用卡對象。他們還提到,如果您在此請求中沒有信用卡信息,那麼您可以致電updatePaymentInfoGuest將信用卡信息添加到結帳會話。

文檔鏈接:

的輸入是買家的電子郵件,名稱,地址和項目編號和數量的每個項目。在結帳會話中,您最多可以有任意數量的四件單件物品。每件商品都與唯一的訂單項關聯。或者,您可以包含買方的付款信息。如果您在此次調用中不包含此信息,則可以使用updatePaymentInfoGuest調用將此信息添加到結帳會話。

作爲客人結帳時響應沒有有關該錯誤多的信息,我建議你嘗試以下....

  1. 通話客人結賬沒有信用卡信息(buy/order/v1/guest_checkout_session/initiate)使用結賬會話ID從上面(buy/order/v1/guest_checkout_session/{checkoutSessionId}/update_payment_info

結帳會話請求架構

  • 呼叫更新支付與CRED-T卡信息資料:

    { 
        "contactEmail": "string", 
        "contactFirstName": "string", 
        "contactLastName": "string", 
        "creditCard": { 
        "accountHolderName": "string", 
        "billingAddress": { 
         "addressLine1": "string", 
         "addressLine2": "string", 
         "city": "string", 
         "country": "CountryCodeEnum : [AD,AE,AF,AG,AI,AL,AM,AN,AO,AQ,AR,AS,AT,AU,AW,AX,AZ,BA,BB,BD,BE,BF,BG,BH,BI,BJ,BL,BM,BN,BO,BQ,BR,BS,BT,BV,BW,BY,BZ,CA,CC,CD,CF,CG,CH,CI,CK,CL,CM,CN,CO,CR,CU,CV,CW,CX,CY,CZ,DE,DJ,DK,DM,DO,DZ,EC,EE,EG,EH,ER,ES,ET,FI,FJ,FK,FM,FO,FR,GA,GB,GD,GE,GF,GG,GH,GI,GL,GM,GN,GP,GQ,GR,GS,GT,GU,GW,GY,HK,HM,HN,HR,HT,HU,ID,IE,IL,IM,IN,IO,IQ,IR,IS,IT,JE,JM,JO,JP,KE,KG,KH,KI,KM,KN,KP,KR,KW,KY,KZ,LA,LB,LC,LI,LK,LR,LS,LT,LU,LV,LY,MA,MC,MD,ME,MF,MG,MH,MK,ML,MM,MN,MO,MP,MQ,MR,MS,MT,MU,MV,MW,MX,MY,MZ,NA,NC,NE,NF,NG,NI,NL,NO,NP,NR,NU,NZ,OM,PA,PE,PF,PG,PH,PK,PL,PM,PN,PR,PS,PT,PW,PY,QA,RE,RO,RS,RU,RW,SA,SB,SC,SD,SE,SG,SH,SI,SJ,SK,SL,SM,SN,SO,SR,ST,SV,SX,SY,SZ,TC,TD,TF,TG,TH,TJ,TK,TL,TM,TN,TO,TR,TT,TV,TW,TZ,UA,UG,UM,US,UY,UZ,VA,VC,VE,VG,VI,VN,VU,WF,WS,YE,YT,ZA,ZM,ZW]", 
         "county": "string", 
         "firstName": "string", 
         "lastName": "string", 
         "postalCode": "string", 
         "stateOrProvince": "string" 
        }, 
        "brand": "string", 
        "cardNumber": "string", 
        "cvvNumber": "string", 
        "expireMonth": "integer", 
        "expireYear": "integer" 
        }, 
        "lineItemInputs": [ 
        { 
         "itemId": "string", 
         "quantity": "integer" 
        } 
        ], 
        "shippingAddress": { 
        "addressLine1": "string", 
        "addressLine2": "string", 
        "city": "string", 
        "country": "CountryCodeEnum : [AD,AE,AF,AG,AI,AL,AM,AN,AO,AQ,AR,AS,AT,AU,AW,AX,AZ,BA,BB,BD,BE,BF,BG,BH,BI,BJ,BL,BM,BN,BO,BQ,BR,BS,BT,BV,BW,BY,BZ,CA,CC,CD,CF,CG,CH,CI,CK,CL,CM,CN,CO,CR,CU,CV,CW,CX,CY,CZ,DE,DJ,DK,DM,DO,DZ,EC,EE,EG,EH,ER,ES,ET,FI,FJ,FK,FM,FO,FR,GA,GB,GD,GE,GF,GG,GH,GI,GL,GM,GN,GP,GQ,GR,GS,GT,GU,GW,GY,HK,HM,HN,HR,HT,HU,ID,IE,IL,IM,IN,IO,IQ,IR,IS,IT,JE,JM,JO,JP,KE,KG,KH,KI,KM,KN,KP,KR,KW,KY,KZ,LA,LB,LC,LI,LK,LR,LS,LT,LU,LV,LY,MA,MC,MD,ME,MF,MG,MH,MK,ML,MM,MN,MO,MP,MQ,MR,MS,MT,MU,MV,MW,MX,MY,MZ,NA,NC,NE,NF,NG,NI,NL,NO,NP,NR,NU,NZ,OM,PA,PE,PF,PG,PH,PK,PL,PM,PN,PR,PS,PT,PW,PY,QA,RE,RO,RS,RU,RW,SA,SB,SC,SD,SE,SG,SH,SI,SJ,SK,SL,SM,SN,SO,SR,ST,SV,SX,SY,SZ,TC,TD,TF,TG,TH,TJ,TK,TL,TM,TN,TO,TR,TT,TV,TW,TZ,UA,UG,UM,US,UY,UZ,VA,VC,VE,VG,VI,VN,VU,WF,WS,YE,YT,ZA,ZM,ZW]", 
        "county": "string", 
        "phoneNumber": "string", 
        "postalCode": "string", 
        "recipient": "string", 
        "stateOrProvince": "string" 
        } 
    } 
    

    更新付款信息申請模式:

    { /* UpdatePaymentInformation */ 
        "creditCard": { /* CreditCard */ 
         "accountHolderName": "string", 
         "billingAddress": { /* BillingAddress */ 
          "addressLine1": "string", 
          "addressLine2": "string", 
          "city": "string", 
          "country": "CountryCodeEnum : [AD,AE,AF...]", 
          "county": "string", 
          "firstName": "string", 
          "lastName": "string", 
          "postalCode": "string", 
          "stateOrProvince": "string" 
         }, 
         "brand": "string", 
         "cardNumber": "string", 
         "cvvNumber": "string", 
         "expireMonth": "integer", 
         "expireYear": "integer" 
        } 
    } 
    
  • +0

    嗨JRG,它的工作很好,當信用卡信息沒有提供要求。所以我認爲訪問令牌是正確的。 – Rini

    +0

    嗨Rini,它似乎結帳api響應沒有任何豐富的信息,所以你應該調用結帳api沒有CC信息,然後調用updatePaymentInfo CC信息和checkoutSessionId從結帳API調用。這應該可以解決你的問題。我已經更新了我的答案,並提供了有關樣本文檔的apis和鏈接的所有詳細信息。 – JRG

    +0

    謝謝JRG。它的工作:) – Rini