Display Apple Pay Button and Process
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:
- First check following perquisite, then only we can show the Apple Pay payment option:
- iPhone
- iPhone models with Face ID
- iPhone models with Touch ID, except iPhone 5s
- iPad
- iPad Pro, iPad Air, iPad, and iPad mini models with Touch ID or Face ID
- Laptop
- Mac models with Touch ID
- Mac models introduced in 2012 or later with an Apple Pay-enabled iPhone or Apple Watch
- Mac computers with Apple silicon that are paired with a Magic Keyboard with Touch ID
- Web only in Safari (Apple Pay web)
- iPhone
- 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.
- 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.
- Add both the body and the head script received in the card element to the head of the HTML page.
- 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)
Updated 6 months ago
What’s Next