1. Documentation /
  2. Developer Guide to Apple Pay with 3rd Party Payment Gateways

Developer Guide to Apple Pay with 3rd Party Payment Gateways

For most stores, the best way to accept Apple Pay with WooCommerce is via WooPayments. However, Apple Pay can also be enabled with some 3rd party payment gateways like Stripe, Square, and Authorize.net. Depending on the gateway, the setup for Apple Pay can be straight-forward, or it can be arduous. You may need the help of a developer to get up and running with Apple Pay when not using Apple Pay via WooPayments. Setting up Apple Pay for 3rd party gateways other than WooPayments is also not covered by our support policy, so the server certification process must be completed by you or your developer independently before Apple Pay can be enabled within a plugin. This document provides a guide for developers to set up Apple Pay. If you are not sure if you can do this on your own, please see the section on Generating Apple Certificates. If you cannot complete this section independently, you should work with a professional to assist you with this setup process. Unfortunately, there’s no way to simplify this process for these 3rd party payment processors.

When using Apple Pay with WooPayments, this set up process is completed automatically. WooPayments eliminates certification steps by working directly with Apple to generate certificates.

Supported 3rd Party Gateways

↑ Back to top
The following payment gateway integrations can support Apple Pay currently:

If you use PayPal Powered by Braintree, please follow the Braintree setup process from this guide and then this guide. If you use Stripe for WooCommerce, please view the Stripe documentation for its setup and usage instructions. For other gateways, continue reading.

Gateway feature comparison

While there are many similarities to how Apple Pay is handled between the 3rd party supported gateways, there are some differences:
AuthNet CyberSource Moneris Braintree PayPal Payments Stripe WooPayments
Available on Cart Page yes yes yes yes yes yes yes
Available on Checkout page yes yes yes yes yes yes yes
Available “Buy Now” for simple products yes yes yes yes yes yes yes
Enable Apple Pay Locations Individually yes yes yes yes yes no no
Requires manual certificate generation yes yes yes no no no no
Requires PEM file on server yes yes yes no yes no no
Supported locations / currencies USA USA USA, CA USA See full list here All Apple Pay locations All Apple Pay locations
Supports Woo Subscriptions no no no no yes yes yes

Requirements

↑ Back to top
Stores that wish to accept Apple Pay with one of these 3rd party gateways must meet the following requirements:
  • Your entire site must be served over HTTPS with a valid SSL certificate.
  • Your server must support the TLS 1.2 protocol.
  • (Not required with Stripe) You must create an Apple Developer Account ($99 per year)
  • Authorize.Net and CyberSource only:
    • The individual who generates certificates must use MacOS to generate them, as Keychain access is required.
    • Your merchant account provider must support tokenization (includes Chase Paymentech, Global Payments, First Data). If you’re not sure if you meet this requirement, please check with your Authorize.Net or CyberSource representative.
Please note that Apple Pay is only available for one-time transactions at this time, so it is not possible to support WooCommerce Subscriptions or any sort of recurring or delayed billing for most of the payment gateways mentioned here. The exceptions to this are Stripe and WooPayments – they do accept Apple Pay when using WooCommerce Subscriptions. 

Verify Store Domain

↑ Back to top
Note: Verification is handled automatically with Apple Pay in WooPayments.
Your environment must validate your domain with Apple, set up a payment processing certificate to transfer data, and use a merchant identity certificate to authenticate your merchant sessions with Apple Pay servers. Apple has a list of steps here for items specific to their developer center UI, and we’ll catalog the basic steps to generating and placing certificates on the merchant server.
  1. Create a new (or use an existing) Merchant ID via the Apple developer center under “Certificates, IDs, and Profile” > Merchant IDs. WooCommerce Apple Pay: Register Merchant ID
  2. Edit the merchant ID to add a new domain.
  3. Download the verification file and SSH into to your server while leaving this open. WooCommerce Apple Pay: Verify domain
  4. Verify your domain by placing your verification file below your root at /.well-known/payment-processing-cert and verify with Apple.
The domain is now verified, so the payment gateway account should be set up. We’ll return to the Apple Developer account later to generate the payment processing and merchant identity certificates.

Payment Gateway Setup

↑ Back to top

Authorize.Net

↑ Back to top
  1. Sign up for Apple Pay in your payment gateway account using your new Apple Developer Merchant ID. WooCommerce Apple Pay: Sign Up
  2. Generate a new Certificate Signing Request (CSR) via your account and download it.
You’ll now use this CSR to generate certificates via your Apple Account.

CyberSource

↑ Back to top
Please follow the guide here to enable Apple Pay, then use the CSR provided from CyberSource to generate certificates via your Apple Account.

Moneris

↑ Back to top
Please follow the guide here to enable Apple Pay, then use the CSR provided from Moneris to generate certificates via your Apple Account.

Generating Apple Certificates

↑ Back to top
There are several steps to generating your certificates, the end result of which should be a .pem file you can upload to your server. This file must be stored above your webroot in a non-public, readable location. If you use shared hosting, you may not have access to this area
  1. Back in your Apple Developer account, create a new Payment Processing Certificate by uploading your processor’s CSR. WooCommerce Apple Pay: Upload gateway CSR
  2. Create a new Merchant Identity Certificate and follow the steps to use Keychain Access to create a new CSR, which you will then upload.
  3. When finished, a merchant_id.cer file will download.
  4. Double-click the new certification file to add to your Keychain Access app
  5. Right-click on its entry (named “Merchant Identity…”) and click “Export….”. This will generate a .p12 file.
  6. Using OpenSSL, convert that to a .pem file using a terminal command similar to openssl pkcs12 -in apple-pay-cert.p12 -out apple-pay-cert.pem -nodes -clcerts
  7. Upload that PEM file to your server, above the web root, in a non-public location that’s readable by PHP. Some hosts already have a dedicated directory for this — for example, Pagely servers have a /users/ directory above the webroot that can be used for this purpose.
  8. Set the full server path for that PEM file in the plugin settings.

Plugin Settings Configuration

↑ Back to top
This section is only required for Authorize.Net, CyberSource, and Moneris.
Once your domain has been verified and your PEM file is placed appropriately on the server, you can now enable Apple Pay via a one line filter, then configure the plugin to enable Apple Pay. To enable Apple Pay, use one of the following snippets: Authorize.Net
add_filter( 'wc_payment_gateway_authorize_net_cim_activate_apple_pay', '__return_true' );
CyberSource
add_filter( 'wc_payment_gateway_cybersource_activate_apple_pay', '__return_true' );
Moneris
add_filter( 'wc_payment_gateway_moneris_activate_apple_pay', '__return_true' );
Once this filter is active on the site, Apple Pay settings are enabled. The settings are located under WooCommerce > Payments > Apple Pay.
  • Enable / Disable – Enable this to make Apple Pay available to customers using eligible devices
  • Allow Apple Pay on – Select the locations for which Apple Pay should be available:
    • Single products – Shows the Apple Pay button as a “Buy Now” option on single product pages above the “Add to cart” button. Only shown for simple products currently.
    • Cart – Shows the Apple Pay button on cart pages before the “Proceed to Checkout” button as an express checkout option.
    • Checkout – Shows Apple Pay button below the “Order Review” section and above the other available payment options.
  • Button Style – Determines which Apple Pay button is shown to customers.
  • Apple Merchant ID – Enter the Merchant ID you’ve generated in your Apple Developer Account
  • Certificate Path – Enter the full path to the PEM file on your server (remember, this should be above your webroot for security)
  • Test Mode – Enable this to put the Apple Pay gateway in test mode for processing test orders.
WooCommerce Apple Pay: plugin settings

Purchasing with Apple Pay

↑ Back to top
Apple Pay can be enabled on several locations for your site. If enabled on single product pages, the Apple Pay button will be available above the “add to cart” button. This is only available for single products, and the quantity selector is not considered, as Apple Pay requests have to be loaded as the page is loaded, which is before quantity is changed (and hence why it’s above quantity).
WooCommerce Apple Pay: Buy Now - Mobile
WooCommerce Apple Pay: Buy Now - desktop
If enabled on cart pages, Apple Pay will act as an express checkout option. If shipping options are already available, then Apple Pay can be used here to process the payment without going to checkout.
WooCommerce Apple Pay: Cart page - Mobile
WooCommerce Apple Pay: cart - desktop
If enabled on checkout, Apple Pay is shown at the top of the checkout page as an express option again.
WooCommerce Apple Pay: checkout - Mobile
WooCommerce Apple Pay: checkout - desktop
From any of these locations, the Apple Pay UI will be opened to allow the customer to select payment method, billing address, shipping address, shipping method, and complete the payment. Once payment is completed, the customer is directed to the “Order Received” page as usual. WooCommerce Apple Pay: desktop UI It’s important to note that orders are created with the billing and shipping addresses selected in the Apple Pay UI. The user account within WooCommerce will not be updated with these addresses.

The Gateway’s Role

The Apple Pay Touch ID process is only meant to verify that the customer’s card is valid, then encrypt its data. From there, Apple Pay does not actually do anything to process the payment, it’s just securing the payment data for sending. From that point, the payment gateway takes over the transaction, formatting the data to send it to the processor for approval, decline, etc., sending it in place of standard card details. Because the transaction is handled by the processor at that point after the payment details have been passed securely, this means that other gateway features, such as captures and refunds from WooCommerce, will work as they usually do.

Testing Apple Pay

↑ Back to top
Apple does allow creating Sandbox iCloud users with fake cards, but unless you have an extra iPhone laying around then that’s not really feasible without signing out of your personal iCloud on your eligible devices. In our testing, so long as you use the test mode in settings (transactions are posted to a test environment), you can use your real account and Apple Pay payment methods without processing real transactions.

Eligible Devices

In order to use Apple Pay, the purchaser must use an eligible device and browser. iPhone 6 or newer, iPad Pro, iPad Air 2, iPad mini 3 or newer, and MacBooks from 2012 or newer using MacOS 10.12 with an Apple Pay device — these devices can use Apple Pay. Apple Pay on the web can only be used with Safari, so customers using Chrome, Firefox, or other browsers cannot check out with Apple Pay. Please review Apple’s list of eligible devices to ensure you or your customer is using a supported device, version, and browser.

Frequently Asked Questions

↑ Back to top
Q: Can I process refunds or captures as usual with Apple Pay? A: Yes! If credit card transactions for your payment gateway allow refunds, voids, or captures, then Apple Pay transactions are eligible for these features as well, they’re not treated any differently. Q: Why can’t I use Apple Pay with the “Buy Now” button for variable products? A: Apple Pay requests have to be generated when the page is loaded. As such, we can’t later “pull in” the variations that have been selected to ensure the order is accurate. Since we can’t get this data into the Apple Pay form in any way, Apple Pay “Buy Now” buttons cannot be enabled for variable products. If you have other data on the product page that needs to be collected, such as measurements or add-ons, then you should not enable “Buy Now” buttons either. Q: Can I allow Apple Pay for Subscriptions or Pre-Orders? A: At present, the 3rd party payment gateways that support Apple Pay do not support tokenizing or saving payment profiles to your merchant account from converting Apple Pay tokens. As a result, there’s no way to securely save the customer payment details to your account for use in future transactions. Since payment data cannot be saved with Apple Pay, the Apple Pay button will only be available for one-time purchases, it cannot be used for recurring payments or a payment that’s saved and billed later. If a cart contains Subscriptions or Pre-Orders, Apple Pay is disabled. To use Apple Pay with WooCommerce Subscriptions and Pre-Orders, you can use Apple Pay with WooPayments instead if available to you.

Troubleshooting

↑ Back to top

Apple Pay buttons do not appear at any location

↑ Back to top
This can have several causes — here are the most common troubleshooting steps when Apple Pay buttons are never loaded:
  • Ensure you’re using an eligible device with the Safari browser. Please note that you cannot use Apple Pay in Google Chrome, Firefox, or with a non-Apple device — the button is automatically hidden.
  • Ensure Apple Pay is enabled under the settings, and that you’ve saved settings.
  • Ensure your PEM file is in a readable location. Check your settings screen for notices to ensure the plugin can read this file.
  • Ensure your entire site is served over HTTPS.
  • Run back through the verification and certification steps to ensure you’ve completed each properly, as your certificate may not be properly generated or converted to a PEM file.

Apple Pay buttons do not appear at a specific location

↑ Back to top
  • Please ensure your entire site is served over HTTPS; buttons will not appear at a location if that location is not served over HTTPS.
  • If you’re looking for “Buy Now” buttons, note that these only show up for simple products (not simple subscriptions or any other product type).

Orders are missing product details

↑ Back to top
Chances are you’re using the “Buy Now” set up with another plugin that we haven’t detected. Please review this FAQ on Apple Pay Buy Now + variable products — in short, we cannot pull in any details for a product that are added on the product page (such as add-ons, custom fields, or other details). Because of this, you should not enable “Buy Now” buttons if you sell customized products or use plugins that add meta data to products during the purchasing process.

Other Issues

↑ Back to top
If you experience other issues with Apple Pay, please take the following steps:
  • Please enable logging under your payment gateway’s credit card settings.
  • Attempt an Apple Pay transaction and review the logs.
  • If you see certification errors, please work with your host to upgrade your server so it meets the Apple Pay requirements (ie upgrade cURL and ensure TLS 1.2 compatibility).
  • If you see other errors or only generic payment errors, please get in touch with support and provide logs for review.

Get Help or Support

↑ Back to top
Need some help? Please ensure you’ve followed the troubleshooting steps above. We can provide help with Apple Pay payment processing issues (e.g., experiencing issues with information generated for orders). We cannot assist with any steps associated with verifying domains, generating certificates, or placing certificates in the appropriate location on your server to validate your site. In short, we can only help if Apple Pay already shows up on the site and take issues from that point.
  • If you need assistance getting Apple Pay set up for your site and payment processing account, we recommend filling out the development request form to hire a developer to assist you with this process.
  • If you have Apple Pay set up already and experience other issues, please submit a help request with your logs and we’d be happy to troubleshoot further.
Setting up Apple Pay for merchants is not covered by our support policy, so the server certification process must be completed by the merchant independently (or the merchant’s developer) before Apple Pay can be enabled within a plugin.

Hire a Developer

↑ Back to top
We’ve partnered with Codeable to ensure Codeable professionals are knowledgeable in this process and able to assist merchants in completing site verification and certification for Apple Pay. If you’d like assistance in getting your site verified and certified to accept Apple Pay, please complete this form to get in touch with the developers at Codeable for a quote on assisting you in setting up Apple Pay. After accepting a bid from a developer, they’ll need access to your Apple Developer account ($99 per year), so you could also sign up for an account prior to accepting a bid, as your Apple account set up may take a few days. Here’s some sample text if you’d like to use it: Project name: Set up Apple Pay for my WooCommerce store Project details
I would like a developer to assist me in verifying my domain with Apple, generating a processing certificate, and placing this certificate on the appropriate location on my server so that I can process payments with Apple Pay via my WooCommerce payment gateway.