Translation disclaimer

Documentation is written in English and subsequently translated. This page, therefore, might not have the most up-to-date content. If any questions arise relating to the accuracy of the translated content, please refer to the English version of the page.

Menu

管理您的支付

查询

通过 paypal:events 操作链接,发送 GET 请求。

注释:该请求不需要请求正文。

查询示例请求

GET https://try.access.worldpay.com/payments/alternative/action/paypal/events/eyJrIjoiazNhYjYzMiJ9

事件 sentForSettlement 的查询响应

您会接收到:

  • HTTP 代码 200
  • 您的 query 请求的 lastEvent
  • 关于支付的退款链接
  • 链接到部分退款您的付款

示例响应:

Copied!
{
  "lastEvent": "sentForSettlement",
  "_links": {
    "action:refund": {
      "href": "https://try.access.worldpay.com/payments/alternative/action/paypal/refunds/full/eyJrIjoiazNhYjYzMiJ9"
    },
    "action:partialRefund": {
      "href": "https://try.access.worldpay.com/payments/alternative/action/paypal/refunds/partials/I5s6cjh6XLbzuHiw5xRULjPPVKjYX-41ztBmQNIa9-k"
    },
    "action:events": {
      "href": "https://try.access.worldpay.com/payments/alternative/action/paypal/events/I5s6zFXLbzCw5xRULjPPVKjYX-41ztBmQNj4Ia9-k"
    },
    "curies": [
      {
        "name": "action",
        "href": "https://try.access.worldpay.com/rels/payments/alternative/action/paypal/{rel}",
        "templated": true
      }
    ]
  }
}

非 sentForSettlement 事件的查询响应

您会接收到:

  • HTTP 代码 200
  • 您的 query 请求的 lastEvent
  • 关于支付的查询链接

示例响应:

Copied!
{
  "lastEvent": "|authorized|sentForRefund|refundFailed|refused|error|captureFailed",
  "_links": {
    "action:events": {
      "href": "https://try.access.worldpay.com/payments/alternative/action/paypal/events/eyJrIjoiazNhYjYzMiJ9"
    },
    "curies": [
      {
        "name": "action",
        "href": "https://try.access.worldpay.com/rels/payments/alternative/action/paypal/{rel}",
        "templated": true
      }
    ]
  }
}

退款

若要退款,则最新状态必须为 sentForSettlement

POST 您的请求到 paypal:refund 操作链接。

注释:该请求不需要请求正文。

退款示例请求

POST https://try.access.worldpay.com/payments/alternative/action/paypal/refunds/full/eyJrIjoiazNhYjYzMiJ9

退款响应

您会接收到:

  • HTTP 代码 202
  • 链接到查询您的付款

示例响应:

Copied!
{
  "_links": {
    "action:events": {
      "href": "https://try.access.worldpay.com/payments/alternative/action/paypal/events/eyJrIjoiazNhYjYzMiJ9"
    },
    "curies": [
      {
        "name": "action",
        "href": "https://try.access.worldpay.com/rels/payments/alternative/action/paypal/{rel}",
        "templated": true
      }
    ]
  }
}

可能的结果

  • sentForRefund - 已接受退款请求。
  • refundFailed - 退款失败。
  • sentForSettlement - 稍后再次查询付款。退款可能正在处理中。

部分退款

部分退款请求

在正文中发送要部分退款的 amount 和授权 currency

部分退款示例请求

POST https://try.access.worldpay.com/payments/alternative/action/paypal/refunds/partials/I5s6cjh6XLbzuHiw5xRULjPPVKjYX-41ztBmQNIa9-k

部分退款请求正文:

Copied!
{
  "value": {
    "amount": 100,
    "currency": "GBP"
  },
  "reference": "partial-refund-reference"
}

部分退款请求参数的描述

参数必需描述
value.amount所使用的 amount 的识别码。
value.currency所使用的 currency 的识别码。
reference由您生成的独特 reference,用于识别部分退款。

部分退款响应

您会接收到:

  • HTTP 代码 202
  • 链接到查询您的付款

示例响应:

Copied!
{
  "_links": {
    "action:events": {
      "href": "https://try.access.worldpay.com/payments/alternative/action/paypal/events/I5s6c2zFXLbq70IhCw5xRULjPPVKjYX-NTj4Ia9-k"
    },
    "curies": [
      {
        "name": "action",
        "href": "https://try.access.worldpay.com/rels/payments/alternative/action/paypal/{rel}",
        "templated": true
      }
    ]
  }
}