Magento 2: Test and go live
Test payment methods
Test your payment methods by simulating various payment statuses.
Note
- Use Mollie test credentials to test credit/debit cards.
- Apple Pay Direct works only in a production environment (in either test or live mode), and on Apple devices or Safari.
- Test Apple Pay Direct and the Bancontact QR code by making actual payments, as they only work in live mode.
Switch to test mode
In test mode, Mollie simulates payments: no real money transfers occur.
- Log in to Magento 2.
- Go to Stores > Configuration.
- Expand the Mollie section in the left sidebar, and select General.
- Select Test from the Modus drop-down menu under API details.
- Save the changes.
Make a test payment
- Make a test purchase in your Magento 2 shop.
- On the checkout page, select the payment method and submit the order.
- In the dialogue box that appears, select a payment status and click Continue.
This takes you to a page about the payment's status. For example, if you selected Paid, the page confirms a successful payment.
Get status updates in local test environments
Mollie webhooks only work with public URLs. This means that when you're developing locally (for example, https://localhost:8000
), you must create a temporary, public URL to tunnel Mollie HTTP traffic to your local host.
Note
In principle, your local environment remains public for as long as the tunnel exists. However, tunneling apps usually provide options for restricting access.
- Download and install a tunneling app. We recommend using ngrok↗.
- Start an HTTP tunnel:
ngrok http 80 -region eu
- Change the base URL manually in the backend of your Magento 2 installation.
Alternatively, use n98-magerun↗ to change the URL:export SHOPHOST="acme-store.eu.ngrok.io" n98-magerun2 config:store:set web/unsecure/base_url http://$SHOPHOST/ n98-magerun2 config:store:set web/secure/base_url https://$SHOPHOST/ n98-magerun2 config:store:set web/unsecure/base_link_url https://$SHOPHOST/ n98-magerun2 config:store:set web/secure/base_link_url https://$SHOPHOST/ n98-magerun2 cache:flush
- Depending on your installation, you may need to add the ngrok URL as a virtual host or alias to your Apache or NGINX server.
If you use Laravel Valet or Laravel Valet +, run the following: -
valet link acme-store.eu.ngrok.io
Go live
Go live to switch from test payments to actual payments.
Note
You can only accept actual payments after Mollie has approved your website profile.
What you need to do in advance
- Ensure that you've completed the Mollie signup process.
- Set up the app according to your preferences.
- Test your payment methods to ensure they work properly.
- If you have a multiple websites or stores, keep in mind that configuration settings apply to all levels of the hierarchy by default. Ensure that you understand how sites, stores, and view scopes work↗, and change the scope↗ if needed.
Switch to live mode
- Log in to Magento 2.
- Go to Stores > Configuration.
- Expand the Mollie section in the left sidebar, and select General.
- Select Live from the Modus menu under API details.
- Paste your live API key in the Live API key field.
- Select Test API key to ensure your API key is correct.
- Save the changes.
Updated 4 months ago