PrimerCheckoutSheet collects a billing address on its card screen when your client session asks for one.
How the sheet collects a billing address
The client session controls the billing address section through itsBILLING_ADDRESS checkout module. Without that module, the sheet shows no billing fields. With it, the sheet shows each field the module turns on, below the card fields, under a “Billing address” heading. See Client session.
- Prefill. The sheet fills empty fields once from
customer.billingAddressin the client session. Later client session updates don’t overwrite what the shopper typed. - Validation. Each shown required field must have a value. When the shopper leaves a required text field empty, the field shows an error.
- Country. When the country field is shown, its row opens a country list in the sheet and the Pay button stays disabled until a country is chosen.
- Pay button. The sheet enables Pay only when both the card fields and the shown required billing fields are valid.
- Sending. The sheet sends the address to the native SDK while the shopper types, and once more right before it submits the card.
See also
PrimerCheckoutSheet
The prebuilt sheet that shows the billing address section.
PrimerCardForm
The card fields for a layout you build yourself.
Client session
Checkout modules and customer details, including the billing address.
Checkout data
ClientSession, Address and the other data objects.