将Paypal付款状态定为“DEAD”

问题描述 投票:6回答:1

我正在使用沙盒凭证在使用卡进行PayPal付款时获得回复。

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

然后,我试图通过支付ID使用rest API调用获取完整详细信息,并在付款响应中获得“DEAD”状态。请检查以下回复

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

任何人都可以帮我理解为什么我得到这个?怎么解决这个问题?

android paypal paypal-sandbox paypal-rest-sdk
1个回答
3
投票

最后我得到了解决方案。在这里回复有点迟,但这个答案可以为那些仍在努力的人节省时间。

创建付款后,Android SDK会返回以下JSON,但我们可以看到其状态尚未获得批准。如果我们使用付款查询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"
}

解决方案对我有用

问题是我在沙箱中创建了一个商业帐户,但我必须在沙箱中创建一个Business-Pro帐户。完成此操作后,我获得了批准状态,当我使用付款查询API时,我会获得所需的所有详细信息。

© www.soinside.com 2019 - 2024. All rights reserved.