Present checkout on Android
The Android SDK can present Afterpay checkout in four ways. Choose one based on how much of the checkout you want your server to own and which checkout features you need.
The SDK refers to the first three options by version: Web Redirect is Checkout V1, Built-in UI is Checkout V2, and the Afterpay Button is Checkout V3. The versions appear in SDK method names, such as createCheckoutV2Intent.
Before you present checkout
- Install the SDK.
- For Web Redirect, Built-in UI, and Cash App Pay, configure the SDK with your merchant configuration. Without it, checkout closes right away with a cancellation status. The Afterpay Button uses its own configuration, described on its page.
- Show a payment button that starts checkout when the customer taps it.
Server-side flow
Web Redirect and Built-in UI use the same flow. Your server creates the checkout with your merchant credentials, the SDK presents the checkout to the customer, and your server completes the payment. Your merchant credentials never leave your server.
Cash App Pay can use this flow too: your server creates the checkout, but Pay Kit sends the customer to Cash App instead of the SDK presenting checkout. For the steps, see Cash App Pay.
The Afterpay Button doesn’t use this flow. The SDK creates the checkout itself and returns a virtual card, which you process like any other card payment.