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.
- 1User taps "Pay with Apple Pay" — an
ApplePaySessionis created. - 2Apple fires
onvalidatemerchantwith a validation URL. - 3Your server calls
POST /v1/apple_pay/sessionon Moyasar to validate the merchant. - 4Apple shows the payment sheet — user authorizes with Face ID / Touch ID.
- 5Apple fires
onpaymentauthorizedwith an encrypted payment token. - 6Your server sends the token to
POST /v1/paymentswithsource.type: applepay. - 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.