Process Response

Velocity Apple Pay API Integration Guide

This page provides information about processing a response when integrating Apple Pay with Velocity API. To ensure seamless Apple Pay configuration with your web or mobile browser, you need to process the response that you receive from the Velocity server.

Process Initialize Response on the Web

To process the initialize response on the web, complete the following steps:

  1. First check following perquisite, then only we can show the Apple Pay payment option:
    1. iPhone
      1. iPhone models with Face ID
      2. iPhone models with Touch ID, except iPhone 5s
    2. iPad
      1. iPad Pro, iPad Air, iPad, and iPad mini models with Touch ID or Face ID
    3. Laptop
      1. Mac models with Touch ID
      2. Mac models introduced in 2012 or later with an Apple Pay-enabled iPhone or Apple Watch
      3. Mac computers with Apple silicon that are paired with a Magic Keyboard with Touch ID
    4. Web only in Safari (Apple Pay web)

  2. In initial response, we receive the head and body. In the body tag, it contains the Apple Pay button and, in the head tag, it contains the required script for Apple Pay. We need to load both data based on the UI design.

  3. We need to implement the following methods to receive the call-back from the Apple Pay Events:
    InitPay - When we receive the callback in this method, we receive the URL which we need to pass in the Pay API call. Refer to 7.1. On success of 7.1, we need to return that response (session info). This object is received in the JSON format and we need to return as it as part of the return object of this initPay method.

  4. Add both the body and the head script received in the card element to the head of the HTML page.

  5. After adding the script to the head of HTML page, handle a callback method after the Apple Pay UI interaction is complete. This callback method captures the card token generated by Apple Pay.

Sample Checkout Page for a Web Channel

Sample Checkout Page for an Application

onWalletProcess (Payment, Network)

The onWalletProcess (payment, network) function is called every time your customer selects a card from Apple Pay wallet. Implement this function as shown in the following sample code: As per requirement different type of method need to implement

OnWalletProcess(payment,network)
or
OnWalletProcess(payment,network,billingaddress)

Process Response of a Customer's Apple Pay Card Selection on the SDK

After your customer selects a card from the Apple Pay wallet, they need to invoke the Pay API call. Please refer to the CellPoint Digital Velocity - iOS SDK - Integration Guide.