给出错误" PAYMENT_STATE_INVALID"付款执行即使付款状态已经批准"州

时间:2017-05-15 06:11:02

标签: paypal payment sandbox postman execute

执行付款给予错误

{
  "name": "PAYMENT_STATE_INVALID",
  "message": "Request is invalid for current payment state.",
  "information_link": "https://developer.paypal.com/webapps/developer/docs/api/#PAYMENT_STATE_INVALID",
  "debug_id": "621987c99cbee"
}

付款已处于批准状态 付款响应是

{
  "id": "PAY-49H97458KE3710939LELKB4Q",
  "create_time": "2017-05-13T06:00:18Z",
  "update_time": "2017-05-13T06:00:22Z",
  "state": "approved",
  "intent": "sale",
  "payer": {
    "payment_method": "credit_card",
    "funding_instruments": [
      {
        "credit_card": {
          "type": "xxxx",
          "number": "xxxxxxxxxxxxxxxx",
          "expire_month": "x",
          "expire_year": "xxxx",
          "first_name": "xxxxxxxx",
          "last_name": "xxxxx"
        }
      }
    ]
  },
  "transactions": [
    {
      "amount": {
        "total": "0.01",
        "currency": "USD",
        "details": {
          "subtotal": "0.01"
        }
      },
      "description": "The payment transaction description.",
      "related_resources": [
        {
          "sale": {
            "id": "7NF6682256719761C",
            "create_time": "2017-05-13T06:00:18Z",
            "update_time": "2017-05-13T06:00:22Z",
            "amount": {
              "total": "0.01",
              "currency": "USD"
            },
            "state": "completed",
            "parent_payment": "PAY-49H97458KE3710939LELKB4Q",
            "links": [
              {
                "href": "https://api.sandbox.paypal.com/v1/payments/sale/7NF6682256719761C",
                "rel": "self",
                "method": "GET"
              },
              {
                "href": "https://api.sandbox.paypal.com/v1/payments/sale/7NF6682256719761C/refund",
                "rel": "refund",
                "method": "POST"
              },
              {
                "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-49H97458KE3710939LELKB4Q",
                "rel": "parent_payment",
                "method": "GET"
              }
            ]
          }
        }
      ]
    }
  ],
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-49H97458KE3710939LELKB4Q",
      "rel": "self",
      "method": "GET"
    }
  ]
}

由于使用信用卡而将回复视为已批准。这是有效的方案吗?使用付款方式为" PayPal"响应显示为创建的付款。 是否有通过沙盒从一个paypal帐户转移到另一个帐户的api? 还有什么API可以将借方/贷方/银行添加到我们的帐户中?

1 个答案:

答案 0 :(得分:0)

在REST API PayPal中,将有两种类型的付款接受;

  1. 信用卡
  2. 如果您使用的是PayPal,则需要额外的执行API,而如果您使用信用卡,则不需要执行API,因为付款已经完成。