About the Flutter SDK
Integrate Atoa into your Flutter app in minutes using our dedicated SDK. Easily add seamless Pay by Bank payments to new or existing Flutter apps. The SDK is exclusive to Flutter (not native Android/iOS) and available on pub.dev, where developers are welcome to contribute and provide feedback.
Prerequisites
Before you start, ensure the following setup is complete:- Create an Atoa account: Sign up using our Business App or Web Dashboard.
- Generate API keys: Go to API Access inside the Atoa Business App and generate keys for Sandbox (testing) and Production (live).
- Backend readiness: You must be able to create a Payment Request on your backend server using Atoa APIs before calling the Flutter SDK.
1: Install the SDK
Run the following to add the Atoa SDK to your Flutter project2. Import the Package
3: Generate a Payment Request (Backend)
You can generate a payment using the payment-process API, which must be called from your server while creating an order. Refer to the getting started guide to know moreredirectUrl can be used to redirect the user back to your app after the payment is completed. Follow the information given in the handle redirection steps below
4. Launch the Payment Dialog
After obtaining a valid paymentRequestId, you can now invoke the Flutter SDK’s Pay method to show the checkout experience:Pass
customerDetails if available. It pre-selects the user’s previous bank
for faster checkout.SDK Parameters
CallBack Payload Reference
CallBack Payload Reference
Below are the payload structures you can expect inside each callback:
onError
Triggered when an error occurs during the payment processonPaymentStatusChange
Triggered when the payment status updates. Handle COMPLETED, PENDING and FAILED statuses.onUserClose
Triggered when the user closes the payment verification sheet5. Handle Payment Response
You can handle the payment success, failure, pending and other statuses based on payment response6. Handle Redirection (Deep link)
While calling payment-process API to generate a payment, you can specify a redirectUrl in your request body. The redirectUrl, which should be passed as body parameters, redirects to your website and then opens your app via deep linking. This enables users to open your application after payment. Following the completion of the payment by the customer’s bank app, they will be redirected back to their browser. Atoa will transmit the idempotency id, amount and redirect URL with status as query parameters appended to your specified Redirected URL, forming a URL structure like:Subscribe to webhook (Recommended)
Atoa uses webhooks to notify your application whenever an event happens in your account. Webhooks are particularly useful for events such as changes in payment status, such as completion, failure, or pending. To get started, you must Register your webhook endpoint so Atoa knows where to deliver events. After registration, your endpoint will start receiving detailed webhook payloads. These will inform you of payment status updates, such asCOMPLETED, PENDING, or FAILED.
Store Fields in Server
Store the following in your backend once the transaction is complete.7. Check Bank App Installation (Android/iOS Requirements)
Our mobile SDK checks if the bank(using for making payments) app is installed or not. For that, you need to add ‘queries’ tag for android and ‘LSApplicationQueriesSchemes’ key for iOSFor Android
For Android
In Android, you need to add ‘queries’ tag in
AndroidManifest.xmlFor iOS
For iOS
In iOS, you need to add ‘LSApplicationQueriesSchemes’ key in
Info.plist