Orchard Core Commerce supports multiple payment providers. Stripe was the first implemented. This document describes how to set it up for testing, including hooking your site up to the Stripe dashboard. If you just want to try out the checkout flow you can skip the Webhook sections.
Stripe API uses a secret-publishable key pair. The following API keys are public sample test keys, they can be found in Stripe's documentation.
- Publishable key:
pk_test_51H59owJmQoVhz82aWAoi9M5s8PC6sSAqFI7KfAD2NRKun5riDIOM0dvu2caM25a5f5JbYLMc5Umxw8Dl7dBIDNwM00yVbSX8uS
- Secret key:
sk_test_51H59owJmQoVhz82aOUNOuCVbK0u1zjyRFKkFp9EfrqzWaUWqQni3oSxljsdTIu2YZ9XvlbeGjZRU7B7ye2EjJQE000Dm2DtMWD
- Webhook signing key: Uniquely generated by the Stripe CLI as described below, it looks like
whsec_453d1046fc31377b7a93...
Publishable and secret keys are just publicly available test keys. Don't submit any personally identifiable information in requests made with this key.
You can obtain your own test keys from the Stripe dashboard. You can find them in the developer dashboard's Api keys tab.
In your Orchard Core site go to Admin → Configuration → Commerce → Stripe API and provide at least the Publishable key and Secret key. Otherwise the feature can't work and the payment button will be hidden during checkout.
It is not needed, but recommended to use webhook. Otherwise, if there is a problem with redirecting the user, the payment confirmation will fail.
There is no publicly available webhook signing key. Use your own API keys and Webhook key. You can create one in the developer dashboard's Webhooks tab.
Read about webhook status codes here. Our webhook endpoint returns 200 if the request was received without an exception. It does not mean that it has been processed. It returns 400 if there was an exception inside the webhook controller. Everything else comes from Stripe itself.
- Use/Install Stripe CLI.
- Login to your stripe account:
stripe login
- Set the endpoint for listening e.g:
stripe listen --forward-to https://localhost:5001/stripe-webhook
- Copy and save the webhook key on the /Admin/Settings/StripeApi page.
- Test the payment.
There are available test cards that can be found in Stripe's documentation.
There are multiple test cards that can simulate any scenario, including error codes. Here are two examples:
Brand | Number | CVC | Date | Result |
---|---|---|---|---|
Visa | 4242424242424242 | Any 3 digits | Any future date | success |
Visa | 4000000000009995 | Any 3 digits | Any future date | card_declined, insufficient_funds |
Visa | 4000000000003220 | Any 3 digits | Any future date | success, goes through 3DS authentication |
Demo video about Stripe Payment integration.