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

Apple Pay

以下支持的国家/地区中将Apple Pay添加至 iOS 应用程序、watchOS 应用程序和网站。

重要信息:MasterCard、Amex 和 Discover 品牌的 Apple Pay 支付可享受责任转移待遇。

开始

  1. 创建 Apple 商户标识号。
  2. 请您的 Worldpay 实施经理启用 Apple Pay。
  3. 从 Worldpay 获取您的证书签名请求 (CSR)。
  4. 利用 Worldpay 提供的 CSR 从 Apple 获取支付处理证书。

启用Apple Pay 应用内

  1. 在 Xcode 中启用 Apple Pay。
  2. merchantCapabilities 设为 PKMerchantCapability3DS,因为 Worldpay 仅支持 3DS。

启用Web 上的 Apple Pay

  1. 注册并验证将托管 Apple Pay 的任何域。
  2. 创建商户身份证书。这会被用来在您的服务器与 Apple 服务器之间建立安全连接。
  3. merchantCapabilities 设为 PKMerchantCapability3DS,因为 Worldpay 仅支持 3DS。

Apple Pay 支付请求

以下是 Apple Pay 授权请求的示例。有关接受 Apple Pay 支付的更多信息,请查看我们的Payments API 文档

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=\" 
                }
            }"
        }
    }
}

paymentInstrument.walletToken 取自 Apple Pay支付请求中的 payment.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": "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 包括 brandfundingTypepaymentAccountReference。它们包含以下值:

brand

  • visa
  • visaElectron
  • mastercard
  • maestro
  • amex

fundingType

  • debit
  • credit

paymentAccountReference (PAR):

支付账户参考号是与特定持卡人 PAN 关联的独特识别码。该 29 个字符的标识号可以用来代替敏感的客户标识字段。它可以跨支付生态系统传输,以方便客户识别。


您可以使用 payments:settle 操作链接来立即结算支付。您还可以将响应进行缓存,并在以后再使用该链接来结算支付。