2.5 KiB
Stripe Donations
RanaZe: Step 3 Trainer accepts authenticated, one-time USD contributions through Stripe-hosted Checkout. The API enforces a minimum contribution of $5 and a maximum of $10,000. Payment card data never passes through or is stored by RanaZe.
Contributions are not tax-deductible.
Stripe test-mode setup
-
In the Stripe Dashboard, switch to test mode.
-
Create a webhook endpoint at:
https://s3q.ranaze.com/api/donations/stripe-webhook -
Subscribe the endpoint to these events:
checkout.session.completedcheckout.session.async_payment_succeededcheckout.session.async_payment_failedcheckout.session.expired
-
Copy the webhook signing secret (
whsec_...). -
Copy a test secret API key (
sk_test_...). -
Add both values as Gitea Actions secrets in the API repository:
STRIPE_SECRET_KEYSTRIPE_WEBHOOK_SECRET
The deployment workflow writes these values to the Kubernetes secret medmind-stripe. Never commit either value to the repository.
Stripe account settings
Configure RanaZe branding in Stripe Checkout and enable successful-payment email receipts in Stripe customer email settings. Stripe Checkout collects the contributor's email address.
Verification
After deployment:
- Sign in to RanaZe and open Support RanaZe from the sidebar.
- Confirm that amounts below $5 and above $10,000 are rejected.
- Start a $5 test contribution.
- Complete Checkout using Stripe's standard test card
4242 4242 4242 4242, any future expiration date, and any CVC. - Return to RanaZe and confirm the contribution changes from pending to confirmed.
- In Stripe, confirm the Checkout Session and webhook delivery both succeeded.
- In MongoDB, confirm the corresponding
Donationsdocument hasStatus: "paid"and a populatedPaidUtcvalue.
The client-visible status endpoint returns only the donation ID, amount, currency, status, creation time, and paid time. Stripe payment identifiers and webhook metadata remain server-side.
Live-mode cutover
- Create the same webhook endpoint in Stripe live mode.
- Replace
STRIPE_SECRET_KEYwith the live secret key (sk_live_...). - Replace
STRIPE_WEBHOOK_SECRETwith the live endpoint's signing secret. - Trigger a deployment and complete a small real contribution.
- Confirm the payment, receipt, webhook delivery, and
paidstatus before announcing availability.
Test and live webhook signing secrets are different. Both Stripe secrets must always belong to the same Stripe mode.