Sign in

Payments

Apple Pay

View as Markdown

In a nutshell

Enable Apple Pay in Paystack, verify your domain, and add the Apple Pay button to Checkout.

For the Checkout model Apple Pay uses on the web, see Checkout.

Copy linkTurn on Apple Pay in the dashboard

Open Developers β†’ Apple Pay on your Paystack Dashboard and turn on Apple Pay. Accept the Apple Pay Platform Web Merchant Terms and Conditions when prompted.

If you use Commerce Suite or any Paystack-hosted flow that already redirects customers away from your site, Apple Pay becomes available there after enablement.

Copy linkRegister your domain

In Developers β†’ Apple Pay, add the top-level domain or subdomain that will host the payment experience, then download the domain verification file.

Register each domain separately. For example, paystack.com and music.paystack.com must each be registered on their own.

Copy linkHost the verification file

Place the downloaded verification file in a .well-known folder at the site root.

Examples:

  • https://paystack.com/.well-known/...
  • https://music.paystack.com/.well-known/...

Serve the file with content-type: application/text.

Copy linkVerify the domain

Return to the dashboard and click Verify Domain. Continue only after the domain shows as verified.

Copy linkAdd the Apple Pay button with InlineJS v2

Apple Pay on Popup requires version 2 of InlineJS.

Create the containers:

<div id="paystack-apple-pay"></div>
<button id="paystack-other-channels">More payment options</button>

Mount the Apple Pay button:

const paystackPop = new PaystackPop();

await paystackPop.paymentRequest({
  key: 'pk_domain_xxxxx',
  email: 'CUSTOMER_EMAIL',
  amount: amount * 100,
  currency: 'NGN',
  ref: 'YOUR_REFERENCE',
  container: 'paystack-apple-pay',
  loadPaystackCheckoutButton: 'paystack-other-channels',
  style: {
    theme: 'dark',
    applePay: {
      margin: '10px',
      padding: '10px',
      width: '100%',
      borderRadius: '5px',
      type: 'pay',
      locale: 'en'
    }
  },
  onSuccess(response) {},
  onError() {},
  onCancel() {},
  onElementsMount(elements) {}
})

Copy linkOr use the pre-checkout modal

If you do not want a dedicated Apple Pay button, trigger the pre-checkout flow instead:

const paystackPop = new PaystackPop();

async function payWithPaystack() {
  await paystackPop.checkout({
    key: 'pk_domain_xxxxx',
    email: '[email protected]',
    amount: 10000,
    onSuccess: (transaction) => {
      console.log('Transaction: ', transaction)
    },
    onCancel: () => {
      console.log('Pop up closed!')
    }
  })
}

If setup fails, confirm HTTPS is enabled, the domain is registered and verified, the verification file is in .well-known, and Apple's servers can reach your site.

Was this page helpful?