ORBCOMMERCE DOCUMENTATION
React checkout
Your Cart in, an Order out. One component for the last step of the purchase.
<Checkout> handles contact, addresses, shipping, payment, 3-D Secure, changed
Quotes and slow payments. You supply the Cart and the confirmation page.
Add the checkout
import { useNavigate } from "react-router";
import type { CommerceCart } from "@orbcart/client";
import { Checkout } from "@orbcart/react";
import "@orbcart/react/styles.css";
export function CheckoutPage({ cart }: { cart: CommerceCart }) {
const navigate = useNavigate();
return (
<Checkout
cart={cart}
locale="en-GB"
onOrdered={(order) => navigate(`/orders/${order.number}`)}
/>
);
}Get cart from commerce.openCart(token)
with the token from your session. Don't create a new Cart on every render.
Your legal pages can open in the same tab. What the buyer typed and has not
saved yet, their contact, addresses and answers to your own fields, stays in the tab's sessionStorage
for that Cart, and the form shows it again when they come back. It holds no
payment data and no token. The Cart's saved details count once a payment runs,
and the draft is gone once the Cart is ordered. Another Cart, such as the
buyer's own after signing in, shows its own details, never the last Cart's
draft. A server-rendered checkout shows the form's shape until the page
hydrates, then the draft. If the browser blocks storage, the form still works
but forgets the draft when the buyer leaves the page.
A Cart for the whole storefront
Wrap your app in CartProvider. Any component can then add to the bag:
import { CartProvider, useShoppingCart } from "@orbcart/react";
<CartProvider commerce={commerce} token={savedToken} onCartChange={(cart) => saveToken(cart.token)}>
<App />
</CartProvider>;
function AddToBag({ reference }: { reference: string }) {
const { add } = useShoppingCart();
return <button onClick={() => add(reference)}>Add to bag</button>;
}add() creates the first Cart when needed and moves to a fresh one after a
purchase, in every tab, and when a Cart has expired. onCartChange tells you
when to save a new token. Other frameworks use the same logic through
createShoppingCart().
The recipe Add to cart and a mini cart adds the header bag and keeps the
token in a cookie.
One language for every component
Wrap your pages in OrbCartProvider once, and no component needs a locale of
its own:
import { Money, OrbCartProvider } from "@orbcart/react";
<OrbCartProvider locale="de-CH">
<Money money={current.estimate.totals.total} />
<Checkout cart={cart} />
</OrbCartProvider>;A component's own locale still wins. OrderPage speaks the order's language
unless you pass one.
Money marks the fractional digits with data-part="orbcart-money-cents" and
the currency with data-part="orbcart-money-currency" for styling. A currency
without fractional digits has no cents part. The complete formatted amount
remains readable as one text, including its sign, separators and spacing.
German uses informal address by default. Set the locale to de-DE-formal (or
de-CH-formal for Swiss tax wording) to address buyers as “Sie” in the kit and
in the client's messages, including field errors. The same locale works with
describe("de-DE-formal") outside React.
Hosted payment fields and express buttons receive the same language and region
without the formal variant; an explicit paymentOptions.locale still wins.
Props
| Prop | Example | What it does |
|---|---|---|
cart | commerce.openCart(token) | The Cart to check out. Required. |
locale | "de-DE" | Language, money format and the provider's field. Default: the provider's. |
homeCountry | "DE" | Omit this country from review addresses. A sole cart destination is used when not supplied. |
onOrdered | (order) => navigate(...) | Show your confirmation page. |
start | { from: "quote", quote } | Where the checkout starts. See below. |
labels | { contact: { heading: "…" } } | Override wording. |
discountCode | false | Hide the code field. Default: shown. |
showEstimate | false | Hide the estimate before the Quote. Default: shown. |
stickyAction | true | On a phone, keep each step's button with its total in view. Default: off. |
lineImage, lineTitle | (reference, line) => <img … /> | Your product images, and titles such as a link to the product's page. |
summaryHeader | ({ lines }) => <Appointment /> | Your content over the summary's lines, such as the appointment they are for. |
paymentHelp | (method) => <TestCards … /> | Help next to the payment field. |
deliveryAddress | DhlDeliveryAddress | Your own address fields, such as a pickup finder. |
fields | { vatId: VatIdField } | Your own control for a field you ask. See below. |
after | { order: <TrustBadges /> } | Your content after a region of the page. See below. |
addressPriority | "billing" | Full billing leads; delivery-first is the default. |
pickup | { defaultLocation: "loc_…" } | The location pickup starts with, such as the buyer's store. See below. |
paymentOptions | { appearance: "inherit" } | Stripe's and Adyen's field in your theme, or styled in their own terms. |
identity, onSignedIn | betterAuthIdentity(…) | Sign-in inside the checkout. Signed-in buyers → |
buyer, signOut | { email }, <SignOutButton /> | For a buyer who is already signed in. |
className | "my-checkout" | A class on the root, for theming. |
children | <CheckoutPayment /> | Your own page, built from the regions. See below. |
steps | true | Contact, delivery and payment as three steps. See below. |
step, onStepChange | "delivery", navigate | The step that shows, for a page per step. |
PostalAddress also accepts homeCountry when displaying an address elsewhere.
Without it the country is shown; foreign countries are always shown in the page's language.
The locale does not determine the shop's country.
Delivery or pickup
By default the buyer chooses how the order reaches them right after contact:
one card per delivery, one for pickup. The selected card contains its controls.
A pickup asks no delivery address. Choosing pickup opens the location picker
and the selected location's address inside that card. Changing the location
keeps it open. Search appears from ten locations on; pickup.searchFrom
changes that threshold, and pickup={{ searchFrom: Infinity }} omits search.
- A Channel that delivers to one country offers its deliveries from the start and preselects the cheapest, so the buyer sees the price before typing an address. With several countries, delivery stands without a price until the address names the country.
- A way the cart's Lines keep off stays visible, disabled, with the Lines
that keep it off: "Für diese Bestellung nicht möglich: Winterreifen …". The
cart's
changessay which method, of which type and title, asshipping_unavailableentries. Word it withlabels.shipping.unavailable. pickup.defaultLocationnames a Location by its ID. Choosing pickup takes it at once, and where pickup is the only way, the checkout chooses it by itself. With one location, that location is taken alike.
ShippingChoice does the same outside the checkout:
<ShippingChoice methods={cart.shippingMethods} unavailable={unavailableShippingOf(cart)} … />.
Lead with billing
Set addressPriority="billing" for billing-led shops. Full billing name and
address appear before fulfillment, in every basket. Shipping goods then offers
a checked “Delivery address same as billing address” checkbox under the billing
address; unchecking it reveals separate delivery fields right below. Pickup and
service-only baskets have no delivery-address checkbox. Only server-offered
methods are shown; switching goods between delivery and pickup never changes
workshop appointments.
Linked delivery follows billing edits; a separate address stays independent.
Addresses and the explicit same-address choice survive fulfillment changes,
Back and reload in the same tab. Existing distinct saved addresses and restored
drafts are not replaced by a fresh linked default. Set
labels.address.delivery.sameAsBilling to replace the checkbox wording;
labels.address.billing.sameAsDelivery still describes the default direction.
addressLayout.delivery, addressLayout.billing and the delivery-only
deliveryAddress extension retain their roles.
This prop controls address composition, not server requirements. Keep
billingAddress: "required" on the Channel when full billing is mandatory for
express, pickup and workshop-only purchases too. Express review shows the
approved quote's addresses, not the form's drafts.
A cart that ships nothing
By default, if a cart holds only services or digital goods, the checkout asks for the email
and the billing country. It doesn't ask for a street, and it sends only
billTo: { partial: true, country }, never a delivery address. The estimate
beside the form has no shipping row and doesn't mention shipping.
With the Channel's billingAddress: "required",
the same address fields appear under Billing address, including in a preset
country. The form sends a full billTo, never a fake delivery address. It uses
addressLayout.billing, keeps drafts and saves later complete edits just like a
delivery address. A delivery address still bills by default; pickup instead
shows its country and a separate required billing address, without a same-as-delivery checkbox.
If your storefront fills in a signed-in buyer's details, do the same: send a
shipTo only when the cart's fields.ship_to asks for one.
Show what each Line stands for
Under each Line's title, the bag, the checkout's summary and the order page
list the Offer's attributes as written, one per row, such as Car: VW Golf VIII. Name them as the buyer reads them, in the channel's language. A Line's
configuration is never shown, since it may hold your own IDs. So two Lines of
one product, such as one service for two cars, read as two.
Name what sets a Line apart →
summaryHeader puts your content over the summary's lines, such as the
appointment they are for with a way to change it. It gets the lines the summary
shows: the Cart's while the estimate stands, the Quote's once there is one.
Read what you show from them, not from state elsewhere in your app, so the
header tells of what the buyer confirms. changeable is false while the order
is being placed; hide a way back then. On a phone it opens and closes with the
summary.
import type { CommerceCart } from "@orbcart/client";
import { Checkout } from "@orbcart/react";
import type { SummaryHeaderContext } from "@orbcart/react";
function Appointment({ lines, changeable }: SummaryHeaderContext) {
const time = lines.find((line) => line.offer?.attributes?.["Time"])?.offer?.attributes?.["Time"];
if (!time) return null;
return (
<p>
Your appointment: {time} {changeable && <a href="/booking">Change</a>}
</p>
);
}
export function CheckoutPage({ cart }: { cart: CommerceCart }) {
return <Checkout cart={cart} summaryHeader={(summary) => <Appointment {...summary} />} />;
}Start after a redirect
Nothing to build. Back from PayPal, Amazon Pay, Klarna or iDEAL, or on the page an express
review was handed to (/checkout?preparation=…), the checkout reads the page's
address and resumes the purchase by itself. A normal reload needs nothing
special either.
Amazon Pay appears as its official express button, or, where the Channel
offers it among the methods, as a row whose chosen button stands in the order
button's place (data-part="orbcart-checkout-approval", with the line above it
in orbcart-checkout-approval-hint, worded by words.approvalFirst). On return, the review
shows the actual Amazon payment descriptor and a read-only delivery address,
with Amazon-hosted controls to change address or payment. The normal order
button confirms the final Quote; the later authorization return resumes by
itself. Keep the Cart token across both redirects. Amazon Pay setup →
Pass start only to open a Quote you showed before:
<Checkout cart={cart} locale="en-GB" start={{ from: "quote", quote: quoteId }} />Labels and languages
German and English labels are built in. de-DE, de-AT and de-CH select
German; every other locale uses English labels with local money formatting.
Override only what differs:
<Checkout
cart={cart}
locale="en-GB"
labels={{
contact: { heading: "How can we reach you?" },
address: { countries: ["DE", "AT"] },
}}
/>- Without
countries, the country is a choice of your Channel's shipping countries.countriesreplaces that list: codes are named in thelocale's language and sorted by name; pass{ DE: "Deutschland" }instead to choose the names and the order yourself. A Channel that ships nowhere has no list, so the buyer types the two-letter code; passcountriesto offer a choice instead. With a single country there is nothing to choose: the form sends it without showing it. A cart that ships nothing then asks for the email alone, unless the Channel requires a full billing address. summary.estimate.noticeis a function. It gets{ tax, shipping }from the estimate'sexcludes, so it only names what the next step still confirms.summary.estimate.shippingis shown only while the estimate leaves shipping out.- Messages about outcomes and payment method names come from
describe(locale). Override them withwords. When a Quote offers no way to pay at all, such as before a provider's keys are set, the checkout says so where the payment would be and keeps what the buyer entered (notice.kind: "unpayable"). - The order button's text is fixed by law and cannot be overridden.
defaultLabels(locale)gives you the built-in labels for your own markup.
Theme it
Use CSS variables and data-part selectors. Never rely on internal class names
or HTML structure. The kit's stylesheet sits in @layer orbcart, so a rule of
yours outside a layer always wins over it; with Tailwind, declare
@layer theme, base, orbcart, components, utilities; first, so your utilities
win too:
.my-checkout {
--orbcart-color-text: #18212f;
--orbcart-color-surface: #fff;
--orbcart-color-action: #31476b;
--orbcart-color-action-text: #fff;
--orbcart-color-action-hover: #26385a;
--orbcart-color-focus: #31476b;
--orbcart-font-family: "Inter", sans-serif;
--orbcart-heading-weight: 600;
--orbcart-field-radius: 0.375rem;
--orbcart-field-focus-border: #31476b;
--orbcart-field-focus-shadow: 0 0 0 3px rgb(49 71 107 / 0.25);
--orbcart-button-radius: 999px;
--orbcart-panel-radius: 1rem;
--orbcart-control-height: 3.25rem;
--orbcart-columns: minmax(0, 1fr) minmax(0, 24rem);
--orbcart-order-sheen: none;
}
.my-checkout [data-part="orbcart-checkout-summary"] {
background: #f7f7f5;
}| Variable | Default / purpose |
|---|---|
--orbcart-font-size-small | 0.875em; small text such as hints and details |
--orbcart-font-weight-strong | 600; emphasized text such as labels and secondary buttons |
--orbcart-duration | 120ms; short field and button transitions and the notice flash delay |
More tokens: muted, border, error and attention colors, --orbcart-font-size,
--orbcart-space, --orbcart-action-shadow for a raised button,
--orbcart-button-press-scale and --orbcart-field-hover-border. Each column
in --orbcart-columns must shrink to zero, as in minmax(0, 24rem): stacked on a
phone, the form and the summary share them. Every disclosure ends in the kit's
chevron on its trigger's ::after; restyle it there or remove it with
content: none. The card field from Adyen follows your light and dark theme
automatically. For Stripe's field, pass paymentOptions={{ appearance: "inherit" }}:
it reads the same tokens when the field appears, and the side padding and text size of
your own text fields, so the card number starts where your fields' text does. A field the buyer is typing in
keeps its look through a switch to dark mode, so their card is never lost; the
next field shows the new theme. If your fields float their labels, set
--orbcart-field-labels: floating and Stripe's do too. Stripe sizes its field by a
spacing unit rather than a height; where your fields are taller than Stripe's, set
--orbcart-payment-spacing (such as 5px) to match them. PAYONE's card field
takes no theme from the checkout: it shows the template PAYONE keeps for your
account, the same in every checkout (the card field's look).
cart/react/README.md lists every part and state attribute.
With stickyAction, a narrow checkout keeps "Continue to payment", or the order
button with the total right above it, at the foot of the screen while the step
scrolls under them. Both stay inside their step, so they never cover your footer;
beside the summary, nothing changes. Set --orbcart-action-background to the
color behind them, and --orbcart-action-clearance to their height if your
buttons are taller, so a focused field never hides behind them.
Fields keep the standard focus outline unless --orbcart-field-focus-shadow is set;
then that shadow is their focus halo. Set --orbcart-field-focus-border to a color
to change the border without changing its width. Buttons, checkboxes and radio
buttons keep their own focus outline. Choose a visible halo and border; forced-colors
mode restores the system outline.
Content between the regions
after puts your content directly after a region of the page: express, contact, shipping,
address, payment, order or summary. Trust badges under the order button and a returns note
under the summary need no checkout of your own:
import type { CommerceCart } from "@orbcart/client";
import { Checkout } from "@orbcart/react";
export function CheckoutPage({ cart }: { cart: CommerceCart }) {
return (
<Checkout
cart={cart}
after={{
order: <p>Secure payment. 30 days to return.</p>,
summary: ({ quote }) => quote && <p>Ships within two working days.</p>,
}}
/>
);
}A value is content, or a function of the checkout's state. It shows while its region does: nothing
stands after payment or order before there is a payment step. Each sits in an
orbcart-checkout-after part that names its region in data-region.
Compose the page
For another order, a region left out or your own markup around the regions, give <Checkout>
children. The regions are components: CheckoutExpress, CheckoutDetails, CheckoutPayment and
CheckoutSummary. This page pays first, has no express buttons and keeps the summary in its own
sidebar:
import type { CommerceCart } from "@orbcart/client";
import { Checkout, CheckoutDetails, CheckoutPayment, CheckoutSummary } from "@orbcart/react";
export function CheckoutPage({ cart }: { cart: CommerceCart }) {
return (
<Checkout cart={cart} onOrdered={(order) => window.location.assign(`/orders/${order.number}`)}>
<div className="checkout-steps">
<CheckoutPayment />
<p>Secure payment. 30 days to return.</p>
<CheckoutDetails />
</div>
<aside className="order-summary">
<CheckoutSummary />
</aside>
</Checkout>
);
}Every prop stays on <Checkout>; the regions take none. Without children, <Checkout> draws the
page above.
| Region | What it draws |
|---|---|
CheckoutExpress | The express buttons and their divider, while the Cart offers any. |
CheckoutDetails | Contact, shipping and address in one form, and after it what the checkout says of it. |
CheckoutPayment | Payment methods, the provider's field, the total, legal texts and the order button. |
CheckoutSummary | Lines and amounts, the discount code and the gift card. |
What the composition can rely on:
- The form's own order is yours too.
CheckoutDetailstakesCheckoutContact,CheckoutShipping,CheckoutAddressandCheckoutExtensionsas children, in your order and markup, and stays the one form. - A region shows when the checkout has something for it, wherever it stands.
CheckoutPaymentbefore a complete Cart draws nothing. - The checkout keeps its own panels. A waiting payment, an approval to review and the placed
order appear at the top of
<Checkout>, before your children. The form and the payment step leave while a panel shows; your own content stays. The root says which panel shows indata-panel="waiting"ordata-panel="review", so you can hide what should step back:.my-checkout[data-panel] .checkout-note { display: none; }. Once the order is placed and you pass noonOrdered, the confirmation replaces your children. - Nothing the buyer must hear is dropped. A notice that none of your regions shows, such as a
refused address on a page without
CheckoutDetails, stands at the top of<Checkout>. - Layout is yours. The root carries
data-composedand is one column in the checkout's own spacing. Wrap regions in your own elements to put them side by side. Beside the form or not, the summary is open from 48rem of checkout width and a disclosure below. - A page needs
CheckoutPaymentto order. Without it the console says so once the Cart is ready to pay. Leave outCheckoutDetailsonly where the Cart already has what it asks: its form is what saves the buyer's edits.
Regions must stand inside <Checkout>. after keeps working for content after a part of a
region, such as contact or order; between regions, write your content where you want it.
Run it in steps
<Checkout cart={cart} steps /> is the same checkout in three steps: contact, delivery, payment.
The buyer sees one step at a time, goes on with its button and back with "Change".
For your own steps, group the regions in CheckoutSteps. Inside a step the details come as their
own regions instead of CheckoutDetails:
import type { CommerceCart } from "@orbcart/client";
import {
Checkout,
CheckoutAddress,
CheckoutContact,
CheckoutExtensions,
CheckoutPayment,
CheckoutShipping,
CheckoutStep,
CheckoutSummary,
} from "@orbcart/react";
export function CheckoutPage({ cart }: { cart: CommerceCart }) {
return (
<Checkout cart={cart} onOrdered={(order) => window.location.assign(`/orders/${order.number}`)}>
<CheckoutStep name="contact" heading="Contact">
<CheckoutContact />
</CheckoutStep>
<CheckoutStep name="delivery" heading="Delivery">
<CheckoutShipping part="way" />
<CheckoutAddress />
<CheckoutShipping part="methods" />
<CheckoutExtensions />
</CheckoutStep>
<CheckoutStep name="payment" heading="Payment">
<CheckoutPayment />
</CheckoutStep>
<CheckoutSummary />
</Checkout>
);
}| Region | What it draws |
|---|---|
CheckoutContact | The email, the phone number where asked, and the offer to sign in. |
CheckoutShipping | Delivery or pickup, as one group or as its parts around the address. |
CheckoutAddress | The address that leads, and a checkbox to give the other one apart. |
CheckoutExtensions | The fields you ask. |
How steps behave:
- The Cart decides which steps are complete. A step is complete once the Cart's
missingnames nothing its regions ask. Nothing is stored beside the Cart: after a reload, and for a buyer whose Cart is filled already, the checkout opens at the first step that still lacks something. A Cart that lacks nothing opens at the payment. - Only the buyer moves between steps. "Continue" saves the step and leads to the first step that still lacks something. "Change" opens a complete one. A choice inside a step, such as pickup or a payment method that needs a phone number, never closes the step under them.
- A step saves by its button only, not when the buyer pauses or leaves a field. What they typed stays for the visit either way.
- An edit left unsaved is never ordered. A buyer who types a new address and then goes to another step finds it again at the order button: it leads back to the step with the edit, and orders once it is saved.
- What another step asks is said where the buyer is, with a button that leads there: a phone number the chosen payment method requires, or a field the runtime refused at the order. In that step the field is marked.
- The address is one block, placed where you want it.
CheckoutAddressis the address that leads, and under it a checkbox to give the other one apart. It asks a delivery address for a delivery and none once the buyer chooses pickup. - The shipping choice stands around the address.
<CheckoutShipping part="way" />is delivery or pickup, drawn only where the Cart offers pickup: before the address, so a buyer who picks up types no delivery address.<CheckoutShipping part="methods" />are the deliveries, such as standard and express: after the address, which decides them and their costs. Withoutpart,CheckoutShippingis the whole choice as one group of cards. - A step is a form. Your own markup can stand inside one, a
<form>of yours cannot. UseCheckoutDetailsonly on a page without steps. - A step with only optional fields is passed, since the Cart lacks nothing in it. Put an optional field in a step with something required, as the three steps do with the fields you ask.
- Panels stay the checkout's own. A waiting payment, an approval to review and the placed order take the steps' place, whichever step was open.
Each step carries data-state="current", "complete" or "upcoming" and data-checkout-step
with its name. The heading of the current one has aria-current="step" and takes the focus when
the buyer arrives. Override the three headings, "Continue" and "Change" in
labels.steps.
On the server a checkout in steps renders its headings; the open step follows once the page hydrates. For a page per step, see A checkout with a page per step.
Steps do not include a separate review page after the payment (a card field has to stay on the page until the order), a progress bar, a step the buyer cannot leave, or steps that change what the server asks.
Fields of your own
A Cart extension with ask appears in the details
after the address, with nothing to pass: a text field, a checkbox or a select, by its schema. The
label is the schema's title; labels.fields overrides it per extension, such as for another
language. A required one stops the form at that field until the buyer answers it.
For a control of your own, pass a component for that one extension and build it from Field:
import type { CommerceCart } from "@orbcart/client";
import { Checkout, Field } from "@orbcart/react";
import type { ExtensionFieldProps } from "@orbcart/react";
function VatIdField({ id, name, label, value, onChange, error, required }: ExtensionFieldProps) {
return (
<Field id={id} label={label} error={error}>
{(described) => (
<input
{...described}
name={name}
value={typeof value === "string" ? value : ""}
required={required}
onChange={(event) => onChange(event.currentTarget.value.toUpperCase())}
/>
)}
</Field>
);
}
export function CheckoutPage({ cart }: { cart: CommerceCart }) {
return <Checkout cart={cart} fields={{ vatId: VatIdField }} />;
}The checkout keeps the draft, the checks and the submission. A control of your own, here or in
deliveryAddress, owes the form three things:
- The name. Give the control the
nameit gets, the API's own key. A refusal marks and focuses the control of that name. - The wiring. Spread what
Fieldhands you onto the control: it names the control by its label and ties the error to it. A group of controls brings its ownfieldsetandlegend. - The edits. Report every change through
onChangeand save nothing yourself. No value and an empty text both leave the extension without one.
value is whatever the Cart holds, so narrow it before use: a schema you deployed earlier may have
accepted another shape.
Build your own UI
Need different markup? useCheckout({ cart }) gives you the same state and
actions as <Checkout>. Display its amounts; never calculate your own. Outside
React, the checkout store it runs on does the same:
A checkout without React.
Smaller building blocks are exported too: Cart, Line, OrderSummary,
ShippingChoice, DiscountCode, Changes, Money, Address and
ExpressCheckout for the bag.
Cart, Line and OrderPage take lineImage and lineTitle, your product
image and title for each Line, such as a link to the product's page. Both get
the reference and the Line itself, so two Lines of one product, such as one
service for two cars, each get their own: (reference, line) => ….
The lineImage slot reserves a 4rem-wide box, at least 4rem tall, even when
the callback returns nothing. Set --orbcart-line-image-size to change that
size, and size your own image to fit: its proportions, crop and corners are
yours. The box grows taller with its contents.
Those that hold state of their own have a matching hook, such as useLine() and
useDiscountCode(). Pass the bag's steps on as they are:
<Cart cart={bag.cart} onQuantityChange={bag.setQuantity} onRemove={bag.remove} />.
A change the runtime refuses, such as more than is in stock, is said under its
Line. A refusal of the whole cart, such as an order placed in another tab, is
never said at a line: bag.cart becomes the cart as it now is, so show what
fits it, such as the order once isSubmitted(bag.cart), as the demo's bag does.
In a handler of your own, refusesTheCart(error.problem) from
@orbcart/client tells the two apart. Totals shows the amounts of a quote, an
estimate or an order the way the checkout does, for markup of your own; with
compact it shows one amount, as a bag does, and notes what the total leaves
out, as the estimate's excludes says:
import { Totals } from "@orbcart/react";
<Totals
compact
totals={current.estimate.totals}
discounts={current.estimate.discounts}
pricesIncludeTax={current.estimate.pricesIncludeTax}
shipping={current.estimate.shipping}
excludes={current.estimate.excludes}
/>;<OrderPage order={order} /> shows a buyer their order after the purchase, from what
commerce.order(token) read. The order page →
A bank transfer or payment on site
is a choice like the others: the checkout names its terms instead of a payment
field, and the order button places the order at once. OrderPage then shows how to
pay. On an order page of your own, <OrderPayment order={order} /> shows the same:
the account with each value to copy, the amount still owed, the reference and the
date to pay by, or your words for paying on site, and that the order is paid once
it is.
What the buyer sees when things are slow
- 3-D Secure opens in a dialog above the page, also for wallets.
- A payment that takes longer than 10 seconds shows a calm waiting panel instead of the form. It asks the buyer not to order again and turns into the confirmation once the provider answers.
- A changed Quote shows what changed and asks again before charging.
Before going live
The kit is not a legally complete checkout yet. It links your legal texts at the order button and gives every buyer an order page; the withdrawal button is on the roadmap. Start in test mode.