Pattern
- Mount every element you need (contact fields, address, payment method).
- Gate an external submit control on each element’s
onChange.complete. - On submit, call
element.submit()on the payment-method element and forward itsonSubmitpayload to your server.
Example
Notes on submitButton
submitButton is a pure relay. It fires onSubmit with value: undefined on every click. Use it to drive an external card.submit() (or bank.submit()), or wire its onSubmit to your own submission logic. See the submitButton reference.
You do not have to use submitButton. A plain <button> outside the SDK works too:
Read values without waiting for events
Some elements expose a.value getter for reading their current snapshot without waiting for an event — contact atoms like email, address, bank, and the custom inputs. card, checkout, applePay, googlePay, and submitButton do not; read their state from onChange and onSubmit payloads.