EdfaPay Logo

Payment Operations

The SDK supports a full range of payment operations including purchases, pre-authorizations, captures, refunds, voids, and reversals.

Transactions

We support the following types of transactions. Please note that support for authorization, capture, and void operations may vary depending on the country, card issuer, and specific business rules.

Transaction Parameters

Updated v1.0.5

The TxnParams class holds all parameters for a transaction:

Loading...
TypeDescriptionRequires OriginalForce PIN
PURCHASEStandard sale transactionNoNo
AUTHORIZEPre-authorization (hold funds)NoNo
CAPTURECapture pre-authorized amountYesNo
REFUNDRefund a previous purchaseYesNo
VOIDVoid unsettled transactionYesNo
REVERSALReverse/cancel a transactionYesNo
CASHBACKPurchase with cashbackNoNo
CHANGE_PINPIN change operationNoYes
CARD_ACTIVATIONActivate a new cardNoYes

Flow Types

Control the UI flow during transaction processing:

FlowTypeDescriptionUse Case
IMMEDIATEMinimal UI, quick processingBackground transactions
STATUSShows transaction status onlySimple feedback
DETAILFull transaction details and receiptDefault experience

Purchase

Process a standard sale transaction:

Loading...

Understanding isFlowComplete

Updated v1.0.5

The onPaymentProcessComplete callback fires up to 3 times — the exact number depends on the FlowType you passed:

Call #When it firesisFlowCompleteFlowType(s)
1stImmediately after server response receivedtrueIMMEDIATE (only call)
1stImmediately after server response receivedfalseSTATUS, DETAIL
2ndStatus tick / success animation displayedfalseDETAIL only
2nd / 3rdTransaction detail screen closed by usertrueSTATUS, DETAIL

Best Practice

Always gate post-payment actions (navigate to receipt, update UI, fulfil order) on isFlowComplete === true. For FlowType.IMMEDIATE this is the 1st call; for DETAIL it is the 3rd call after the detail screen closes.

Authorize (Pre-Authorization)

Hold funds without capturing. Used for hotel bookings, car rentals, etc. The authorized amount can be captured later:

Loading...

Authorized transactions must be captured within 7-30 days depending on the card network. Uncaptured authorizations will automatically expire and release the held funds.

Capture

Capture a previously authorized amount. The capture amount can be less than or equal to the authorized amount:

Loading...

Refund

Refund a previously completed purchase. Supports both full and partial refunds:

Loading...

Void

Void an unsettled transaction. Only works for transactions from the current batch/day before settlement:

Loading...

Reverse

Reverse a transaction. Typically used when a transaction needs to be undone due to timeout or error during original processing:

Loading...

Reverse Last Transaction

New in v1.0.5

Convenience method to reverse the most recent transaction without needing to provide the original transaction details. The transaction must be reversible (not already reversed or voided):

Loading...

TxnResponse Model

Response object returned by void and reverse operations:

PropertyTypeDescription
codeStringResponse code from server
typeStringResponse type
messageStringResponse message
transactionTransactionAssociated transaction details
Loading...