Wholesale marketplace app Atelier asks for net terms before a card
Описание и применение
В приложении Atelier реализована возможность выбора условий оплаты (предоплата, Net 15, Net 30, Net 60) при оформлении заказа, при этом net‑условия создают заказ в состоянии "подтверждён, но неоплачен", а предоплата инициирует Stripe‑чек-аут.
Задача
Enable buyers to choose net payment terms (Prepaid, Net 15, Net 30, Net 60) in a wholesale marketplace checkout while handling order state and payment flow accordingly.
Результат
Atelier now supports net payment terms, allowing buyers to place orders on credit while operators can track unpaid orders and mark them paid later. Prepaid orders continue to use Stripe checkout.
Рабочий процесс
- Define NET_TERMS enum in schemas.py
- Render payment terms dropdown in checkout form
- On form submit, create order as pending/unpaid
- If net terms selected, update order to confirmed/unpaid and skip card collection
- If prepaid selected, call stripe.checkout and redirect to hosted checkout
- On return, retrieve Stripe session and set order pay_state to paid if session is complete
- If Stripe service missing, mark order as paid with payment_provider='simulated'
- Operator dashboard shows unpaid net‑term orders and allows marking them paid
- Send order confirmation email on order creation
- Provide curation panel for buyers to describe shop and use AI service
Доказательства
NET_TERMS = ["Prepaid","Net 15","Net 30","Net 60"]
On net terms the order is updated to confirmed and stays unpaid. No card is asked for.
On Prepaid the code on main calls services.stripe.checkout with the order total and redirects to the hosted checkout URL
- Дата записи: 2026-10-14T15:41:10.202Z