Login to the Stripe dashboard.
Live API Keys
Click Developers and then API Keys in the left hand side menu. On the right hand side you will find your Publishable key. To view your Secret key, click the Reveal live key token.
Test API Keys
To retreieve your test API keys, click the View test data toggle switch in the left hand side menu and then repeat the steps outlined in the Live API Keys section above.
When using the Stripe provider, the status of an order is updated based on responses from Stripe sent over webhooks. Tea Commerce will automatically create and register a webhook communication URL with Stripe for you when you save the provider settings with valid API keys.
NB You need to register webhooks for both the test and live modes. Depending on which mode you have configured in the payment provider settings will determine which type of webhook registration is generated.
TIP If you need to test your webhooks locally, we recommend you use a tool such as ngrok which can create a temporary public URL that safely proxies to your localhost server, allowing you to receive the Stripe webhook requests without the need to alter your firewall settings. When using such a tool, it may be necessary to alter the base URL of the communication URL generated by the provider. To do this, you can add a setting named test_base_url with the base URL you'd like to use instead and the communication URL will be generated based on this URL instead.
If you need to regenerate a webhook endpoint at any point, you should delete the existing webhook from within the Stripe dashboard and then re-save the payment provider to trigger the creation of a new one.
If webhook generation is successful, 2 new payment provider settings will be generated:
- test_webhook_id The ID of the generated webhook
- test_webhook_secret The signing secret for validating webhook communications
If you don't see these settings generated, then something will have gone wrong with the generation process. Please review the sites log files for details.
The Stripe payment provider is automatically configured to send through billing contact information, this is in order for you to be able to perform validation rules using Stripe Radar. It is optional, but strongly recommended that you configure Radar Rules to validate the submitted Credit Card against these billing details. See the Radar documentation for more details.
Configure Tea Commerce
Create a payment method and select Stripe - inline as the payment provider. Now configure the settings as follows.
|form_url||The url of the page with the Stripe payment form on - e.g. /payment/|
|continue_url||The url to navigate to after payment is processed - e.g. /confirmation/|
|cancel_url||The url to navigate to if the customer cancels the payment - e.g. /cancel/|
|billing_address_line1_property_alias||The alias of the property containing line 1 of the billing address - e.g. addressLine1. Used by Stripe for Radar verification.|
|billing_address_line2_property_alias||The alias of the property containing line 2 of the billing address - e.g. addressLine2. Used by Stripe for Radar verification.|
|billing_city_property_alias||The alias of the property containing the billing address city - e.g. city. Used by Stripe for Radar verification.|
|billing_state_property_alias||The alias of the property containing the billing address state - e.g. state. Used by Stripe for Radar verification.|
|billing_zip_code_property_alias||The alias of the property containing the billing address zip code - e.g. zipCode. Used by Stripe for Radar verification.|
|test_secret_key||Your test stripe secret key.|
|test_public_key||Your test stripe public key.|
|test_webhook_id||ID of the auto created test Stripe webhook. Automatically generated.|
|test_webhook_secret||Test webhook signing secret for validating webhook requests. Automatically generated.|
|test_base_url||An explicit base URL to use when generating the live webhook notification URL.|
|live_secret_key||Your live stripe secret key.|
|live_public_key||Your live stripe public key.|
|live_webhook_id||ID of the auto created live Stripe webhook. Automatically generated.|
|live_webhook_secret||Live webhook signing secret for validating webhook requests. Automatically generated.|
|live_base_url||An explicit base URL to use when generating the live webhook notification URL.|
|capture||Flag indicating whether to immediately capture the payment, or whether to just authorize the payment for later (manual) capturing. - true/false.|
|mode||The mode of the provider - test/live.|
|send_stripe_receipt||Flag indicating whether to send a Stripe receipt to the customer - true/false.|