Stripe Euro Payments - Magento 2 - Documentation
Table of Contents
- Necessary configuration in Stripe
- Configuration in Magento
- Testing Payment Methods
- Saved Sources
- Placing orders from the admin area
- Issuing Refunds
- Translations for multi-language websites
- Bancontact - Belgian, available in Belgium only
- Giropay - German, available in Germany only
- iDEAL - Dutch standard owned by Currence, available in Netherlands only
- SEPA Direct Debit - Single Euro Payments Area cross-border bank transfers within the Economic and Monetary Union
- SOFORT - German, available in Austria, Belgium, Germany, Netherlands, Spain and Italy
- Multibanco - Available for customers in Portugal
- Przelewy24 (P24) - Available for customers in Poland
- EPS (Electronic Payment Standard) - Available for customers in Austria (equivalent of iDEAL)
This is the documentation for installing, configuring and using this module on Magento 2.
Warning! We recommend that you test the module on a testing server before installing it on your live web server. Please see the Troubleshooting section if you come across any installation issue.
- Before installing this module, make sure that you have the latest version of Stripe Payments installed. You can check which is the latest version from the Changelog section towards the bottom of the product page. You can check which version you have installed from the app/code/Cryozonic/EuroPayments/CHANGELOG.txt file in your Magento directory.
- If you haven't done so already, please download the Stripe Euro Payments add-on from your customer account section or through the email that was sent to you when you purchased the module.
- Extract the file into your Magento root directory with the following command:
tar -xzvf Cryozonic_EuroPayments-1.0.0.tgzThe module will be extracted under app/code/Cryozonic/EuroPayments/
- Enable the module by running the following commands:
php bin/magento setup:upgradephp bin/magento cache:flush
- If you are upgrading from a previous version, you will also need to run:
php bin/magento module:enable Cryozonic_EuroPayments
- If you are running Magento in production mode, you will also need to run:
php bin/magento setup:static-content:deploy
php bin/magento setup:di:compile
- Continue to Necessary configuration in Stripe
From a terminal, run the following commands:
php bin/magento module:disable --clear-static-content Cryozonic_EuroPayments
rm -rf app/code/Cryozonic/EuroPayments
Important: If you have Stripe Payments installed as well, always upgrade both modules to their latest version.
You can always download the latest version of the module from the account section or through the email that was sent to you when you purchased the module. Once you have the latest version:
- Uninstall the module using these instructions.
- Re-install using these instructions. Make sure to follow all installation steps.
Necessary configuration in Stripe
Because most of the payment methods redirect the customer away from the merchant's website, there must be a way to know whether a payment authorization has succeeded or failed. This is important because some customers never return to the merchant's website after they authorize the payment with their bank (simply because they don't think it is necessary).
To alleviate the problem, Stripe provides an event emission mechanism called Stripe Webhooks which can notify the merchant's website when a payment has been authorized, failed or canceled by the customer. To enable Stripe Webhooks, go to your Stripe dashboard and under API > Webhooks, add the module's webhooks endpoint as shown in the following screenshot:
- URL to be called: https://yourdomain.com/cryozonic-stripe/webhooks. If you have multi-store views configured with different URLs, then you must pick one of those URLs for the webhooks. For example if you have a store view at https://en.yourdomain.com/shop/, then the webhook URL will be https://en.yourdomain.com/shop/cryozonic-stripe/webhooks. You only need to configure one webhook for your entire site.
- Events to send: You will need to create 2 separate endpoints, one for your live website and one for your testing environment
- Webhook version: You can use either your current one or upgrade to the latest. If you are concerned about backwards compatibility, you can check https://stripe.com/docs/upgrades for the green "MAJOR" tags in the version upgrades.
- Filter event: Only 5 events are currently supported by the module - source.canceled, source.chargeable, source.failed, charge.succeeded and charge.failed. We recommend to only enable these 5 to avoid flooding your website with unnecessary requests, and so that you keep clean logs in Stripe which you can easily debug if necessary.
Once configured, your webhook endpoint will appear in Stripe like so:
One final configuration is to set your Business Name correctly from your Stripe Account section, as this is what will be displayed in the mandate for the SEPA Direct Debit payment method.
Configuration in Magento
- Go to System > Configuration > Payment Methods
- Expand the section of any payment method you need to configure as shown in the following screenshot:
- Enabled: Enable or disable the payment method.
- Title: This is the name of the payment method as it will be seen by the customer at the checkout page.
- Optional Statement Descriptor: This is an optional small description of the source of the payment which will be shown in the customer's bank statements. If left empty, the default descriptor that is configured from https://dashboard.stripe.com/account will be used instead.
- Payment From Applicable Countries: Determines whether the payment method will be available to the customer at the checkout based on the country they set in their billing address. You can select "All Allowed Countries" if you want to show the payment method for all countries. An appropriate error message will be displayed at the final checkout step if the customer's country is not supported.
- Payment From Specific Countries: Each payment method is only available in specific countries. The supported countries of each payment method are pre-selected by default based on Stripe's documentation. We do not recommend changing this setting unless a new supported country is announced by Stripe.
- Currencies Applicable For: Determines whether the payment method will be available to the customer at the checkout based on the currency in which their order is placed. All of the payment methods will only work with the Euro (€) currency, however this setting is by default to "All Currencies" so that the payment method can be tested when initially set up. You can switch this to "Euro Only" on your live website.
- Sort Order: If you have many payment methods enabled, this setting will determine the order of this payment method at the checkout page. This is a global sort order that can be set for any payment method, including PayPal and the original Stripe Payments & Subscriptions method.
You are now ready to test the payment methods.
Testing Payment Methods
To test any of the payment methods, you can set the "Mode" of the Stripe Payments & Subscriptions module to "Test". The setting will be read and respected by all add-ons.
How to test SEPA Direct Debit
Before you can accept SEPA Direct Debit payments, your Stripe account needs to have regularly processed card payments for 60-75 days. If you would like to start sooner, please get in touch with Stripe. You can also refer to the guide on SEPA Direct Debit payments guide to learn more about its requirements.
This method is straightforward to test. An IBAN will be requested at the checkout as shown below:
The displayed mandate is a legal requirement for which translations are included for the 32 countries where SEPA is available. These will need some adjustments before going live.
Your business name will also be displayed in the mandate text as it is configured from your Stripe Account section.
You can enter the IBAN DE89370400440532013000 to test the SEPA Direct Debit method. At the final step, the customer will simply be shown the order success page instead of being redirected to their bank. An order will be created in your Magento admin with the status "Pending". Order statuses mean the following:
- Pending: The order has not been invoiced and the payment was not authorized yet. This is the initial status set when the order is created for the first time.
- Processing: If Stripe Webhooks have been configured correctly, then as soon as the payment is authorized by the customer's bank, the module will automatically charge the customer and invoice the order. The order status will be set to Processing in Magento if the order items need to be shipped, or to Complete if the order is for a virtual product.
- Complete: The payment was authorized, charged, invoiced, and the order items were shipped.
- Canceled: The payment has failed or the customer canceled the payment or mandate with their bank.
- Closed: The order has been refunded or canceled by an admin.
How to test other payment methods
These payment methods do not request any input from the customer during the checkout:
If the Stripe Payments & Subscriptions module is configured to be in Test Mode, then you will be redirected to a Stripe testing page for the selected payment method. An order will also be created in your Magento admin with the "Pending" order status. From the Stripe testing page, you can select to either Authorize or Fail the payment. If Stripe Webhooks have been configured correctly, then as soon as the payment is authorized, the order status will change based on the same rules described for the SEPA payment method.
How to test offline (in development) without Stripe Webhooks
If you are working on a development environment that cannot externally accept webhook requests, you can still test with the following manual method:
- In your Stripe dashboard, configure the test webhook URL to your live endpoint. If you still don't have a live server, you can use a http://requestb.in/ endpoint.
- Place an order with any of the module's payment methods.
- From your Stripe Events section, locate the source.chargeable event for the order you placed:
- From the event page, scroll to the bottom, expand the webhook request and copy the Request body under the successful webhook request:
- Using the Chrome Postman extension, create a POST request to http://yourdomain.dev/cryozonic-stripe/webhooks with a request body that is the same as the one you copied above.
- Trigger the request from Postman and check if the order status was updated to Processing under Sales > Orders.
SEPA Direct Debit is the only payment method that can be used to create re-usable sources. With SEPA Direct Debit, the created source is always saved on the customer object. The rest of the payment methods can only be created as single-use objects similarly to Tokens, which can be used for a single charge and for a specific amount that is set when the original order is placed. Single use sources will only be saved on the customer object when the Stripe Payments & Subscriptions module is configured to "Always save cards"
Because this is an add-on to Stripe Payments & Subscriptions, you can issue refunds in exactly the same way. For instructions on how to perform a refund in Stripe Payments & Subscriptions, click here.
Placing orders from the admin area
SEPA Direct Debit is the only payment method that can be used from the admin area to place orders:
Other payment methods cannot be used in the admin area as they are redirect-based and require the customer to authenticate with their bank. This means that they can only be used at the checkout by the customer only.
Translations for multi-language websites
The module contains translations file that can be used with multi-language Magento configurations. You can find this file under:
If you open this file in a text editor, you will notice that the file includes the mandate text for SEPA Direct Debit. The untranslated mandate has been copied from the European Payments Council's' website and it has been adjusted as per Stripe's instructions, i.e. the phrase "By signing this mandate form" has been replaced with "By providing your IBAN and confirming this payment" because the customer is performing an electronic authorization. Furthermore, the phase "and Stripe, our payment service provider" has been added to the mandate. To fully comply with regulations, you will need to perform the same adjustments to all languages that you will be using on your website.
Translations for 32 more countries are included in the module's i18n directory for your convenience. These would be the same language codes that you selected under System > Configuration > General > General > Currency Setup for each of your available stores. If you must set your Currency configuration for the first time, make sure to also flush your Configuration Cache after doing so.
If you translate one of these files in your language and would like to have it included in a future release of the module, feel free to send it to us at email@example.com
Most issues can be resolved using the Troubleshooting instructions of the Stripe Payments & Subscriptions module. If anything is missing from these, please contact us at firstname.lastname@example.org.
Order stuck in Pending status
When an order is initially created, it will have a status of Pending. This is to indicate that the authorization of the payment by the customer's bank is still pending. For all redirect-based payment methods, when an authorization happens, Stripe has to notify your website through a mechanism called Stripe Webhooks. If your orders do not change from Pending to Processing, this may indicate that you have not yet configured webhooks for your website. To configure Stripe Webhooks, please see the section Necessary configuration in Stripe.