onSubmit fires when an element produces a submittable value. For inputs, it fires when you call element.submit() after validation passes. For wallet elements, it fires when the wallet sheet resolves and returns a walletToken. value is non-null by construction.
Payload
Example
Merchant-driven vs. self-driven
card,bank,email,fullName,phone,companyName, address elements, and custom elements are merchant-driven: you callelement.submit()(from a button click, a form submit, or an external CTA).applePayandgooglePayare self-driven: the wallet sheet triggersonSubmitdirectly when the shopper authorizes.checkoutcomposes both: card and bank submit through the internal button, wallets submit through their sheet.submitButtonis a relay: it firesonSubmitwithvalue: undefinedon every click. Use it to drive an externalcard.submit()orbank.submit()call.
Never call the payment gateway directly
For card and wallets,value is an authorize-ready payload (encrypted envelope for card, walletToken for wallets). Forward it to your server, which calls the Overflow authorize endpoint. Calling the payment gateway directly from the browser bypasses risk evaluation and the SDK’s payment-settings layer.
Do not return a promise expecting the SDK to await it
The contract is fire-and-forget. If you need request-in-flight UI, manage it in your own state:Checkout
Switch onvalue.method first; the per-method key is then non-null:
Wallets
TheonSubmit.value for wallets is:
require.email, require.name, and so on in the wallet options to ask the sheet for them. Keys the sheet did not return are omitted, never null.