The easiest way to pay in web-stores and app with Apple Pay

Apple Pay - is a mobile payment and digital wallet service by Apple Inc. that allows users to make payments in iOS apps, and on the web without having to enter their payment details each time. It is supported on the iPhone, Apple Watch, iPad and Mac.

Easy and fast way to get payments from customers
Easy and quick integration with your website or mobile app
Connection without additional integrations via the WayForPay page
Ability of direct integration Apple Pay payment method on website or mobile app
Convenient payment method for Apple devices owners
Payment security

How it works?

For quick and easy payment, it is enough to have payment cards added in Apple Wallet

1. Customer adds a payment card to Apple Pay account
2. To finish the purchase just select previously added payment card in Apple Pay and confirm payment
3. Seller will receive payment notification


Apple Pay connection is possible via the WayForPay payment page or via Apple Pay API
Apple Pay s available to all shops/merchants connected to the WayForPay system without additional agreements and operations

Connection via the page WayForPay

With this method, there is no need for additional integrations. The Apple Pay button will be displayed on WayForPay payment page.
If you are already registered in WayForPay, the payment method will be enabled automatically. You can manage payment methods in your Personal Account, in the "Payment Methods" menu.

Connection with Apple Pay API

With this integration a button Apple Pay can be added to your website without any additional forms. In this case, you will need to go through the connection procedure and other checks. A website or a mobile application must meet certain requirements. Your website should use HTTPS and support TLS 1.2.

Connection with Apple Pay API

Direct connection allows you to display the Apple Pay button on the website or in a mobile application.
To use Apple Pay technology with direct integration, must be observed the following terms of use from Apple:

Availability of account registration in the program Apple Developer. In which you need to register an individual Merchant ID.
Prohibited uses Apple Pay for tobacco products, replicas, products for adults, the purchase of virtual currency, to replenish wallets.
Recommendations for use and branding

Necessary steps to use Apple Pay:

1. Register a Merchant ID

In the Apple Developer Account, go to the section «Certificates, IDs & Profiles», after «Merchant IDs» and register a new Merchant ID: in the Description field specify description; in the Identifier field must be specified the domain name of your site in the reverse order with the addition of «merchant» in the beginning (for example, the site, the Identifier will look like -

2. Create a certificate

Write a letter on [email protected] with your Merchant ID registered in the Apple Developer Account.
The support team will generate a certificate and send it to you with return letter. Next, in the Apple Developer console, create an Apple Pay Payment Processing Certificate and transfer it to our support team.

3. Confirm Domain

In the Apple Developer Account console add domains for each site where you will receive payments through Apple Pay. Sites should work under the HTTPS scheme and support the TLS 1.2 protocol.

Confirm domain ownership.

Apple Pay direct integration on website

The implementation consists of the client part (javascript) and server.

1.Verify payment options using Apple Pay
Checking supports the device or the browser Apple Pay payment, and check has been added payment card to the Wallet.
if (window.ApplePaySession) {
    var promise = ApplePaySession.canMakePaymentsWithActiveCard({YOUR_MERCHANT_ID});
    promise.then(function(canMakePayments) {
        if (canMakePayments) {
            //the card is attached, we can start the session        }
} else {
    //impossible to pay}
2. Payment structure formation for the session
Specify the name of the product/service, the amount and currency of payment. Create a new payment session.
document.getElementById("apple-pay-button").onclick = function(event) {
    var paymentRequest = {
        currencyCode: 'UAH',
        countryCode: 'UA',
        total: {
            label: {PRODUCT_NAME},
            amount: {PAYMENT_AMOUNT}
        merchantCapabilities: ['supports3DS'],
        supportedNetworks: ['masterCard', 'visa']

var session = new ApplePaySession(3, paymentRequest);
3. Validate the merchant
To check the possibility of payment for your merchant identifier and obtain the necessary data for making a payment, you need to create a data structure.
Also execute a request for payment in WayForPay using the API Charge and process the received response from the system.
session.onvalidatemerchant = function(event) {
    var promise = validateMerchant(event.validationURL);
    promise.then(function(merchantSession) {

function validateMerchant(validationURL) {
    return new Promise(function(resolve, reject) {
        var applePayPayload = {
            'merchantId': {YOUR_MERCHANT_ID},
            'validationURL': {YOUR_VALIDATION_URL},
            'body': {
                'merchantIdentifier': {YOUR_MERCHANT_ID},
                'domainName': {YOUR_DOMAIN_NAME},
                'displayName': {PRODUCT_NAME}

        var xhr = new XMLHttpRequest();
        xhr.onload = function() {
            var data = JSON.parse(this.responseText);
        xhr.onerror = reject;'POST', merchantValidationEndpoint, true);
        xhr.setRequestHeader('Content-Type', 'application/json;charset=utf-8');

4. Start session and process payment

session.onpaymentauthorized = function(event) {
//after receiving the token, transfer it to wayforpay


JS code example:

//in example was used jquery library//no additional scripts are required; all objects for Apple Pay payments are already in Safari
if (window.ApplePaySession) { //checking device    var merchantIdentifier = 'Your Apple Merchant ID';
    var promise = ApplePaySession.canMakePaymentsWithActiveCard(merchantIdentifier);
    promise.then(function (canMakePayments) {
        if (canMakePayments) {
            $('#apple-pay').show(); //Apple Pay button        }

$('#apple-pay').click(function () { //button handler    var request = {
        // requiredShippingContactFields: ['email'], //Uncomment if you need an e-mail. You can also request postalAddress, phone, name.        countryCode: 'UA',
        currencyCode: 'UAH',
        supportedNetworks: ['visa', 'masterCard'],
        merchantCapabilities: ['supports3DS'],
        //Purpose of payment type only in Latin!        total: { label: 'Test', amount: '1.00' },
    var session = new ApplePaySession(1, request);

    // event handler to create a merchant session.    session.onvalidatemerchant = function (event) {
        var data = {
            validationUrl: event.validationURL

        // send request to your server        // for start session        $.post("/ApplePay/StartSession", data).then(function (result) {

    // payment authorization event handler    session.onpaymentauthorized = function (event) {
        //var email = event.payment.shippingContact.emailAddress; //if an email address was requested        //var phone = event.payment.shippingContact.phoneNumber; //if phone was requested        //see all options at
        var data = {
            cryptogram: JSON.stringify(event.payment.token)

        //send a request to your server, and then execute the request Charge api        //for payment        $.post("/ApplePay/Pay", data).then(function (result) {
            var status;
            if (result.Success) {
                status = ApplePaySession.STATUS_SUCCESS;
            } else {
                status = ApplePaySession.STATUS_FAILURE;


    // Starting Apple Pay session    session.begin();

Sample dataset sent by Charge wayforpay API

        "dung W100F",
        "Sdung d 7.0 Black"
    "clientEmail":"[email protected]",

Apple Pay direct integration in a mobile application

To integrate the method into the application, use the Apple SDK PassKit to get the PaymentToken and the Charge payment method in the WayForPay API for making a payment.

Payment process:

Compatibility Check
If the user's device supports Apple Pay, the branded payment button will be displayed
Quick purchase
The user confirms the payment using the Touch ID or Face ID functions, or by entering a password.
Security without 3-D Secure
Bank card data is not stored in devices and is not transferred anywhere when paying.

For using Apple Pay method you shall comply with Acceptable Use Guidelines
The standard commission for the store is applied to the payment method

Not with WayForPay yet?

Sign up and connect a popular payment method to your customers.

Still have questions? We are in touch 24/7
Write to us in messengers