Integrate your own checkout with our API and allow your customers to make payments with Apple Pay (when using an Apple device).

How does it work?

You make the following steps possible by using Apple Pay JS API together with our CM.com Online Payments API:

  1. Customer opens your webshop, adds some items to the shopping basket, and clicks on 'Proceed to Checkout'.
  2. After initializing an Apple Pay transaction with the initialize Apple Pay transaction endpoint, you can use the retrieved details to render an Apple Pay button (after checking that Apple Pay is available for the device of the customer) on your checkout page.
  3. The customer clicks on the Apple Pay button, making you to create and begin an Apple Pay session, triggering the display of a payment sheet in the device of the customer. You will have to handle the merchant validation event for the Apple Pay session where you can make a request to the start Apple Pay transaction endpoint of our API. After that Apple will require the customer to authenticate, and when a customer authenticates with Touch ID, Face ID, or passcode Apple will initiate the authorization of the payment, so you will have to handle the payment authorized event for the Apple Pay session where you can make a request to the authorize Apple Pay transaction endpoint of our API. After the Payment is authorized the response must be used to complete the payment on the Apple Pay session. This will show the result of the authorization on the payment sheet, and close the payment sheet within 2 minutes automatically in the customer device. Besides, If the authorization was successful the response will also contain a redirect.url where your customer should be redirected to, making the customer to land on a CM.com Online Payments API url.
  4. When the status of the transaction is updated in the CM.com Online Payments API, you will receive a webhook (if you configured it for your Apple Pay transaction), and the customer will be redirected to the Return URL(s) you specified when you initialized your Apple Pay transaction.
  5. You make a request to the get Apple Pay transaction endpoint, and use its latest details to update your system.

📘

When using webhooks, be aware that they are only a "best effort" mechanism. Find more details here.