page last edited on 21 August 2018
The addon Stripe payment provides an integration with Stripe, a PCI compliant payment service with a neat payment form on checkout that allows saving personal CC info in Stripe for future re-using (optional). Stripe is compatible with all types of devices: desktop, tablet and mobile.
Stripe payment can be used in the US, UK, Canada and Ireland, Stripe is in Beta in Australia, France, Spain, Germany, Belgium, Finland, Netherlands and Luxembourg, with even more countries coming.
Installation and Setup
To enable Stripe payment in your store follow the regular guidelines on adding an online payment method provided in Adding Payment Methods.
Once Stripe is added, you’ll be redirected to the Stripe settings page:
Here you should click the blue Connect with Stripe button to be redireted to Stripe where you can either sign in with an exisitng Stripe account or create a new one:
Once signed in you’ll be redirected back to X-Cart Stripe settings page:
Here you’ll need to copy “Webhook URL” and place it into your Stripe Account settings. For this purpose:
- open the page “Webhooks” in the “Developers” section of dashboard.stripe.com
- in the section Endpoints receiving events from your account, click + Add endpoint.
- in the form that opens, paste the “Webhook URL” value into the field URL to be called and click Add endpoint.
That’s it, the “Webhook URL” is added.
More information on the setup of webhooks is available here.
The rest of the payment settings are as follows:
- Secret key : The field is defined automatically by the system when a Stripe account is connected.
- Publishable key : The field is defined automatically by the system when a Stripe account is connected.
- Secret key (test mode) : The field is defined automatically by the system when test mode is enabled.
- Publishable key (test mode) : The field is defined automatically by the system when test mode is enabled.
- Transaction type : If you set the value to Authorization only, you’ll need to process each transaction manually. This option is preferred if you need to have an option to void orders. If the value is set to Authorization and Capture all transactions will be processed automatically.
- Test/Live mode : Use this setting to select the operation mode for your Stripe integration. Before you can offer Stripe payment on your website, you will first need to successfully carry out some required test transactions. To do the testing, you will need to set the operation mode of your integration to Test. When the payment is ready for production use, you can switch the Test/Live mode setting to Live.
- Invoice number prefix : If you use the same account to accept payments from more than one X-Cart store, use this field to set an invoice number prefix for this store. The prefix will serve as an identifier of the store and will help you to avoid errors of the “duplicate invoice number” type. It’s recommended to limit the length of invoice prefix to 9 characters. Larger prefixes will be cut prior to transaction initialization.
When all settings are configured save the changes and switch ON the payment.
The Stripe payment will become available on chekout:
When a customer clicks the Place order button Stripe will show a pop-up payment form where the customer can specify his credit card details and save them for future references is required:
The used payment method is displayed on both the order invoice page in the customer storefront and the order details page (Orders -> Order list) and payment transactions page (Orders -> Payment transactions) in the admin area.
Depending on the Transaction type settings value orders paid with Stripe get either “Paid” or “Authorized” order payment status. The “Paid” status is assigned to an order if the Transaction type setting is set to Authorization and Capture and the “Authorized” status is assigned if the value is set to Authorize only respectively.
Orders with the “Authorized” payment status require manual processing. The cart admin can either Capture or Void the order on the order details page depending on the preferences.
Once an order gets the “Paid” status it can be refunded only.
Stripe allows full and partial refunds:
To refund the order in full just click on the Refund button on the order details page and confirm the action.
For a partial refund specify the amount you want to refund in the field opposite the Refund button and click Refund.
The order will get the “Partially paid” payment status the maximum amount available for refund being specified:
Help make this document better
This guide, as well as the rest of our docs, are open-source and available on GitHub.