Stripe
Set up Stripe for cards and wallets, with refunds, disputes and real subscriptions.
Stripe takes cards and wallets through its hosted checkout page. It supports everything Emberstore can use: refunds from /store admin refund, chargebacks that take the reward back, payment lookups, and real subscriptions for billing: recurring items.
| Gateway id | stripe |
| Refund by API | Yes |
| Recurring | Yes, for durations of whole days (up to 1095 days) or whole weeks (up to 156) |
| Status lookup | Yes |
| Disputes | Yes |
| Webhook | You add it in the Stripe dashboard |
| Minimum charge | Stripe's own per currency, for example 0.50 in USD, EUR and INR, 0.30 in GBP |
Setup
Get your secret key
In the Stripe dashboard, copy your secret key. Use a test key (sk_test_...) while testing and your live key once you go live. Stripe suggests a restricted key in live mode: it needs write access to Checkout Sessions, Refunds and Subscriptions and read access to Invoices.
Add the webhook endpoint
In the Stripe dashboard, add a webhook endpoint with the address <webhook.public-base-url>/webhook/stripe and select these events:
checkout.session.completed, checkout.session.async_payment_succeeded, checkout.session.async_payment_failed, checkout.session.expired, charge.refunded, charge.dispute.created, invoice.paid, customer.subscription.deleted
Copy the endpoint's signing secret (whsec_...).
Fill in config.yml
stripe:
enabled: true
icon: DIAMOND
currency: ""
# Stripe secret key. Use a test key (sk_test_) while testing
secret-key: "sk_test_..."
# Signing secret of the webhook endpoint (whsec_)
webhook-secret: "whsec_..."Run /store admin reload.
Good to know
- Keep the server clock right. Stripe signatures carry a time, and a request more than five minutes off your server clock is rejected. Use NTP.
- Link lifetime. Stripe only accepts checkout pages that stay open between 30 minutes and 24 hours. Emberstore sends
checkout.expire-minutes, raised to at least 31 minutes. With a shorter setting the Stripe page stays open after the order expired, and a payment in that gap goes to Needs review. - Products pile up. Every checkout creates a product entry in your Stripe product list. That is how Stripe's hosted checkout works with prices set by the plugin.
- Subscriptions bill every n days or every n weeks, matching the item's
durationexactly, so30dbills every 30 days, not every calendar month. Durations in hours or minutes are not offered through Stripe. - Cancelling with
/store subscriptions cancelstops the subscription at the end of the paid period. - Partial refunds made in the Stripe dashboard are ignored. Only a full refund takes the reward back.
- Indian Stripe accounts. An account registered in India as an individual cannot accept international payments, so a checkout in USD is refused with Stripe's message about Indian regulations. Set
currency: "inr"for Stripe and prices are converted to rupees. Registered Indian businesses can enable international payments in Stripe instead.