Apple Pay
在
重要信息:MasterCard、Amex 和 Discover 品牌的 Apple Pay 支付可享受责任转移待遇。
开始
- 创建 Apple 商户标识号。
- 请您的 Worldpay 实施经理启用 Apple Pay。
- 从 Worldpay 获取您的证书签名请求 (CSR)。
- 利用 Worldpay 提供的 CSR 从 Apple 获取支付处理证书。
启用Apple Pay 应用内
- 在 Xcode 中启用 Apple Pay。
- 将
merchantCapabilities
设为PKMerchantCapability3DS
,因为 Worldpay 仅支持 3DS。
启用Web 上的 Apple Pay
- 注册并验证将托管 Apple Pay 的任何域。
- 创建商户身份证书。这会被用来在您的服务器与 Apple 服务器之间建立安全连接。
- 将
merchantCapabilities
设为PKMerchantCapability3DS
,因为 Worldpay 仅支持 3DS。
Apple Pay 支付请求
以下是 Apple Pay 授权请求的示例。有关接受 Apple Pay 支付的更多信息,请查看我们的
POST
您的授权请求至在payments:authorize
授权示例请求
POST https://try.access.worldpay.com/payments/authorizations
Copied!
{
"transactionReference": "Memory265-13/08/1876",
"merchant": {
"entity": "MindPalaceLtd"
},
"instruction": {
"narrative": {
"line1": "Mind Palace Ltd"
},
"value": {
"currency": "GBP",
"amount": 250
},
"paymentInstrument": {
"type": "card/wallet+applepay",
"walletToken": "{
\"version\": \"EC_v1\",
\"data\": \"kdHd..GQ==\",
\"signature\": \"MIAGCSqGSIb3DQEH...AAA\",
\"header\": {
\"transactionId\": \"d3b28af..f8\",
\"ephemeralPublicKey\": \"MFkwE..Q==\",
\"publicKeyHash\": \"dxCK..6o=\"
}
}"
}
}
}
{ "transactionReference": "Memory265-13/08/1876", "merchant": { "entity": "MindPalaceLtd" }, "instruction": { "narrative": { "line1": "Mind Palace Ltd" }, "value": { "currency": "GBP", "amount": 250 }, "paymentInstrument": { "type": "card/wallet+applepay", "walletToken": "{ \"version\": \"EC_v1\", \"data\": \"kdHd..GQ==\", \"signature\": \"MIAGCSqGSIb3DQEH...AAA\", \"header\": { \"transactionId\": \"d3b28af..f8\", \"ephemeralPublicKey\": \"MFkwE..Q==\", \"publicKeyHash\": \"dxCK..6o=\" } }" } } }
paymentInstrument.walletToken
取自 Apple Paypayment.paymentToken.paymentData
。
Apple Pay 支付响应
成功支付
您会接收到:
已拒绝的支付
您会接收到:
"outcome": "refused"
拒绝代码 - 为拒绝提供更多上下文的
description
paymentInstrument
示例响应
Copied!
{
"outcome": "authorized",
"riskFactors": [{
"risk": "not_checked",
"detail": "postcode",
"type": "avs"
},
{
"risk": "not_matched",
"detail": "address",
"type": "avs"
}],
"paymentInstrument": {
"type": "card/network+masked",
"card": {
"number": {
"bin": "444433",
"last4Digits": "1111"
},
"countryCode": "GB",
"expiryDate": {
"month": 1,
"year": 2020
},
"brand": "visa",
"fundingType": "debit",
"issuer": {
"name": "VALID_ISSUER"
},
"paymentAccountReference": "somePAR"
}
},
"_links": {
"payments:cancel": {
"href": "https://try.access.worldpay.com/payments/authorizations/cancellations/eyJrIjoiazNhYjYzMiJ9"
},
"payments:settle": {
"href": "https://try.access.worldpay.com/payments/settlements/full/eyJrIjoiazNhYjYzMiJ9"
},
"payments:partialSettle": {
"href": "https://try.access.worldpay.com/payments/settlements/partials/eyJrIjoiazNhYjYzMiJ9"
},
"payments:events": {
"href": "https://try.access.worldpay.com/payments/events/eyJrIjoiazNhYjYzMiJ9"
},
"curies": [{
"name": "payments",
"href": "https://try.access.worldpay.com/rels/payments/{rel}",
"templated": true
}]
}
}
{ "outcome": "authorized", "riskFactors": [{ "risk": "not_checked", "detail": "postcode", "type": "avs" }, { "risk": "not_matched", "detail": "address", "type": "avs" }], "paymentInstrument": { "type": "card/network+masked", "card": { "number": { "bin": "444433", "last4Digits": "1111" }, "countryCode": "GB", "expiryDate": { "month": 1, "year": 2020 }, "brand": "visa", "fundingType": "debit", "issuer": { "name": "VALID_ISSUER" }, "paymentAccountReference": "somePAR" } }, "_links": { "payments:cancel": { "href": "https://try.access.worldpay.com/payments/authorizations/cancellations/eyJrIjoiazNhYjYzMiJ9" }, "payments:settle": { "href": "https://try.access.worldpay.com/payments/settlements/full/eyJrIjoiazNhYjYzMiJ9" }, "payments:partialSettle": { "href": "https://try.access.worldpay.com/payments/settlements/partials/eyJrIjoiazNhYjYzMiJ9" }, "payments:events": { "href": "https://try.access.worldpay.com/payments/events/eyJrIjoiazNhYjYzMiJ9" }, "curies": [{ "name": "payments", "href": "https://try.access.worldpay.com/rels/payments/{rel}", "templated": true }] } }
{
"outcome": "refused",
"description": "Do not honour",
"code": "5",
"refusalAdvice": {
"code": "03"
},
"riskFactors": [{
"risk": "not_checked",
"detail": "postcode",
"type": "avs"
},
{
"risk": "not_matched",
"detail": "address",
"type": "avs"
}],
"paymentInstrument": {
"type": "card/network+masked",
"card": {
"number": {
"bin": "444433",
"last4Digits": "1111"
},
"countryCode": "GB",
"brand": "visa",
"fundingType": "debit",
"issuer": {
"name": "VALID_ISSUER"
},
"paymentAccountReference": "somePAR"
}
}
}
{ "outcome": "refused", "description": "Do not honour", "code": "5", "refusalAdvice": { "code": "03" }, "riskFactors": [{ "risk": "not_checked", "detail": "postcode", "type": "avs" }, { "risk": "not_matched", "detail": "address", "type": "avs" }], "paymentInstrument": { "type": "card/network+masked", "card": { "number": { "bin": "444433", "last4Digits": "1111" }, "countryCode": "GB", "brand": "visa", "fundingType": "debit", "issuer": { "name": "VALID_ISSUER" }, "paymentAccountReference": "somePAR" } } }
paymentInstrument
包括 brand
、fundingType
和 paymentAccountReference
。它们包含以下值:
brand
:
visa
visaElectron
mastercard
maestro
amex
fundingType
:
debit
credit
paymentAccountReference
(PAR):
支付账户参考号是与特定持卡人 PAN 关联的独特识别码。该 29 个字符的标识号可以用来代替敏感的客户标识字段。它可以跨支付生态系统传输,以方便客户识别。
您可以使用 payments:settle
操作链接来立即