Purchase (Apple Pay)

Apple Pay payment flow using Apple Pay JS. Tap the Apple Pay button to initiate a session on supported devices.

Apple Pay requires a verified domain in the Moyasar dashboard and a device with Apple Pay enabled.
1

Configure Payment

Set the amount and description, then tap the Apple Pay button to start the payment.

2

How Apple Pay Works

The step-by-step flow of an Apple Pay transaction.

  1. 1User taps "Pay with Apple Pay" — an ApplePaySession is created.
  2. 2Apple fires onvalidatemerchant with a validation URL.
  3. 3Your server calls POST /v1/apple_pay/session on Moyasar to validate the merchant.
  4. 4Apple shows the payment sheet — user authorizes with Face ID / Touch ID.
  5. 5Apple fires onpaymentauthorized with an encrypted payment token.
  6. 6Your server sends the token to POST /v1/payments with source.type: applepay.
  7. 7Moyasar decrypts the token, processes the payment, and returns the result.
Verify in Dashboard

Check the Moyasar STAGING Dashboard to see the Apple Pay transaction.

What happened?

  • Apple Pay uses a two-step flow: merchant validation first, then payment authorization.
  • Moyasar validates the merchant session via POST /v1/apple_pay/session.
  • The encrypted payment token is sent to POST /v1/payments — Moyasar handles decryption.
  • You never see raw card details. Apple Pay is PCI-compliant by design.