Sale
Utilizing the doSale
Method in the PayContactless Embed SDK
doSale
Method in the PayContactless Embed SDKOverview: The doSale
method of the PayContactless Embed SDK is a pivotal function for executing transactions within merchant applications. Primarily, it is designed to process and receive payments.
Parameters:
Amount:
Description: Denotes the transaction's value as specified by the user.
Constraints:
Should be a whole number, with its length capped at 12 digits.
Exclude any separators or currency symbols.
Examples:
A payment amount of $100 should be conveyed as 10000, where the trailing two digits represent cents.
Conversely, $1.01 is represented as 101.
Description:
Description: Provides contextual information detailing the purpose or reason behind the payment. It could relate to the product/service name, a brief summary, or any relevant description the merchant deems necessary.
Currency Code
Description: The currecy value of the transaction. It has be numeric code of ISO 4217 format.
Examples:
566 for Naira instead of NGN
Activity
Description: The current activity. Payment page is started as a new activity. In order to start payment activity Embed SDK needs the current acitivity of the app.
RFU Map
Description: RFUMap (Reserved for future use) object is used to transfer key value pairs between backend system and merchant application
TransactionResultListener:
Description: This interface is vital as it captures and manages transaction outcomes, be it success or failure scenarios.
Usage: To implement the doSale
function in your application, ensure you're capturing the correct parameters, especially the format for the "Amount" and supplementing the necessary information in the "Description."
By adhering to these guidelines, you enable a precise and seamless transaction process, elevating the user experience within your application.
Please set empty map value for rfuMap instead of null on SDK version 3.4.11. This issue will be fixed with the next version.
If currency parameter is set null, the default currency is used for transaction. The default currecny is Naira in SDK.
When a transaction is completed, the TransactionResult class is received on onCompleted method, these class fields can be used for the payment result screens.
Transaction Listener
Transaction Result
Field Names | Field Descriptions | Values |
---|---|---|
Payment Type | return the data in which method in use for this transaction |
|
Status | result of the transaction request |
|
PayWithCardResult | Returns only after completing tap with card payment | |
PayWithLinkResult | Returns only after completing link payment | |
Error | Check 6.1 Error Handling section |
Transaction Data
Field Names | Descriptions | Sample Values |
---|---|---|
type | type of the transaction | 'PAYMENT' |
amount | using amount value in the transaction | '150000' |
code | a unique code of the transaction. It is used for finding the transaction. | '1D9F9EE737CE1262' |
date | transaction date “yyyymmdd” | '20220823' |
time | transaction time “hhmmss” | '080905' |
respCode | Response Code of the transaction | '00' |
respDesc | Response Description of the transaction | 'Success' |
rrn | Reference Retrieval Number of the transaction | '202208230809' |
authCode | Authorization Code of transaction | '080905' |
stan | System Trace Audit Number of the transaction | '15590' |
cardNumber | masked pan of the card using in the transaction | '************6375' |
cardType | type of the card using in the transaction | 'CREDIT' |
cardBrand | brand of the card using in the transaction | 'VISA' |
aid | Application Identifier of the card using in the transaction | 'a0000000031010' |
isPinUsed | is pin used in this transaction or not | false |
rfuList | RFUList (Reserved for future use) object is used to transfer key value pairs between backend system and merchant application |
Last updated