Overview
If you need more control over the checkout experience than the managed checkout flow provides, you can use the SDK’s payment flow and payment authorization APIs independently. This lets you:
- Collect a payment method: Present the Bolt payment UI to tokenize a credit/debit card.
- Authorize the payment: Charge the tokenized card against an order token on your terms.
This approach is useful when you want to tokenize and store a card for later use, or build a fully custom checkout UI around Bolt’s payment infrastructure.
Complete Example
Step-by-Step Breakdown
1. Register the Payment Flow Launcher
Register an ActivityResultLauncher in your activity’s onCreate():
2. Launch the Payment Flow
Present the Bolt payment UI to collect and tokenize a card:
On success, onPaymentFlowSuccess is called with a BoltCreditCard containing the tokenized card details (token, last4, network, expiration, postal code).
3. Authorize the Payment
Once the user confirms in your custom UI, authorize the charge:
If authorizePayment() is called before a card has been tokenized via the payment flow, onPaymentAuthorizationError fires immediately with an explanatory message.
Payment Flow Callbacks
See the full BoltPaymentFlowDelegate reference.
Payment Authorization Callbacks
See the full BoltPaymentAuthorizationDelegate reference.