Stripe
Prerequisites
To connect your DataPostie instance to Stripe, you first need:
- A live Stripe account
- The following Stripe API keys (see https://stripe.com/docs/keys#obtain-api-keys (opens in a new tab)):
- Test mode secret key
- Test mode publishable key
- Live mode secret key
- Live mode publishable key: Use this key, when you’re ready to launch your app, in your web or mobile app’s client-side code.
- A live mode price ID (see https://stripe.com/docs/api/prices (opens in a new tab)) with a value of $0.01
- A test mode price ID with a value of $0.01
Connect your Stripe account to your DataPostie instance
On the payment methods admin page, create a new payment method with the following details:
- Specify a payment method name
- Select
Stripe
as the payment method type - Under Public Key, enter your Stripe live mode publishable key
- Under Secret, enter your Stripe live mode secret
- Under Public Key [for Test Mode], enter your Stripe test mode publishable key
- Under Secret [for Test Mode], enter your Stripe test mode secret
- Under Parameters, specify:
- a parameter called
priceId
with the $0.01 live price ID specified above as the value - a parameter called
priceIdTest
with the $0.01 test price ID specified above as the value
- a parameter called
We will specify the webhook signing secrets after this step:
Once the Stripe payment method is created, you'll be able to see its numeric ID on the payment methods list page. Note this ID down and navigate to your Stripe Webhooks page (https://dashboard.stripe.com/webhooks (opens in a new tab)).
Once you have it, add the following webhook in your Stripe account, replacing YOUR_INSTANCE
and YOUR_STRIPE_PAYMENT_METHOD_ID
:
https://api.YOUR_INSTANCE.datapostie.com/webhooks/stripe-checkout-session-completed/YOUR_STRIPE_PAYMENT_METHOD_ID
Restrict the listened events to checkout.session.completed
:
Finally, note down the live and test mode webhook signing secrets for this webhook, edit your Stripe payment method in DataPostie, add those two webhooks signing secrets, and update your payment method.
Test the connection to your Stripe account
After your Stripe payment method is created, click the Test button next to it to ensure it is set up correctly. You can always edit it if need be.