createSetupIntent method
Creates a setup intent for collecting payment methods.
This endpoint creates a setup intent that can be used by the client to collect payment method details (e.g., card information) from the user. The setup intent is associated with the authenticated user's payment customer.
The client can use the returned PaymentSetupIntent to:
- Display a payment form to the user
- Collect payment method details (card number, expiry, etc.)
- Confirm the setup intent with the payment provider
- Save the payment method for future use
Returns a PaymentSetupIntent containing:
id: The setup intent IDclientSecret: Secret for client-side confirmationstatus: Current status of the setup intent
Throws NotFoundException if the user is not found or has no payment customer.
Implementation
_i2.Future<_i13.PaymentSetupIntent> createSetupIntent() =>
caller.callServerEndpoint<_i13.PaymentSetupIntent>(
'billing',
'createSetupIntent',
{},
);