Mobile Wallets API

Take secure and frictionless payments in-app and online using mobile wallets such asApple PayorGoogle Pay.

Prerequisite: To take payments with mobile wallets, you must be integrated with ourPayments API.

Note: Our Mobile wallets API only supports an encrypted payment flow.

Apple Pay

Apple Pay is compatible with any iOS and MacOS device that has biometrics or Near-Field Communication (NFC) capabilities.

Gettingstartedwith Apple Pay in-app

  1. Create an Apple Merchant ID.
  2. Ask your WorldpayImplementation Managerto enable Apple Pay.
  3. Get your Certificate Signing Request (CSR) from Worldpay.
  4. Get your payment processing certificate from Apple using the CSR provided by Worldpay.
  5. Enable Apple Pay in Xcode.
  6. Set merchantCapabilities to PKMerchantCapability3DS, as Worldpay only supports 3DS.

Gettingstartedwith Apple Pay on web

  1. Create an Apple Merchant ID.
  2. Get your payment processing certificate using the CSR provided by Worldpay.
  3. Register and verify any domains that will host Apple Pay.
  4. Create a merchant identity certificate. This is used to establish a secure connection between your servers and Apple's servers.
  5. Set merchantCapabilities to PKMerchantCapability3DS, as Worldpay only supports 3DS.

Apple Pay payment request

Here is an example of an Apple Pay authorization request. For more information on taking an Apple Pay payment seeTake a payment.

Copied!
{
    "transactionReference": "unique-transactionReference",
    "merchant": {
        "entity": "default"
    },
    "instruction": {
        "narrative": {
            "line1": "trading name"
        },
        "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=\" 
                }
            }"
        }
    }
}

The paymentInstrument.walletToken is taken from payment.paymentToken.paymentData in the Apple Paypayment request.

Apple Pay payment response

Successful payment

You receive:

Refused payment

You receive:

  • an "outcome": "refused"
  • arefusal code
  • a description which gives additional context on the refusal
  • a paymentInstrument

Example responses

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",
    "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"
        }
    }
}

The paymentInstrument includes brand and fundingType. They can have the following values:

brand:

  • visa
  • visaElectron
  • mastercard
  • maestro
  • amex

fundingType:

  • debit
  • credit

You can use the payments:settle action link tosettle the paymentstraight away. Alternatively you can cache the response and use the link to settle the payment later.

Google Pay

Google Pay is compatible with Android and is available on websites that support Google Pay.

Boarding with Worldpay

  1. Ask yourImplementation Managerto enable Google Pay.
  2. Generate a Google Merchant ID.

Gettingset-upwith Google Pay

  1. Create a Google developer account. Follow these instructions on how you set-up Google Pay forin-app.

Important: Access Worldpay currently only supports the "CRYPTOGRAM_3DS" authentication method for allowedAuthMethods as describedhere.

Google Pay payment request

Here is an example of a Google Pay authorization request. For more information on taking a Google Pay payment seeTake a payment.

Copied!
{
    "transactionReference": "unique-transactionReference",
    "merchant": {
        "entity": "default"
    },
    "instruction": {
        "narrative": {
            "line1": "trading name"
        },
        "value": {
            "currency": "GBP",
            "amount": 250
        },
        "paymentInstrument": {
            "type": "card/wallet+googlepay",
            "walletToken": "{\"protocolVersion\":\"ECv2\",\"signature\":\"MEQCIH6Q4OwQ0jAceFEkGF0JID6sJNXxOEi4r+mA7biRxqBQAiAondqoUpU/bdsrAOpZIsrHQS9nwiiNwOrr24RyPeHA0Q\\u003d\\u003d\",\"intermediateSigningKey\":{\"signedKey\": \"{\\\"keyExpiration\\\":\\\"1542323393147\\\",\\\"keyValue\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/1+3HBVSbdv+j7NaArdgMyoSAM43yRydzqdg1TxodSzA96Dj4Mc1EiKroxxunavVIvdxGnJeFViTzFvzFRxyCw\\\\u003d\\\\u003d\\\"}\",\"signatures\": [\"MEYCIQCO2EIi48s8VTH+ilMEpoXLFfkxAwHjfPSCVED/QDSHmQIhALLJmrUlNAY8hDQRV/y1iKZGsWpeNmIP+z+tCQHQxP0v\"]},\"signedMessage\":\"{\\\"tag\\\":\\\"jpGz1F1Bcoi/fCNxI9n7Qrsw7i7KHrGtTf3NrRclt+U\\\\u003d\\\",\\\"ephemeralPublicKey\\\":\\\"BJatyFvFPPD21l8/uLP46Ta1hsKHndf8Z+tAgk+DEPQgYTkhHy19cF3h/bXs0tWTmZtnNm+vlVrKbRU9K8+7cZs\\\\u003d\\\",\\\"encryptedMessage\\\":\\\"mKOoXwi8OavZ\\\"}\"}"
        }
    }
}

Google Pay payment response

Successful payment

You receive:

Refused payment

You receive:

  • an "outcome": "refused"
  • arefusal code
  • a description which gives additional context on the refusal
  • a paymentInstrument

Example responses

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",
    "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"
        }
    }
}

The paymentInstrument includes brand and fundingType. They can have the following values:

brand:

  • visa
  • visaElectron
  • mastercard
  • maestro
  • amex

fundingType:

  • debit
  • credit

You can use the payments:settle action link tosettle the paymentstraight away. Alternatively you can cache the response and use the link to settle the payment later.


Next Steps: Take a look to see how totake a payment