createSetupIntent method

Future<PaymentSetupIntent> createSetupIntent()

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:

  1. Display a payment form to the user
  2. Collect payment method details (card number, expiry, etc.)
  3. Confirm the setup intent with the payment provider
  4. Save the payment method for future use

Returns a PaymentSetupIntent containing:

  • id: The setup intent ID
  • clientSecret: Secret for client-side confirmation
  • status: 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',
      {},
    );