Stripe Go-Live

Step-by-step Stripe setup for RedERP ecommerce — keys, webhook, currencies, paid status, and common failures.

Overview

Stripe card checkout uses an active payment gateway in E-commerce → Store settings → Payments, plus storefront PaymentIntent APIs and a webhook for reliable paid/failed/refunded updates.

Gateways here are not the same screen as Payment Methods (active_ecommerce).


Before you start

  1. Stripe account (test mode first, then live).
  2. Store currency set under Store settings → General (USD, EUR, GBP, TND, QAR, AED).
  3. Products enabled for ecommerce with valid prices and stock.
  4. At least one shipping option / flat rate so checkout can complete.

Add the Stripe gateway (step by step)

  1. Open E-commerce → Store settings → Payments.
  2. Add gateway → code stripe.
  3. Set a display name (e.g. Card / Stripe).
  4. In credentials JSON, set:
    • publishable_keypk_test_… or pk_live_…
    • secret_keysk_test_… or sk_live_…
  5. In Stripe webhook secret, paste whsec_… (stored in config_json.webhook_secret, not inside credentials).
  6. Optionally tick supported currencies.
  7. Turn Active on → Save.

On edit, leaving credentials blank keeps existing secrets.


Configure the Stripe webhook

  1. In Stripe Dashboard → Developers → Webhooks → Add endpoint.

  2. Endpoint URL (production backend):

    https://{your-api-host}/webhooks/stripe-ecommerce

  3. Listen for at least:

    • payment_intent.succeeded
    • payment_intent.payment_failed
    • charge.refunded
  4. Copy the signing secret (whsec_…) into the gateway field above.

What the webhook does

EventOrder payment_statusEmails (if notifications ON)
payment_intent.succeededpaid (+ paid_at)order confirmed + payment successful
payment_intent.payment_failedfailedpayment failed
charge.refundedrefundedpayment refunded

The storefront also calls confirm payment after Elements succeeds; the webhook is still required for reliability and refunds.

Signature failures respond with: Webhook signature verification failed.


Shopper card flow

  1. Shopper selects Stripe at checkout.
  2. Order is created; PaymentIntent is created (create-intent).
  3. Card is entered in the inline Stripe panel.
  4. On success, payment is confirmed and confirmation page shows payment success.
  5. Until paid, Stripe/redirect orders typically defer the main confirmation email (unlike COD).

Test checklist

  1. Use test keys + test card (4242…).
  2. Place an order → status becomes paid.
  3. Confirm emails if notifications are enabled.
  4. In Stripe, trigger a test refund → ERP shows refunded.
  5. Switch to live keys + live webhook secret only when ready.

Common failures

SymptomFix
Invalid or inactive payment gatewayGateway missing / Active off / wrong code
Stripe is not configured…Missing publishable_key / secret_key
Card OK but order stays unpaidWebhook URL / whsec wrong or events missing
Currency errors in StripeAlign store currency_code with Stripe account capabilities
Order is already paidDuplicate confirm — ignore / refresh order

Full list: Troubleshooting.