Checking the currency

In PrestaShop, the merchant can enable different currencies for each module payment. Go to the Payment menu under Modules in your back office; you will see a section named CURRENCY RESTRICTIONS (you also have other sections such as COUNTRY RESTRICTIONS):

Checking the currency

The displayPayment hook won't display a payment method if the customer has chosen a currency that is not enabled for the payment method in question.

However, it's safer to add security in your payment module. In the initContent method of your module's Payment front controller, add the following lines just before assigning data to Smarty:

// Check if currency is accepted if (!$this->checkCurrency()) ...

Get PrestaShop Module Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.