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 支付

启动 PayPal 支付,可立即触发结算流程。

接受销售

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

销售示例请求

POST https://try.access.worldpay.com/payments/alternative/action/paypal/sale

PayPal 销售请求正文:

Copied!
{
  "transactionReference": "Memory265-13/08/1876",
  "merchant": {
    "entity": "MindPalaceLtd"
  },
  "instruction": {
    "description": {
      "line1": "order description"
    },
    "paymentInstrument": {
      "type": "PAYPAL",
      "shippingAddress": {
        "firstName": "James",
        "lastName": "Moriarty",
        "street": "The Palatine Centre",
        "postalCode": "DH1 3LE",
        "city": "Durham",
        "state": "County Durham",
        "countryCode": "GB"
      },
      "billingAddress": {
        "firstName": "Sherlock",
        "lastName": "Holmes",
        "shopperEmailAddress":"sherlock.holmes@example.com",
        "address1": "221B Baker Street",
        "address2": "Marylebone",
        "address3": "Westminster",
        "postalCode": "NW1 6XE",
        "city": "London",
        "state": "Greater London",
        "countryCode": "GB"
      }
    },
    "value": {
      "currency": "GBP",
      "amount": 1
    }
  }
}

参数描述

参数必需描述
transactionReference该笔销售的唯一交易参考号。
merchant.entity作为加入流程的一部分而创建,用于在 Access Worldpay 中发送销售请求。
instruction包含与销售请求相关的所有支付信息的对象。
instruction.description.line1包含订单描述的字段。
instruction.paymentInstrument包含客户详细信息的对象。
paymentInstrument.paymentInstrument.type支付工具的类型。值必须为 "PAYPAL"。
paymentInstrument.shippingAddress包含收货地址信息的对象。
paymentInstrument.shippingAddress.firstName客户的名字。
paymentInstrument.shippingAddress.lastName客户的姓氏。
paymentInstrument.shippingAddress.streetname送货地址的街道名称。
paymentInstrument.shippingAddress.postalCode送货地址的邮编/邮政编码。
paymentInstrument.shippingAddress.city送货地址的城市名。
paymentInstrument.shippingAddress.state送货地址的州名。
paymentInstrument.shippingAddress.countryCode送货地址的国家代码
paymentInstrument.billingAddress包含账单邮寄地址信息的对象。
paymentInstrument.billingAddress.firstName客户的名字。
paymentInstrument.billingAddress.lastName客户的姓氏。
paymentInstrument.billingAddress.shopperEmailAddress客户的电邮地址。
paymentInstrument.billingAddress.address1账单邮寄地址的第一行。
paymentInstrument.billingAddress.address2账单邮寄地址的第二行。
paymentInstrument.billingAddress.address3账单邮寄地址的第三行。
paymentInstrument.billingAddress.postalCode账单邮寄地址的邮编/邮政编码。
paymentInstrument.billingAddress.city账单邮寄地址的城市名。
paymentInstrument.billingAddress.state账单邮寄地址的州名。
paymentInstrument.billingAddress.countryCode账单邮寄地址的国家代码
instruction.value包含销售值的对象。
instruction.value.currency所使用的 currency 的识别码。
instruction.value.amount所使用的 amount 的识别码。

销售响应

成功的订单

您会接收到:

  • HTTP 代码 201
  • PayPal orderId(通常与 PayPal 智能按钮相结合,以便为客户跳转至其 PayPal 账户)
  • 结果
  • 关于支付的查询链接

示例响应:

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

您收到一个pendingSaleoutcome。这并不意味着付款已全部处理完毕。客户现必须使用 PayPal 智能按钮完成付款。

使用“管理您的支付”部分中介绍的通知或查询服务,了解您支付的最新状态。

注释:如果出现错误,您可以在我们的错误参考中获取更多信息。

后续步骤


管理您的支付