Introduction
This guide covers the steps to integrate Apple Pay as a payment option for users. In order to enable Apple Pay, perform the following integration steps- Initialize Push Apple Pay launcher and display button
- Launch payment session and create intent
- Receive confirmation of payment status via webhook
Step 1: Display Apple Pay button
Enable users to select Apple Pay as their payment option by initializing the Push Apple Pay launcher and displaying the Apple Pay button when a user loads the payment page Make a callPOST /token with the user’s ID and type = ‘apple_pay’. A new token must be created each time the user loads the payment page and should not be cached.
If a user has not previously used Push, you must first register them by calling create-user.
The Push SDK can be installed from
https://cdn.pushcash.com/sdk/push.umd.js via a script tag on your payment pageStep 2: Launch payment session & create payment intent
When the user selects Apple Pay as their payment option, in the onClick handler launch the payment session and call the Push API to create a payment intent by handling the onStart callback.The token is the only required argument to POST /intent
onComplete() callback that runs when the Apple Pay payment sheet is dismissed.