edfapay_softpos_sdk 1.0.8
edfapay_softpos_sdk: ^1.0.8 copied to clipboard
Helps developers to easly integrate EdfaPay SoftPos to flutter mobile application with few simple steps.
1.0.8 #
First stable release of the 1.0.8 line (consolidates the 1.0.8-beta.* pre-releases). Native Android dependency bumped com.edfapay:sa-edfapay-revamp from 1.0.7.7 → 1.0.8.
New Features #
EdfaPayPlugin.updateSecurityChecks(config)— remote on/off switch for the SDK's device-security checks (root, emulator, hooking, NFC, internet, etc.). Same encrypted envelope format assetPartnerConfig.await EdfaPayPlugin.updateSecurityChecks(encryptedConfig);EdfaPayPlugin.Utils.securityThreats()/showSecurityStatus()— scan the device and get detected threat ids, or present the built-in Safe/Detected report screen.final threats = await EdfaPayPlugin.Utils.securityThreats(); // e.g. ["ROOTED_DEVICE"] await EdfaPayPlugin.Utils.showSecurityStatus();EdfaPayPlugin.configureHook(Hook, {encryptor})— register transaction/initialize webhooks via the chainableHookbuilder (mirrors the native API). The SDK POSTs{"data":"<payload>"}in the background (WorkManager, 5 retries at 1-minute intervals, internet-gated), addingX-Device-Id/X-Device-Timeheaders.encryptoroptionally transforms the base64 payload before sending.await EdfaPayPlugin.configureHook( Hook() .initiate('https://…/init') .transaction('https://…/txn'), encryptor: (data) => myEncrypt(data), );- Multi-profile phone login (
Extension) —loginWithPhone,selectUser, and a newonProfileSelectioncallback onverifyOtp. When a phone number maps to more than one merchant profile,verifyOtpreturns the list ofUserProfiles viaonProfileSelection(instead ofonSuccess); pick one and finish authenticating withselectUser. Adds theUserProfilemodel.await EdfaPayPlugin.Extension.loginWithPhone( phoneNumber: '+9665XXXXXXXX', location: location, onSuccess: (login) async { // login['sessionId'], login['otpExpireInSeconds'] await EdfaPayPlugin.Extension.verifyOtp( sessionId: login['sessionId'], otp: '123456', onSuccess: (session) {/* single-profile: logged in */}, onProfileSelection: (List<UserProfile> profiles) async { await EdfaPayPlugin.Extension.selectUser( sessionId: login['sessionId'], userId: profiles.first.userId!, otp: '123456', onSuccess: (session) {/* logged in as chosen profile */}, onError: (e) {}, ); }, onError: (e) {}, ); }, onError: (e) {}, );
Documentation #
- README: added "Device Security Checks & Threats", "Transaction & Initialization Webhooks", and "Phone Login & Multi-profile Selection" sections covering the APIs above, plus "Security Status" and "Configure Hook" buttons (with handlers and the
models/hook.dartimport) in the runnable example app.
1.0.7 #
Native Android dependency bumped com.edfapay:sa-edfapay-revamp from 1.0.6.4 → 1.0.7.7.
Breaking Changes #
-
BNPL API renamed to Invoice-based payment API. The BNPL-specific surface is now generic invoice checkout/refund:
// Before EdfaPayPlugin.buyNowPayLater(request: InvoiceRequest(...), onSuccess: (BnplResponse r) {...}, onError: ...); // Now EdfaPayPlugin.invoicePayment(request: InvoicePaymentRequest(...), onSuccess: (InvoicePaymentResponse r) {...}, onError: ...);buyNowPayLater()→invoicePayment().checkoutLinkApi()removed; addedinvoiceRefund(request: InvoiceRefundRequest(...), ...)for invoice refunds.InvoiceRequest→ split intoInvoicePaymentRequestandInvoiceRefundRequest.BnplResponse→InvoicePaymentResponse.
-
BnplProviderenum →PaymentMethod. Values are nowtamara,tabby,checkout,unknown,contactless(lowercase), with aPaymentMethod.from(String)factory that maps native names (TAMARA_POS,TABBY_POS,PAYMENT_GATEWAY→checkout,SOFT_POS→contactless).
New Features #
- Transaction search & status:
searchTxnApi(parameters, onSuccess, onError)andpgTxnStatusApi(sessionId, onSuccess, onError). - Online receipts (
Extension):generateOnlineReceipt(type, id, onSuccess, onError)(returns the receipt URL) andopenOnlineReceipt(type, id, onError)(opens it in the browser). AddsReceiptType { RECONCILIATION, TRANSACTION }. - Terminal unbinding:
Extension.unbindTerminal(onSuccess, onError). - Device-readiness helpers (
Utils) for reliable background reconciliation:- Notification (Android 13+):
haveNotificationPermission,requestNotificationPermission. - Exact alarms (Android 12+):
canScheduleExactAlarms,openExactAlarmSettings,requestExactAlarmPermission. - Battery unrestricted:
isBatteryUnrestricted,openBatteryUnrestrictedSettings,requestBatteryUnrestricted. - OEM autostart:
deviceNeedsAutostart,openAutostartSettings,requestAutostartPermission.
- Notification (Android 13+):
- Reconciliation notification sounds:
theme().setReconciliationNotificationSounds(success:, error:, processing:)accepting base64-encoded sound files. - API key credential:
EdfaPayCredentials.apiKeyfield and chainablesetApiKey(String). - Env: added
REVAMPandDEMOenvironments.
Improvements #
- Callback routing hardened: native callbacks are now routed by a unique per-invocation id instead of by method name, so concurrent/sequential calls to the same method (e.g. repeated
refund) no longer overwrite each other's handlers. initiate()now reportshostAppType: 'Flutter'to the native SDK.
Bug Fixes #
- Notification / location permission requests no longer crash at runtime.
Utils.requestNotificationPermission(andrequestLocationPermission) threwIllegalStateException: LifecycleOwner … is attempting to register while current state is RESUMEDbecause the native SDK registered the activity-result launcher lazily on tap. It now registers viaActivityResultRegistry(no lifecycle restriction) and unregisters on result. Ships with the nativesa-edfapay-revampupdate.
1.0.6 #
- Validate and fix all from 1.0.5
- Random Fixes
-
- Fixed Refund by fixing transaction date as TxnParams
-
[601] TMS Update Requiredhandling at any transaction,
- Native Android dependency:
com.edfapay:sa-edfapay-revamp:1.0.6.3
1.0.6+4 #
- Bumped native Android dependency
com.edfapay:sa-edfapay-revampfrom1.0.6.3→1.0.6.4. - Packaging: published archive included the
sample/app directory andedfapay-softpos-sdk-sample.zip(~47 MB). No Dart API changes. (Reverted in 1.0.6+5.)
1.0.6+5 #
- Packaging: removed the bundled
sample/app andedfapay-softpos-sdk-sample.zipfrom the published package, shrinking the archive back to ~84 KB. No Dart API or native dependency changes.
1.0.6+6 #
Transaction:withRRN()andwithTxnNumber()now defaulttypetoTransactionType.PURCHASE(previouslynull).Transaction.toMap(): renamed serialized keys to match the backend API —txnNumber→transaction_number,txnDate→created_date,type→operation_type. This is the fix behind "Fixed Refund by fixing transaction date", since refund/void reference an original transaction by these fields.
1.0.5 #
Breaking Changes #
-
TxnParams: Removed required
transactionTypeparameter. Transaction type is now inferred from the method called (purchase,refund, etc.).// Before TxnParams(amount: '10.00', transactionType: TransactionType.PURCHASE); // Now TxnParams(amount: '10.00'); -
Transaction.txnDate: Changed from
String?toDateTime?for type safety.// Before Transaction.withRRN('123456', txnDate: '2026-03-14'); // Now Transaction.withRRN('123456', DateTime.now()); -
Env enum: Removed
REVAMPenvironment. UseDEVELOPMENT,STAGING,SANDBOX, orPRODUCTION. -
Simplified Terminal Binding: Removed standalone
bindTerminal()method; terminal binding is now handled throughTerminalBindingTask.bind().
Major Architectural Update #
- Complete rewrite of the Dart-Native bridge, migrating away from legacy Pigeon platform channels to a direct MethodChannel approach for robust performance and exact alignment with Native SDK standards.
- Typed Models: Replaced generic and risky array structures with strongly-typed Dart models (
TxnParams,EdfaPayCredentials,Transaction,Pagination,Location). - Chainable Builders: Introduced chainable builders for
SdkThemeandPresentationConfigto mirror native implementation. - Callback Refactoring: Flutter side callbacks are now invoked directly with mapped
Function.applypayloads for seamless error handling and multiple parameter execution.
Massive API Expansion #
The previous versions of the SDK only exposed a fraction of the native capabilities (purchase, refund, reconcile, txnHistory, etc.). 1.0.5 directly maps every feature available in the Android Native SDK to Flutter.
- New Transaction Flows:
authorize,capture,changePin,activateCard,void,reverse,reverseLastTransaction, andtxnDetail. - New Session Management:
getSessionId,getSessionDetail,getSessionList,logoutCurrentSession, andlogoutSession. - New Reconciliation & Terminal Management:
reconciliationHistory,reconciliationDetail,reconciliationReceipt,terminalInfo,activateTerminal,deActivateTerminal, andsyncTerminal. - New Utilities & Extensions:
EdfaPayPlugin.Extension(initKernels,loginWithToken,getTerminalConfig,getUserInfo, etc.) andEdfaPayPlugin.Utils(getDeviceId,currentLocation,isLocationMocked, etc.).
New Features #
-
Terminal Binding Task: Added
TerminalandTerminalBindingTaskmodels for improved terminal binding workflow.EdfaPayPlugin.initiate( credentials: credentials, onSuccess: (sessionId) => print('Initialized'), onTerminalBindingTask: (task) { // Show native binding UI or bind programmatically task.bind(); // or task.bind(terminal: task.terminals.first); }, onError: (e) => print('Error: $e'), ); -
Extension.getUserInfo(): New method to retrieve current user information.
-
TxnParams.setOriginalTransaction(): New method to set original transaction reference for refund/capture operations.
-
BNPL (Buy Now Pay Later): Added
buyNowPayLater()method supporting Tamara and Tabby providers.EdfaPayPlugin.buyNowPayLater( request: BnplRequest( provider: BnplProvider.TAMARA, merchantId: 'merchant-id', amount: 11100, // in minor units (cents) currency: 'SAR', phoneNumber: '+966512345678', email: 'customer@example.com', orderReferenceId: 'ORD-111', orderNumber: '10111', invoice: BnplInvoice( total: 11100, lineItems: [ BnplLineItem(sku: 'SKU-001', description: 'Product', unitCost: 11100, quantity: 1, netTotal: 11100, total: 11100), ], ), additionalData: BnplAdditionalData(storeId: 'STORE-01'), ), onSuccess: (response) { // Launch response.checkoutDeeplink in browser print('Checkout URL: ${response.checkoutDeeplink}'); }, onError: (e) => print('Error: $e'), );
Improvements #
- ProcessCompleteCallback Type Alias: Transaction callbacks now use the
ProcessCompleteCallbacktype alias for cleaner method signatures. - SdkTheme.setPresentation(): Improved error messaging and internal code refactoring.
Bug Fixes & Maintenance #
-
Improved error stack trace handling in native bridge
-
Bug fixes and performance enhancements in MethodChannel communications
-
Code cleanup and formatting improvements
-
Documentation Reference: For full implementation details, see the EdfaPay SoftPOS SDK Documentation.
0.0.3 #
- Revamp version of sdk
0.0.4 #
- Revamp version of sdk
- fixes & enhancement
0.0.5 #
- Revamp version of sdk
- fixes & enhancement
1.0.0+2 #
- Revamp version of sdk.
- Fixes & enhancement.
- Fix terminal token login.
1.0.0+3 #
- Added ability to change presentation
- Presentation.FULLSCREEN
- Presentation.DIALOG_CENTER
- Presentation.DIALOG_TOP_FILL
- Presentation.DIALOG_BOTTOM_FILL
- Presentation.DIALOG_TOP_START
- Presentation.DIALOG_TOP_END
- Presentation.DIALOG_TOP_CENTER
- Presentation.DIALOG_BOTTOM_START
- Presentation.DIALOG_BOTTOM_END
- Presentation.DIALOG_BOTTOM_CENTER
// Usage: EdfaPayPlugin.theme() .setPresentation( Presentation.DIALOG_CENTER .sizePercent(0.85) // scale to width of screen 1.0 to 0.20 .dismissOnBackPress(true) .dismissOnTouchOutside(true) .animateExit(true) .animateEntry(true) .dimBackground(true) .dimAmount(1.0) // scale to 1.0 to 0.0 .marginAll(0) // open number .cornerRadius(20) // open number .marginHorizontal(10) // open number .marginVertical(10) // open number .setPurchaseSecondaryAction(PurchaseSecondaryAction.none) );
- Added ability enable Secondary/Post Purchase Transaction Action.
- PurchaseSecondaryAction.reverse
- PurchaseSecondaryAction.refund
- PurchaseSecondaryAction.none
// Usage: EdfaPayPlugin.theme() .setPresentation( Presentation.DIALOG_CENTER .setPurchaseSecondaryAction(PurchaseSecondaryAction.reverse) );
- Added ability to decide UI Flow Type at the time of transaction.
- FlowType.immediate
- FlowType.status
- FlowType.detail
// Usage: EdfaPayPlugin.pay( params, flowType: FlowType.detail, /* */ );
1.0.4 #
-
Added ability to enable/disable PIN PAD shuffles at Pin Transaction.
// Usage: EdfaPayPlugin.theme() .setPresentation( Presentation.DIALOG_CENTER .setShufflePinPad(true); // default false ); -
Added ability to start transaction from remote source (LocalNetwork).
- Note: Make sure to open RemoteChannel after successful SDK initialization.
// Usage: Make sure to open RemoteChannel after initialize successful EdfaPayPlugin.RemoteChannel.LocalNetwork(8080, 3.0).open();