Hosted Checkout Flow¶
In this guide
How hosted checkout works end-to-end, when to choose it, and how to build and handle the request.
Recommended for most apps
Hosted checkout keeps card data off your app entirely, which minimizes your PCI DSS scope. Start here unless you have a specific reason not to.
Hosted checkout is the safest default flow for most Android apps because the payment page is hosted by DigetPay.
sequenceDiagram
participant App as Merchant App
participant SDK as DigetPay SDK
participant API as DigetPay API
participant Page as Hosted Checkout
App->>SDK: DigetPay.checkout(activity, request, callback)
SDK->>API: Create checkout session
API-->>SDK: redirectUrl + session id
SDK->>Page: Open checkout screen
Page-->>SDK: Redirect to success/failure URL
SDK->>API: Verify payment status
SDK-->>App: PaymentCallback result
When to Use It¶
Use hosted checkout when:
- You want the fastest production integration.
- You do not want to collect card data inside the app.
- You want the SDK to handle the checkout screen and result routing.
Request¶
Result Handling¶
PaymentCallback invokes exactly one method:
onSuccesswhen the payment completes successfully.onFailurewhen payment fails, is declined, or the SDK cannot complete the request.onCancelledwhen the user closes the checkout screen before finishing.
Tip
Do not rely only on the visual success page for critical order state. Store the IDs and verify status from your backend or through getTransactionStatus().