apple pay integration in Magento 2 via authorize.net

Features for Magento 2 Apple Pay extension

  • Accelerated checkout process with one-tap / single-touch payment option
  • Make payments safe and secure
  • Uses Authorize.net payment gateway
  • Supports multi-store and multi-language
  • Supports multiple currencies and maximises conversion rates. 
  • Pre-requisites: Authorize.Net and Apple pay accounts are needed.
  • Looking for GraphQL/Hyva Compatibility? Contact us now! 

Apple Pay Extension Buy Now

After you purchased our Magento 2 Apple pay extension, follow the instructions below

Configuring the Apple Pay Payment Method in the Magento 2 Extension

Step 1: Copy and paste the file into the corresponding folder. app/code/Thecommerceshop/Applepayauth

Step 2: Setup Upgrade by using the following cmd in terminal php bin/magento setup:upgrade and provide respective permission for the folder

Step 3: Login to the Magento 2 admin panel and go to Store->Configuration-> Sales tab->Payment Method->ApplePay



Server Setup

  1. Use the Apple pay developer account https://developer.apple.com/ to create a Merchant ID
  2. You need to generate a new merchant id for each domain and need to update the Merchant ID in Authorize.net as shown below

Merchant Id generation in Apple Pay

  1. Select Identifiers under Certificates, Identifiers & Profiles
  2. To Create a new Identifier, Select + icon
  3. Select Merchant Ids under Register a new identifier
  4. Select Continue at the top
  5. Add Description and Identifier and Select Continue
  6. Select Register




Authorize.net configuration

  1. Login to the https://developer.authorize.net/ portal
  2. Navigate Digital Payment Solutions
  3. Select Apple Pay Sign/Up or Enabled
  4. Update/ Add Apple Merchant ID
  5. Download CSR certificate - CertificateRequest_csr.txt



Create Apple Apple Pay Payment Processing Certificate

  1. Select Certificates, Identifiers & Profiles
  2. Select Identifiers
  3. Filter and navigate to merchant id
  4. Select Certificate Under Apple Pay Payment Processing Certificate
  5. Upload the CSR file (which we downloaded from authorize.net) under Upload a Certificate Signing Request
  6. Select Continue.
  7. Note: Ensure Certificate status is Active as shown below



Merchant domain validation

  1. Select Add Domain under the Merchant Domains section.
  2. Enter Domain name.
  3. Note: Copy the entire domain from the site URL. Example:magento244-applepay.enterpriseapplicationdevelopers.com
  4. Select Save
  5. Select the Download button, apple-developer-merchantid-domain-association.txt will be downloaded
  6. Move the download txt file to the server path domain.com/.well-known/apple-developer-merchantid-domain-association.txt. (Example:
    https://magento244-applepay.enterpriseapplicationdevelopers.com/.well-known/apple-developer-merchantid-domain-association.txt)
  7. Select Verify and ensure the site is verified as shown below


Apple Pay Merchant Identity Certificate

  1. On Mac system, Navigate KeyChains app
  2. Select Keychain Access menu → Certificate Assistant
  3. Select Request a Certificate from the authority
  4. Enter details and select continue
  5. Save the certificate(CertificateSigningRequest.certSigningRequest) in the desired location.

Create Merchant Identity Certificate

  1. Inside the MAC developer apple account, Navigate to Apple Pay Merchant Identity Certificate Selected Merchant identifier
  2. Select Create Certificate
  3. Upload the above CertificateSigningRequest.certSigningRequest certificate under Upload a Certificate Signing Request
  4. Select Continue and Download merchant_id.cer certificate
  5. Navigate to the downloaded file and double-click, to add it to the keychain



Generating .pem key for payment

  1. On a Mac laptop, Select the KeyChains app
  2. Navigate Category → My Certificates
  3. Double click Select your Apple pay merchant identity certificate
  4. Popup will be shown with certificate details
  5. Under Trust, change the Always Trust option for When Using Certificate option.
  6. Close the popup widget.
  7. Select arrow and right click on the key icon
  8. Select Export
  9. Enter Password for file
  10. Enter the MAC system login user password and save Certificates.p12 file in desired location. Screenrecording: https://nimb.ws/nciX9Z
  11. Double click Certificates.p12 file

Convert Certificates.p12 to .pem format

  1. Navigate to the certificate directory in terminal
  2. Run format: openssl pkcs12 -in path.p12 -out newfile.pem (Example: openssl pkcs12 -in Certificates.p12 -out applepay.pem -nodes)
  3. Move the file to remote server certificate directory: (Example: scp applepay.pem magento244@magento244-applepay.enterpriseapplicationdevelopers.com:/var/www/html/magento2.4.2/var/applepay/applepay.pem)
  4. Give file permission to cert file.
  5. Upload the file in Admin panel -> Sales → Payment Methods → Apple Pay → Pem file
  6. Place test order and verify flow

Points to remember in this configuration

  1. The Pem file name should be named as “applepay.pem”
  2. To add Authorize.net credentials inside the Admin panel -> Configuration -> Sales -> Payment Methods -> Applepay. (https://nimb.ws/LzbgAt)
  3. Add apple pay merchant id inside the Magento admin panel - Admin -> Configuration -> Sales -> Payment Methods -> Applepay (Screenshot from magento2 admin panel - https://nimb.ws/rbtIVy .Screenshot from apple pay for merchant id - https://nimb.ws/haVtx6
  4. Don't forget to add PEM key password in the admin configuration

Known challenges you may face while this integration

If you are in any sandbox environment,

  • Sandbox test account: In your test device(iPhone), under Settings → Profile, ensure the sandbox profile is logged in instead of the developer account
  • Add Apple-approved sandbox test card details. Refer: Sandbox Testing
  • Ensure Region is the United states while setting the sandbox account in iPhone
  • Don't forget to add the PEM key password in the admin configuration. If you didn't update the PEM key password, you will get the following error in the log.

Curl failed with error #0: could not load PEM client certificate, OpenSSL error error:02001002:system library:fopen:No such file or directory, (no key
found, wrong passphrase, or wrong file format?)


If you are in the live environment, 

  • Ensure valid shipping, billing, and phone numbers are provided. And live orders are allowed from the US region only.

Web References

  1. Apple Pay on the Web
  2. Configuring Your Environment
  3. Sandbox Testing
  4. Generating .pem file using Open SSL
  5. Configure Apple pay using apple pay documentation

Apple Pay Extension Buy Now

Apple pay for Magento 2 via Authorize.Net Gateway Extension Demo:
https://magento244-applepay.enterpriseapplicationdevelopers.com/bag.html 

 
X

Please Wait ...!!

Logo
Highly Trusted eCommerce Partner

Find us on clutch!

Rating: 5/5

Copyright © 2025 TheCommerceShop. All rights reserved

Atlanta

7000 Central Parkway, Suite 220, Atlanta, GA 30328.

Newsletter

Sign up to be the first to hear about us