EdfaPay Payment Gateway SDK
A production-grade Kotlin Multiplatform payment SDK for Android and iOS, with a matching Flutter plugin. One codebase delivers a Compose Multiplatform checkout experience, native Apple Pay, the full transaction lifecycle (authorise, capture, refund, void, recurring), external providers (tabby, tamara, checkout, SADAD), and 3-D Secure 2 — all through a single entry point: EdfaPgSdk.
Overview
The EdfaPay Payment Gateway SDK is built on **Kotlin Multiplatform**: shared Kotlin business logic, UI, and networking, with native bindings for Android (Maven Central) and iOS (CocoaPods, Swift Package Manager, XCFramework). A thin Flutter plugin bridges the same native SDK to Dart, so all three platforms share one behaviour and one API shape. Everything you need — the drop-in checkout UI, direct (headless) sales, Apple Pay, post-sale operations, external providers, and ledger queries — is reached through a single entry point, `EdfaPgSdk`, plus a focused set of public data models.
One SDK, three surfaces
The KMP module (edfapay-pg-sdk-kmp) is the source of truth for all payment logic; the Flutter plugin (edfapay-pg-plugin-flutter) is a generic RPC bridge with no business logic. Android uses Kotlin, iOS uses Swift, Flutter uses Dart — the method names and data models line up across all three.
Supported Platforms
System Requirements
| Requirement | Value |
|---|---|
| Minimum SDK | 24 (Android 7.0) |
| Verified | API 36 |
| Toolchain | JVM 17, Kotlin 2.3, Jetpack Compose |
| Artifact | com.edfapay.pg:sdk:<version> (Maven Central) |
| UI requirement | Jetpack Compose (ComponentActivity + setContent) for the bundled UI |
Highlights
The SDK keeps a small surface area while covering the full payment lifecycle.
Drop-in Checkout UI
Themeable Compose Multiplatform card-input flow — three pre-built designs, English / Arabic, with built-in 3-D Secure 2 WebView handling.
Headless Mode
Already have a checkout? Go straight to EdfaPgSdk.sale(...) with your own card capture.
Apple Pay, Natively
Wired to PKPaymentAuthorizationViewController — you bring the merchant ID, the SDK drives the sheet and the decrypted-payload sale.
Full Lifecycle
Authorise, capture, refund, void, and recurring / MIT charges through a single coroutine-friendly API.
External Providers
One unified externalPayment call routes to tabby, tamara, hosted checkout, or SADAD via an enum.
Ledger Queries
Paginated transaction search plus single-row helpers by UUID, merchant orderId, or RRN.
Security-first Logging
Curl-style request logs with API key, PAN (last-4 preserved), CVV, and recurring-token redaction — opt-in.
Coroutine / Async Friendly
suspend functions on Kotlin, async/await on Swift, and Future-returning calls on Dart.
Public API Surface
The entire public API is reached through EdfaPgSdk and the CardPay builder it hands you. All transaction calls are asynchronous — invoke from a coroutine on Android, a Swift Task on iOS, or await the returned Future on Flutter.
| Group | Entry point |
|---|---|
| Lifecycle | initialize(apiKey, baseUrl) · reinitialize(...) · enableLogs / setEnableLogs(...) |
| Bundled card-pay UI | EdfaPgSdk.CardPay() / cardPay() … initialize(onDismiss) / start() |
| Direct sale | EdfaPgSdk.sale(SaleRequest) |
| Apple Pay | EdfaPgSdk.applePay(ApplePayRequest) |
| Post-sale operations | void(id) · capture(id, amount) · refund(id, amount) · recurring(RecurringRequest) |
| External payments | externalPayment(ExternalPaymentRequest) — tabby / tamara / checkout / SADAD |
| Query | getTransactions(filter) · getTransactionById(id) · getTransactionByOrderId(orderId) · getTransactionByRrn(rrn) |
Quickstart
Initialise the SDK and take your first SAR 1.00 sale in under five minutes. Full setup is in the Installation and Initialization guides.
Loading...Ready to integrate?
Head to the Installation guide for platform-by-platform setup, then Initialization to wire up your API key and base URL.
On this page
Downloads
Coming SoonSample apps, release bundles, and more content will be available here soon.