Set up the PrestaShop module
Install the Pay.com module in your PrestaShop shop, connect it to your Pay.com account, and take a test payment.
The Pay.com module for PrestaShop adds Pay.com's payment methods to your shop's checkout. Install it, connect it to your Pay.com account, and take a test payment in the sandbox. What the module does once it's running is in PrestaShop module.
Requirements
The module works with PrestaShop's own checkout, with the Classic theme and Hummingbird.
| Requirement | Version |
|---|---|
| PrestaShop | 8.0 or later, including 9 (tested on 8.2 and 9.2) |
| PHP | 8.1 or later |
| Module | 0.1.1 |
Install and connect
You connect the module with an API key, created in the Pay.com dashboard, for each environment you use.
- 1
Install the module
In the back office, go to Modules → Module Manager, click Upload a module, and upload
pay_com_payments-0.1.1.zip. PrestaShop installs it.To update a shop that runs 0.1.0, upload the new zip the same way, then upgrade the module with Upgrade in Module Manager or with
bin/console prestashop:module upgrade pay_com_payments. The upgrade registers the hooks the shop lacks, such as the one for the express buttons at the top of the checkout page, and adds Payment → Pay.com to the back office menu. The module doesn't need a Reset. - 2
Enter your API keys
Go to Payment → Pay.com. Under API keys and webhook secrets, paste an API key you created in the Pay.com dashboard on each environment's row (an
sk-pay-com-sandbox-key on Sandbox for sandbox payments, and ansk-pay-com-live-key on Live). Click Save. Each key is checked with Pay.com before it's saved. See Settings. - 3
Add the webhook
In the Pay.com dashboard, add a webhook that sends events to the Webhook URL shown on the module's page. Paste its signing secret into Webhook signing secret on the environment's row and click Save. Do this for each environment you use, and subscribe to the 12 plugin webhook events.
- 4
Set up the cron
On a cron, the module processes webhooks that wait and checks open payments with Pay.com. Under Cron on the module's page, copy the crontab line and add it to the server so it runs every minute:
* * * * * curl -fsS -X POST -H 'X-Pay-Com-Cron-Token: <token>' https://shop.example.com/module/pay_com_payments/cronYou can also run
php modules/pay_com_payments/bin/cron.phpfrom the server's crontab, or use PrestaShop's Cron tasks manager module. See Cron. - 5
Take a test payment
Mode is set to Sandbox (test payments) by default, so the shop takes payments in the sandbox. Place an order with a test card, then set Mode to Live under Settings and click Save to take live payments.
Next steps
- Apple Pay: Register your shop's domain to show the Apple Pay button.
- PrestaShop module: What the module supports, how orders stay in sync with Pay.com, and the data the module sends.
- Settings: Every setting with its default.