利用 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": "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
}
]
}
}
{ "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 } ] } }
您收到一个pendingSale
的outcome
。这并不意味着付款已全部处理完毕。客户现必须使用 PayPal 智能按钮完成付款。
使用“
注释:如果出现错误,您可以在我们的
后续步骤