Practical articles
How I map products, stock, payments and pre-orders
My recommended sequence for variant records, authoritative totals, delivery rules, reservations and provider-specific payment verification, informed by GYAL.
Stefan Rampersad · Principal Strategist, PHNYXPRO · 4 min read ·
- Project:
- GYAL
- Historical period:
- September 2025 to September 2026
Retrospective written 25 November 2026
A collection is a browsing structure. A variant is what the customer orders. A payment attempt is another record again. GYAL brought these relationships into focus through women's activewear, archetype-led collections, guest checkout and pre-orders. My recommended implementation starts by making those distinctions explicit, then deciding which transitions the server may authorise.
By September 2026, GYAL's work had advanced order creation, payment links and callback handling, while a live card payment, paid-state return and confirmation email remained unverified. The sequence below is my recommended route to dependable operation; it should guide implementation and acceptance rather than imply that every control was already deployed and tested.
Map the records before drawing the checkout
Create a product record for the garment and variant records for its size and colour combinations. Give each variant a stable identifier and an availability policy. Keep collection membership separate so a product can appear under an archetype without becoming a second stock item. Catalogue management should name the person responsible for approving descriptions and availability changes.
For a worked example, take a garment shown in an Everyday Warrior collection. Selecting a colour and size should put the corresponding variant identifier and quantity into the basket. At order creation, store a snapshot of its description, selected options, currency and agreed price. Later catalogue edits must leave that accepted order intelligible to customer service.
Separate the order from payment attempts, stock reservations and delivery decisions. One order may have a failed payment attempt followed by another attempt. A pre-order may involve a deposit and a later balance, each with its own obligation and payment records. Keep order, payment and fulfilment states distinct so a paid deposit cannot silently become a fully paid, dispatchable order.
Let the server establish the agreement
Accept variant identifiers, quantities and delivery choices from the browser. Re-read eligible variants and current prices on the server, calculate in integer minor currency units, and record the authoritative total. Reject unavailable combinations and invalid quantities. A customer-edited basket total must never decide the amount sent to the payment provider.
Use one maintained delivery-rule source for the product journey, basket and order calculation. Record which rule and destination inputs produced the fee. Have an operations owner approve changes. Compare the displayed quote with the stored order before proceeding; if it changes, explain the new agreement and require the customer to accept it rather than quietly replacing the amount.
Separate available stock from a future commitment
For available stock, reserve the requested variant within the same controlled operation that creates the order. Define reservation expiry and release rules. For pre-orders, check the distinct eligibility policy and record the commitment, delivery expectation and deposit or balance obligations. Explain the chosen path before payment. A depleted stock quantity must never automatically imply permission to accept a pre-order.
Give order creation an application idempotency key and enforce its uniqueness. Repeating the same operation should return the existing order. A deliberate new payment attempt needs its own identity linked to that order. Store any provider-supported request key separately and follow its documented behaviour. Do not assume that adding an arbitrary header makes an external payment request idempotent.
Verify the provider's actual protocol
WiPay's hosted checkout guidance says request acceptance and a transaction identifier are not payment confirmation. Store the identifier against the attempt and keep the order awaiting a verified result. [WiPay hosted checkout: request acceptance and transaction results]
WiPay requires server-side response-hash verification using the original requested total, rather than the customer-facing response total. Follow its documented calculation and link the result to the stored attempt. This is a provider-specific protocol, not an interchangeable Stripe verification recipe. [WiPay Payments API: hosted checkout and response verification]
WiPay webhooks extend lifecycle tracking and can deliver duplicates. Follow its signature-verification guidance, preserve the raw body and deduplicate by the provider's stable event identifier. [WiPay webhooks: signature verification and duplicate events]
Apply verified outcomes through controlled state transitions. An unsuccessful attempt can leave an order eligible for retry; an uncertain outcome needs reconciliation before stock is released or another charge is encouraged. Keep a durable event trail and ensure repeated redirects or events cannot trigger a second stock deduction or duplicate confirmation job.
Make acceptance a shared responsibility
Have catalogue, operations and technical owners approve concrete checks: changing a browser total cannot change the server amount; two attempts to reserve the last variant cannot both succeed; a pre-order remains distinct from available stock; and delivery fees agree across views. Exercise cancellation, failure, missing return, invalid verification and duplicate events in a controlled test environment.
Check that a deposit leaves the remaining obligation visible, and that staff can trace an uncertain attempt without marking it paid by assumption. Verify confirmation generation and delivery separately from payment state. A separately authorised live end-to-end check would still be needed before commercial sign-off. My release criterion is a coherent customer agreement that the team can explain, recover and support.
References
Stefan Rampersad
Stefan leads PHNYXPRO, writing about brand storytelling, strategy and the business of creative work in the Caribbean and beyond.
Keep reading The Post