2017-01-31 72 views
6

我在使用沙箱憑證進行PayPal支付時使用卡給予回覆。PayPal支付狀態爲「DEAD」

{ 
    "client": { 
     "environment": "sandbox", 
     "paypal_sdk_version": "2.14.6", 
     "platform": "Android", 
     "product_name": "PayPal-Android-SDK" 
    }, 
    "response": { 
     "create_time": "2017-01-31T08:12:40Z", 
     "id": "PAY-*************", 
     "intent": "sale", 
     "state": "created" 
    }, 
    "response_type": "payment" 
} 

然後我試圖利用休息API調用並得到付款迴應「死」狀態,以獲得通過付款ID的全部細節。請檢查以下回復

{ 
    "id": "PAY-*************", 
    "create_time": "2017-01-31T08:12:40Z", 
    "update_time": "2017-01-31T08:13:22Z", 
    "state": "DEAD", 
    "intent": "sale", 
    "payer": { 
    "payment_method": "credit_card", 
    "funding_instruments": [ 
     { 
     "credit_card": { 
      "type": "visa", 
      "number": "xxxxxxxxxxxx1111", 
      "expire_month": "11", 
      "expire_year": "2025" 
     } 
     } 
    ] 
    }, 
    "transactions": [ 
    { 
     "amount": { 
     "total": "2.00", 
     "currency": "USD", 
     "details": { 
      "subtotal": "2.00" 
     } 
     }, 
     "description": "New Product", 
     "related_resources": [] 
    } 
    ], 
    "links": [ 
    { 
     "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-*************", 
     "rel": "self", 
     "method": "GET" 
    } 
    ] 
} 

任何人都可以請幫我理解爲什麼我得到這個?如何解決這個問題?

+0

嘿!你是如何解決這個問題的? –

回答

3

最後我得到了解決方案。在這裏回覆有點晚,但這個答案可以爲那些仍在掙扎的人們節省時間。

創建付款後,下面的JSON由Android SDK返回,但我們可以看到其狀態尚未獲得批准。如果我們使用付款查找API(https://api.sandbox.paypal.com/v1/payments/payment/PAY-*************)驗證付款,我們將收到DEAD狀態,並且不會有任何交易ID。這對我

工作

{ 
    "client": { 
     "environment": "sandbox", 
     "paypal_sdk_version": "2.14.6", 
     "platform": "Android", 
     "product_name": "PayPal-Android-SDK" 
    }, 
    "response": { 
     "create_time": "2017-01-31T08:12:40Z", 
     "id": "PAY-*************", 
     "intent": "sale", 
     "state": "created" 
    }, 
    "response_type": "payment" 
} 

解決的問題是我在沙箱中創建的帳戶中,但我不得不創建一個業務-PRO帳戶在沙箱中。這樣做後,我獲得了批准的狀態,當我使用付款查找API時,我可以獲得我們需要的所有詳細信息。