2

这是对我原帖的修改。我认为 paypal rest api 沙箱已关闭。

错误刚刚开始,我之前没有出现过:这里是捕获 URL: https ://api.sandbox.paypal.com/v1/payments/payment/PAY-8EN83459YH6921921KJ4QNHQ

它是一个 404 错误。这是身体:

{
name: "INVALID_RESOURCE_ID"
message: "The requested resource ID was not found"
information_link: "https://developer.paypal.com/webapps/developer/docs/api/#INVALID_RESOURCE_ID"
debug_id: "e56bae98dcc26"
}

付款已正确创建,我使用了相同的凭据和返回的付款创建响应中提供的付款链接。

以下是原始支付创建调用的响应:

{
  "id": "PAY-8EN83459YH6921921KJ4QNHQ",
  "create_time": "2013-11-05T14:54:22Z",
  "update_time": "2013-11-05T14:54:30Z",
  "state": "approved",
  "intent": "authorize",
  "payer": {
    "payment_method": "credit_card",
    "funding_instruments": [
      {
        "credit_card": {
          "type": "visa",
          "number": "xxxxxxxxxxxx0331",
          "expire_month": "11",
          "expire_year": "2018",
          "first_name": "Joe",
          "last_name": "Shopper",
          "billing_address": {
            "line1": "52 N Main ST",
            "city": "Johnstown",
            "state": "OH",
            "postal_code": "43210",
            "country_code": "US"
          }
        }
      }
    ]
  },
  "transactions": [
    {
      "amount": {
        "total": "7.47",
        "currency": "USD",
        "details": {
          "subtotal": "7.41",
          "tax": "0.03",
          "shipping": "0.03"
        }
      },
      "description": "This is the payment transaction description.",
      "related_resources": [
        {
          "authorization": {
            "id": "0UH21242UH1119007",
            "create_time": "2013-11-05T14:54:22Z",
            "update_time": "2013-11-05T14:54:30Z",
            "state": "authorized",
            "amount": {
              "total": "7.47",
              "currency": "USD",
              "details": {
                "subtotal": "7.41",
                "tax": "0.03",
                "shipping": "0.03"
              }
            },
            "parent_payment": "PAY-8EN83459YH6921921KJ4QNHQ",
            "valid_until": "2013-12-04T14:54:22Z",
            "links": [
              {
                "href": "https:\/\/api.sandbox.paypal.com\/v1\/payments\/authorization\/0UH21242UH1119007",
                "rel": "self",
                "method": "GET"
              },
              {
                "href": "https:\/\/api.sandbox.paypal.com\/v1\/payments\/authorization\/0UH21242UH1119007\/capture",
                "rel": "capture",
                "method": "POST"
              },
              {
                "href": "https:\/\/api.sandbox.paypal.com\/v1\/payments\/authorization\/0UH21242UH1119007\/void",
                "rel": "void",
                "method": "POST"
              },
              {
                "href": "https:\/\/api.sandbox.paypal.com\/v1\/payments\/payment\/PAY-8EN83459YH6921921KJ4QNHQ",
                "rel": "parent_payment",
                "method": "GET"
              }
            ]
          }
        }
      ]
    }
  ],
  "links": [
    {
      "href": "https:\/\/api.sandbox.paypal.com\/v1\/payments\/payment\/PAY-8EN83459YH6921921KJ4QNHQ",
      "rel": "self",
      "method": "GET"
    }
  ]
}
4

2 回答 2

2

目前报告的 REST API 存在问题。贝宝正在努力。

于 2013-11-05T16:14:36.023 回答
1

有一段时间我一直在想这个 PayPal 错误是我的问题的原因。但是,事实证明,当您在客户端中使用错误的配置时,PayPal 会产生相同的错误。就我而言,我将 Android 库设置为使用 ENVIRONMENT_NO_NETWORK,而不是 ENVIRONMENT_SANDBOX。这会生成看起来真实的事务 ID,(当然)没有在服务器上注册。

于 2014-03-19T16:36:36.667 回答