PayPal Rest API示例返回404 PayPal付款

时间:2014-10-14 17:41:13

标签: .net api rest paypal payment

我是PayPal开发的新手。我正在使用GitHub for .NET的RestAPI示例项目,并尝试使用示例项目完成PayPal付款。我可以创建付款,并重定向到沙盒网站的结账。登录并选择“继续”后,我收到404错误 - INVALID_RESOURCE_ID。以下是JSON格式的详细信息:

{"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":"9b048f2d3407c"}

我在测试网站上使用自己的凭据时也会收到同样的错误。使用RestAPI .NET示例和我自己的代码似乎可以很好地创建付款:

{
  "id": "PAY-5P5661680K546313RKQ6V6NA",
  "create_time": "2014-10-14T17:36:52Z",
  "update_time": "2014-10-14T17:36:52Z",
  "intent": "sale",
  "payer": {
    "payment_method": "paypal",
    "payer_info": {
      "shipping_address": {}
    }
  },
  "transactions": [
    {
      "related_resources": [],
      "amount": {
        "currency": "USD",
        "total": "100.00",
        "details": {
          "shipping": "10.00",
          "subtotal": "75.00",
          "tax": "15.00"
        }
      },
      "description": "Transaction description.",
      "item_list": {
        "items": [
          {
            "quantity": "5",
            "name": "Item Name",
            "price": "15.00",
            "currency": "USD",
            "sku": "sku"
          }
        ]
      }
    }
  ],
  "state": "created",
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-5P5661680K546313RKQ6V6NA",
      "rel": "self",
      "method": "GET"
    },
    {
      "href": "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-4WY238570T9571310",
      "rel": "approval_url",
      "method": "REDIRECT"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-5P5661680K546313RKQ6V6NA/execute",
      "rel": "execute",
      "method": "POST"
    }
  ]
}

我的假设是PayPal的沙箱可以执行PayPal付款。它是否正确?如果是这样,我该如何解决这个问题呢?

0 个答案:

没有答案