EdfaPay Logo

API Reference

The public methods and properties of EdfaPayPlugin, with parameters in the order the SDK declares them. Use this as a quick lookup for method signatures, parameters, and return types.

EdfaPayPlugin

The primary singleton for all SDK operations. Kotlin: EdfaPayPlugin. Java: the static facade EdfaPayPluginJ (for example EdfaPayPluginJ.purchase(...)); the methods it does not wrap (updateSecurityChecks, configureHook, invoicePayment, invoiceRefund, txnDetailApi, searchTxnApi, pgTxnStatusApi) are called on EdfaPayPlugin.INSTANCE, and the SDK_VERSION_CODE property is read with EdfaPayPlugin.INSTANCE.getSDK_VERSION_CODE(). Signatures below are Kotlin; ? marks a parameter you may pass as null.

Initialization & Authentication

MethodDescription
initiate(context: FragmentActivity, credentials, onSuccess: (sessionId) -> Unit, onTerminalBindingTask, onError)Initialize the SDK with credentials. All three callbacks are required; onTerminalBindingTask receives a TerminalBindingTask when no terminal is bound (see Initialization)
setPartnerConfig(config: String)Set encrypted partner configuration (must call before initiate)
updateSecurityChecks(config: String)Apply an encrypted configuration from EdfaPay that turns the SDK's device-security checks on or off; applies to later scans
configureHook(context, hook: Hook, encryptor)Register the transaction and initialization webhooks (see Utility Functions, Transaction & Init Webhooks)
theme()Returns SdkTheme for chained configuration

Payment Operations

MethodDescription
purchase(activity?, flowType = DETAIL, txnParams, onRequestTimerEnd, onCardScanTimerEnd, onError, onPaymentProcessComplete, onCancelByUser)Process a purchase. onPaymentProcessComplete receives (status, code, transaction, isFlowComplete)
authorize(activity, flowType = DETAIL, txnParams, onRequestTimerEnd, onCardScanTimerEnd, onError, onPaymentProcessComplete, onCancelByUser)Coming soon. Start a pre-authorization
capture(activity, flowType = DETAIL, txnParams, onRequestTimerEnd, onCardScanTimerEnd, onError, onPaymentProcessComplete, onCancelByUser)Coming soon. Capture an authorized amount (originalTransaction: the AUTHORIZE transaction)
refund(activity, flowType = DETAIL, txnParams, onRequestTimerEnd, onCardScanTimerEnd, onError, onPaymentProcessComplete, onCancelByUser)Refund a prior purchase (originalTransaction: the PURCHASE transaction)
reverseLastTransaction(activity?, onSuccess: (TxnResponse) -> Unit, onError)Reverse the last transaction the SDK stored, if it is a purchase that finished less than 60 seconds ago. To cancel an older payment, use refund
changePin(activity?, flowType = DETAIL, parameters: List<String>, onRequestTimerEnd, onCardScanTimerEnd, onError, onProcessComplete, onCancelByUser)Coming soon. Initiate a PIN change flow (see Card Management)
activateCard(activity?, flowType = DETAIL, parameters: List<String>, onRequestTimerEnd, onCardScanTimerEnd, onError, onProcessComplete, onCancelByUser)Coming soon. Activate a new card (see Card Management)
invoicePayment(request: InvoicePaymentRequest, onSuccess: (InvoicePaymentResponse) -> Unit, onError)Start an invoice payment (BNPL or Checkout). Needs an API key in EdfaPayCredentials
invoiceRefund(request: InvoiceRefundRequest, onSuccess: (InvoicePaymentResponse) -> Unit, onError)Refund an invoice payment. Needs an API key in EdfaPayCredentials

Terminal Management

MethodDescription
terminalInfo(onSuccess, onError)Get current terminal info
activateTerminal(password?, onSuccess, onError)Activate the terminal
deActivateTerminal(password?, onSuccess, onError)Deactivate the terminal
syncTerminal(onSuccess, onError)Sync terminal config with server

Session Management

In Flutter, getSessionId(), getSessionDetail() and getSessionList() return a Future, and in React Native a Promise: use await, for example final id = await EdfaPayPlugin.getSessionId(); (Flutter) or const id = await EdfaPayPlugin.getSessionId(); (React Native).

Method / PropertyReturn TypeDescription
getSessionId()String? (Future in Flutter, Promise in React Native)Current session ID; null when no session is loaded
getSessionDetail()SessionDetail? (Future in Flutter, Promise in React Native)Detail of the current session: sessionId, email, tsn, terminalId, merchantId
getSessionList(context)List<SessionDetail?> (Future in Flutter, Promise in React Native)All sessions stored on this device
logoutCurrentSession(context, onSuccess: (Boolean) -> Unit, onError?)UnitRemove the current session's stored data
logoutSession(context, sessionId, onSuccess: (Boolean) -> Unit, onError?)UnitRemove a stored session by ID

Transaction History

MethodDescription
txnHistory(pagination?, onSuccess: (List<Transaction>) -> Unit, onError)Retrieve paginated transaction list
txnDetail(txnId, onSuccess: (Transaction) -> Unit, onError)Get full details of a single transaction
txnDetailApi(txnId, onSuccess: (TransactionApi) -> Unit, onError)Transaction detail from the EdfaPay API. Needs an API key in EdfaPayCredentials
searchTxnApi(params: Map<String, Any?>, onSuccess: (List<TransactionApi>) -> Unit, onError)Search transactions in the EdfaPay API. Needs an API key in EdfaPayCredentials
pgTxnStatusApi(sessionId, onSuccess: (PgTxnStatus) -> Unit, onError)Payment-gateway transaction status. Needs an API key in EdfaPayCredentials

Reconciliation

MethodDescription
reconcile(onSuccess: (Reconcile) -> Unit, onError)Trigger end-of-day settlement
reconciliationHistory(pagination?, onSuccess: (List<ReconciliationHistory>) -> Unit, onError)List of past reconciliation records
reconciliationDetail(id, onSuccess: (ReconciliationDetail) -> Unit, onError)Full detail of a reconciliation record
reconciliationReceipt(id, onSuccess: (ReconciliationReceipt) -> Unit, onError)Generate printable receipt

Properties

PropertyTypeRead/WriteDescription
enableLogsBooleanR/WTurn on SDK logging (default false). Logs may contain sensitive data. Turn on enableLogs only on test devices, never in builds you share.
animationSpeedXFloatR/WAnimation speed multiplier (default 1.0)
SDK_VERSIONStringRead-onlySDK version with a v prefix, for example v1.0.8
SDK_VERSION_CODEStringRead-onlyBuild date and time of the SDK (ddMMyyyyHHmm)
SDK_VERSION_TIMESTAMPStringRead-onlyv followed by the build time in milliseconds
PARTNERStringRead-onlyBuild flavour of the artifact

Data Models

Key model classes used throughout the SDK. In Flutter/RN/Xamarin, complex models are returned as Map<String, dynamic> or JSON.

Transaction

Kotlin, Java (field)Flutter, React Native (map key)TypeDescription
rrnrrnString?Retrieval Reference Number
transactionNumbertransaction_numberString?Unique transaction number
amountamountStringTransaction amount
operationTypeoperation_typeString?Raw transaction type; use transactionType() for the TransactionType enum (PURCHASE, REFUND, etc.)
statusstatusStringTransaction status from the server
authCodeauth_codeString?Bank authorization code
cardNumbercredit_numberStringMasked PAN (e.g., **** **** **** 1234)
formattedSchemeformatted_schemeString?Card scheme label
createdDatecreated_dateStringCreation date as sent by the server
tsntsnStringTerminal Serial Number (terminal that processed the transaction)
merchantIdmerchant_idString?Merchant ID

TxnParams

TxnParams(amount, orderId = null, originalTransaction = null). You do not set the transaction type: each operation (purchase, authorize, capture, refund) sets its own.

FieldTypeRequiredDescription
amountStringYesTransaction amount as a string (e.g., "100.00")
orderIdString?NoCustom order reference ID, sent with purchase requests. If you leave it out, the SDK uses the transaction ID it generates
originalTransactionTransaction?Conditionalcapture: the AUTHORIZE transaction; refund: the PURCHASE transaction. Not used by purchase and authorize

Pagination

Pagination(pageNumber = 0, sortOrder = DESCENDING, pageSize = 50, sortBy = CREATED), package com.edfapay.paymentcard.model.requests. Pass it to txnHistory and reconciliationHistory; without it the request is sent without paging fields. In Java, use new Pagination() for the defaults or pass all four values in this order.

FieldTypeDescription
pageNumberIntPage number (default 0)
pageSizeIntItems per page (default 50)
sortOrderPagination.SortASCENDING or DESCENDING (default DESCENDING)
sortByPagination.FieldCREATED (default)

Enums

EnumValues
TransactionTypePURCHASE, AUTHORIZE, CAPTURE, REFUND, REVERSAL, VOID, CASHBACK, CHANGE_PIN, CARD_ACTIVATION (returned by Transaction.transactionType(); each operation sets its own type)
FlowTypeIMMEDIATE, STATUS, DETAIL
EnvDEMO (integration and testing, never charges a card), PRODUCTION (live payments). SANDBOX: legacy, do not use
PresentationFULLSCREEN, DIALOG_CENTER, DIALOG_TOP_FILL, DIALOG_TOP_START, DIALOG_TOP_END, DIALOG_TOP_CENTER, DIALOG_BOTTOM_FILL, DIALOG_BOTTOM_START, DIALOG_BOTTOM_END, DIALOG_BOTTOM_CENTER
PurchaseSecondaryActionNONE, REVERSE, REFUND
PaymentMethodTAMARA, TABBY, CHECKOUT (used by invoicePayment), CONTACTLESS (card payments; invoicePayment does not accept it)
PluginExtension.ReceiptTypeTRANSACTION, RECONCILIATION (online receipts, see Utility Functions)

Imports (Kotlin and Java)

Packages of the classes the samples use. Every package starts with com.edfapay.paymentcard.

ClassPackage
EdfaPayPlugin, EdfaPayPluginJ, PluginUtils, EdfaExceptioncom.edfapay.paymentcard
TxnParams, EdfaPayCredentials, TerminalBindingTask, SessionDetail, TransactionType, EdfaErrorcom.edfapay.paymentcard.model
Env, FlowType, PurchaseSecondaryActioncom.edfapay.paymentcard.model.enums
Paginationcom.edfapay.paymentcard.model.requests
Transaction, TxnResponsecom.edfapay.paymentcard.model.responses
Presentationcom.edfapay.paymentcard.ui.presentation