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
Every element handle exposes a read-only.value getter that returns the current snapshot without waiting for an onChange fire. This is useful for stitching independent elements together (as in the example above, where email.value is read inside card’s onSubmit handler).