Payments

Stripe, connected in four fields.

Products, courses, test access, paid appointments: everything is collected through Stripe, card payments included. A successful payment triggers the rest on its own — access, stock, confirmation, receipt.

Setting up Stripe

In the admin, Store › Payment methods. You copy three values from your Stripe dashboard, and choose the mode.

Public API key pk_test_… (pk_live_… in production)
Secret key sk_test_…
Webhook secret whsec_…
Test mode ticked while you try things out

Webhook address to declare in Stripe:
https://your-site.com/shop/webhook/stripe/

  1. The webhook is mandatory. It is how Stripe confirms a payment when the customer closed the tab before coming back to the site. Without its secret, the admin refuses to activate Stripe.
  2. Secret keys are encrypted in the database. A stolen copy of the database gives nothing to issue refunds or forge notifications with.
  3. Test mode is unticked on launch day, after replacing the test keys with the live keys.

What a payment triggers

Once the payment is confirmed, the order is marked paid and everything that depends on it follows, in the same operation.

  1. Access is granted: enrolment in the course bought, access to the questionnaire.
  2. Stock is decremented for physical products.
  3. The customer receives their confirmation and receipt, and you are notified of the new order.
  4. A paid appointment is confirmed when its amount is collected.

Buying requires an account: that is what the course, the test access and the order history are attached to. A payment with no recipient would collect money and deliver nothing.

The right amount, only once

Two paths confirm a payment: the customer returning to the site, and Stripe's notification. JEIKO takes both into account without ever counting twice.

  1. The amount is checked. A payment only settles an order if it matches its total exactly. A customer who adds items after opening the payment does not settle €110 with a €10 intent: the discrepancy is reported, the order is not fulfilled.
  2. Access is granted only once, whether the webhook or the browser return arrives first, or both together.
  3. Nothing gets lost. An order paid at Stripe but left pending on the site is recovered by a reconciliation command, which applies the same amount check.

python manage.py jeiko_payments_reconcile_orders --dry-run --days 30
# shows what would be settled, without changing anything

Refunds

  1. Appointments: each appointment type sets its refundable cancellation deadline, twenty-four hours by default. The refund is issued from the site, in full or in part; done from the Stripe dashboard, it is reflected on the appointment.
  2. Orders: setting an order to « refunded » notifies the customer by email.

Subscriptions are not handled: JEIKO collects one-off payments. A subscription notification received from Stripe is reported, not silently ignored.

The online storeAppointments