Payment Gateway Mobile SDKs

Integrate DigetPay into your mobile application using our SDKs for Flutter and native Android.

Both SDKs support DigetPay's hosted checkout flow, allowing customers to complete their payment through a DigetPay-hosted payment page while your application receives the final payment result.

Choose Your SDK

SDKPlatformCurrent VersionMinimum Support
Flutter SDKAndroid / iOS0.5.0Android 7.0 / iOS 13.0
Android Native SDKAndroid1.0Android API 24

Choose the SDK that matches your application:

  • Flutter — Use the Flutter SDK for applications built with Flutter.
  • Android Native — Use the Android SDK for native Android applications built with Kotlin or Java.

Flutter SDK

The DigetPay Flutter SDK is a pure-Dart package that provides a hosted checkout experience through a WebView. It supports Android and iOS applications.

Quick Start

Initialize the SDK once when your application starts:

DigetPaySdk.initialize(
apiKey: '

Launch a hosted checkout:

await DigetPaySdk.cardPay()
.setOrder(
DigetPaySaleOrder(
id: orderId,
description: 'Coffee',
currency: 'SAR',
amount: 15,
),
)
.setPayer(payer)
.onTransactionSuccess((res) {tionId}');
)
.onTransactionFailure((res) {neReason}');
)
.onDismiss(() {
cancelled');
)
.start(context);

The SDK reports the payment outcome through the success, failure, or cancellation callbacks.

Full Flutter documentation: digetpay_plugin on pub.dev

Android Native SDK

The DigetPay Android SDK provides native Android integration for hosted checkout, payment operations, recurring payments, and transaction handling.

It supports both Kotlin and Java, with Android API 24 or later.

Quick Start

Initialize the SDK once when your application starts:

DigetPay.initialize(
context = this,
config = DigetPayConfig(
apiKey = "YOUR_API_KEY",
environment = Environment.SANDBOX,
enableLogging = BuildConfig.DEBUG
)
)

Launch a hosted checkout:

DigetPay.checkout(
activity = this,
request = CheckoutRequest(
merchantOrderId = "ORDER-123",
amount = 125.0,
currency = "SAR",
customerName = "Ahmed Ali",
customerEmail = "[email protected]",
customerPhone = "+966501234567"
),
callback = object : PaymentCallback {

override fun onSuccess(result: PaymentResult) {
actionId.

override fun onFailure(error: PaymentError) {

override fun onCancelled() {
checkout screen.

}
)

The SDK handles the hosted checkout flow and returns the final outcome through PaymentCallback.

Full Android documentation: DigetPay Android SDK

Recommended Payment Flow

For most mobile applications, Hosted Checkout is the recommended payment flow:

  1. Initialize the SDK with your mobile API key and environment.
  2. Create and launch a checkout.
  3. Let the customer complete the payment through DigetPay-hosted checkout.
  4. Handle the success, failure, or cancellation result returned by the SDK.
  5. Store the relevant payment identifiers on your backend.
  6. Verify the final transaction status before fulfilling the order.

Do not rely only on the visual success page to confirm a payment. For critical order state, verify the final transaction status using the appropriate DigetPay status API or server-side mechanism.

SDK Capabilities

Both SDKs are designed around DigetPay's payment services, while the exact capabilities depend on the platform and SDK version.

CapabilityFlutterAndroid
Hosted Checkout✓✓
Card Payments✓✓
3-D Secure✓✓
Transaction Status✓✓
Refunds✓✓
Capture / Void✓✓
Recurring Payments✓✓
Transaction History✓✓

For platform-specific capabilities and API details, see the full SDK documentation.

Versioning & Compatibility

Flutter SDK

RequirementSupported Version
Current SDK version0.5.0
AndroidAndroid 7.0+
Android API24+
iOSiOS 13.0+
LanguageDart
PlatformsAndroid / iOS

The Flutter SDK is a pure-Dart package and uses standard Flutter WebView and networking components. Flutter Web and desktop are not supported in the current version.

Android Native SDK

RequirementSupported Version
Current SDK version1.0
Minimum Android SDKAPI 24
Android versionAndroid 7.0+
Recommended Compile SDK36
Kotlin2.0+
Java target11
LanguagesKotlin / Java

Version and compatibility requirements may change with future releases. Always check the platform-specific documentation before upgrading your SDK.

Security

Mobile SDK credentials are embedded in the application and may potentially be extracted.

Use a restricted or publishable mobile API key intended for client-side use. Never embed server-side secrets or privileged credentials in your mobile application.

For card payments, prefer Hosted Checkout whenever possible. Raw card data does not pass through your application when using the hosted checkout flow, helping keep your PCI-DSS scope smaller.

Sensitive operations and business logic should be handled by your backend.

Next Steps


Did this page help you?