Apple Pay

Easily accept online payments using Apple Pay

📘

Apple Pay is available in beta

Please contact your Customer Success Manager to get Apple Pay enabled for your account.

You can easily accept Apple Pay in Rainforest's payments component.

Apple Pay is a convenient option for paying online when using an Apple device. It can increase conversion rates and help protect your merchants against chargebacks.

Left: Apple Pay being presented. Right: Apple Pay in use.

Left: Apple Pay being presented. Right: Apple Pay in use.

How to enable Apple Pay

Best of all, you can add Apple Pay to your existing Rainforest integration in three steps:

Register your domains

Apple requires verification of all domains that process Apple Pay payments. This verification is performed by hosting a file on the domain where Apple Pay payments will be collected. Download one or both of the Apple Pay domain verification files below:

You must host the sandbox Apple Pay domain verification in your sandbox environment and the production Apple Pay domain verification in your production environment.

Before Rainforest can register your domains for use with Apple Pay, host the corresponding domain verification file at:

https://[DOMAIN_NAME]/.well-known/apple-developer-merchantid-domain-association

Once you have placed the Apple Pay domain verification file in the corresponding location, follow up with Rainforest to register your domains for use with Apple Pay.

The files must be publicly accessible at the URL above to be successfully verified by Apple.

Configure the component

When rendering the payment component, add APPLE_PAY to the list of allowed-methods :

  <rainforest-payment
    session-key='REPLACE_ME'
    payin-config-id='REPLACE_ME'
-   allowed-methods="CARD,ACH"
+   allowed-methods='CARD,ACH,APPLE_PAY'
  ></rainforest-payment>

Rainforest will render an Apple Pay button at the top of the component, above the payment fields, if it is supported.

If the customer uses Apple Pay, the component will emit the same events as it does for other payment methods. You can continue to handle those as you do already.

Handle the new PaymentMethod type

Cards collected via Apple Pay behave differently from raw cards, so they are represented in the API as a separate type of payment method. For many integrations, this won’t impact you, but in some cases you may need to make integration changes to handle this type.

Check if you have any code that looks at a Rainforest Payin or PaymentMethod and gets data from the card sub-object. In the Apple Pay case, the card will now be null, and relevant information will be on a new apple_pay sub-object instead:

{
  // ...
  "card": null,
  "apple_pay": {
    "type": "CREDIT",
    "brand": "VISA",
    "brand_desc": "Visa",
    "description": "Visa 1366"
  }
}

If you currently save cards for future use by using the card object, we recommend that for Apple Pay you should save apple_pay.description as the way you show the card to the customer when they want to select it again.

Where is Apple Pay supported?

Rainforest supports “Apple Pay on the Web”, a payment flow that runs inside a web browser for a customer to make a card payment to a merchant. (This is different from Apple Pay in native apps, tap-to-pay, peer-to-peer payments, and several other kinds of “Apple Pay”.)

For Apple Pay on the Web to be shown to customers, a few requirements need to be met:

  • Browser support: the customer needs to be viewing the page in Safari, not in incognito mode, on a device that has a secure element, with a recent version of macOS or iOS.
  • Domain support: your platform needs to register each domain where you want to initiate Apple Pay transactions via Rainforest’s API.
  • Payment Component support: the Payment Component showing the Apple Pay button needs to be on the top-level page (not an iframe), on a domain that has been registered.

Apple Pay also has a few unique characteristics, different from paying with a manually-entered card number:

  • Liability shift: because Apple Pay authenticates the cardholder, it contributes to a presumption that the transaction is not fraudulent, called a "liability shift". This provides some protection against fraud chargebacks.
    • The status of Apple Pay’s liability shift changes over time. As of March 2024, Apple Pay provides a liability shift on Mastercard, Discover, and, for devices on iOS 16.2 or newer, Visa.
  • Card-on-file: while most issuers allow Apple Pay tokens to be reused for future transactions, some will only allow the token to be used once, or for a limited window of time, and many issuers will only allow the token to be used on the same merchant where it was initially collected.
    • This means you should not rely on an Apple Pay card to be added to a customer’s wallet and then used to make purchases from other of your merchants.
    • Unfortunately, what each issuer decides is not shared with Rainforest, so we can’t warn you which ones will be usable in the future. As always, you should be ready for a card-on-file payment to decline, requiring the payer to come back and select a new card to complete payment.
  • 3DS: Cards collected via Apple Pay cannot also go through 3D Secure.