Payments and transactions
Payments and transactions
Payment gateways define the payment methods a checkout can offer. A payment session starts a configured checkout flow. A payment and its transactions record the resulting payment activity. These are related resources, not interchangeable success signals.
Choose an eligible gateway
Thor exposes manual, Stripe, and Stripe Connect gateway configurations. A gateway can have a cart predicate, so available methods depend on the current cart. Query eligible gateways after the cart’s commercial inputs are ready. Keep provider credentials in server-side configuration.
Initialize and complete
For custom checkout, initialize the chosen gateway and request __typename on the returned payment session.
Use fragments for the provider-specific fields your client handles.
Complete any required provider interaction before finishing the checkout flow.
An initialized session does not establish that funds were authorized or captured.
Hosted checkout uses the cart’s checkoutUrl and your configured methods.
See Build a cart and checkout.
Operational actions
Capture, cancellation, and refund are different actions. Check the current payment, provider reference, and gateway capabilities before offering them. A refund does not by itself cancel an order, return goods, or restock inventory.
The order’s paymentState summarizes payment progress.
Use it alongside the payment amounts and transactions; do not infer the state from one button click or an old local value.
Follow Capture, cancel, and refund payments for the verified workflow and ambiguous-response recovery.