Apple Pay is a mobile payment method developed by Apple. Its integration with PrestaShop Checkout allows your customers to pay via this service.
|
⚠️ Apple Pay is available for 1.7 and 8 versions of PrestaShop. |
How to set up Apple Pay for PrestaShop Checkout
First of all, make sure you are using the latest version of PrestaShop Checkout. To do this, go to your back office in the module manager menu.
Here are the configuration steps:
1. Click on "Configure" the module. Then go to the Payment Settings tab. Locate the section Enable payment methods and click on the Edit button.
2. You will find the Apple Pay option, activate it if it is not already done, and click on "Configure".
3. Click on "Save your domain".
4. PrestaShop Checkout will check if the domain verification file is available on your server to use Apple Pay. For troubleshooting if the domain file is not available, see the Troubleshooting section below.
5. Then, save your Apple Pay domain on your PayPal account.
6. Once the verification is successful, you will see a confirmation message on your PrestaShop Checkout interface.
After the successful registration of your domain, Apple Pay will work fully on your PrestaShop store.
Note: If automatic registration fails, you can try to manually register your domain within PayPal. Contact PrestaShop PayPal support if you encounter difficulties. (Production or Sandbox).
Troubleshooting the domain when the registration file is not available
The module uses the moduleRoutes to automatically expose the domain verification file through a dynamic route.
Breakdown of problems
1. Point in the URL path:
- By default, Nginx and some server configurations can block URLs containing a dot in dynamic routes. This is a common security feature to prevent unintended access to files.
- The PrestaShop routing system may not handle these URLs correctly if the platform is not installed in the root directory.
2. Installation without root:
- If PrestaShop is installed in a subdirectory (for example, https://example.com/shop/), the moduleRoutes may not map the path/.well-known/ correctly.
3. Server-specific behavior:
- Apache often manages these routes via .htaccess rules, but Nginx requires explicit configurations to allow access to .well-known.
Possible options:
1. Placement of static files
If possible, bypass dynamic routing by placing the apple-developer-merchantid-domain-association file statically in the .well-known directory of the root of your domain:
Steps:
- Create the .well-known directory at the root of your server.
- Place the file apple-developer-merchantid-domain-association there.
- Configure your server to serve the "well-known" directory if necessary.
Benefits: completely avoids routing problems.
Disadvantages: requires manual placement of files.
2. Custom Nginx configuration
For Nginx servers, explicitly allow access to .well-known URLs:
Add the following block to your Nginx configuration:
location /.well-known/ {
allow all;
root /path/to/prestashop/root;
}
Benefits: allows dynamic management and supports the PrestaShop routing system.
Disadvantages: requires server-level access to change configurations.
Download and host the sandbox domain association file
- Production: https://paypalobjects.com/devdoc/apple-pay/well-known/apple-developer-merchantid-domain-association
- Sandbox: https://paypalobjects.com/devdoc/apple-pay/sandbox/apple-developer-merchantid-domain-association