SDK API Reference
Using the Account Base PayContactless Embed SDK Library
Before accessing the functions within the PayContactless Embed SDK library, there are a few steps to follow:
Initialization: Begin by calling the
initialize
method.
A sample method is highlighted below;
Where context (application context).
Then you can retrieve the initialized instance as follows:
Class & Method Overview
CustomerInfo Data Class
The CustomerInfo
data class is used to encapsulate customer details required for transactions. Below is a breakdown of each parameter:
Parameter
Type
Description
organizationId
Int
The assigned merchant organization ID. it represents the merchant's specific organization.
firstName
String
Customer's first name.
lastName
String
Customer's last name.
region
String
The customer's state or major region (e.g., "Lagos").
subRegion
String
A more specific area within the region (e.g., "Eti-Osa").
emailAddress
String
Customer's email address for communication.
accountNumber
String
The customer's bank account number used for transaction processing.
phoneNumber
String
Customer’s phone number (must be in international format, e.g., +2348067500250
).
bvn
String
Bank Verification Number (BVN) for customer identification.
bankCode
String
The unique identifier of the customer’s bank (e.g., "22998"
).
pin
String
Verified PIN for transactions.
address
String
The customer’s residential or business address.
Example Usage:
Start a Transaction
To start a transaction, call startTransaction()
from the SDK with the following parameters. It launches the payment UI for transaction processing.
Parameter
Type
Description
apiKey
String
The authentication key assigned to the merchant for secure transactions.
customerInfo
CustomerInfo
An object containing customer details (see table above).
activity
Activity
The current activity from which the SDK is launched.
launcher
ActivityResultLauncher<Intent>
A launcher to handle transaction results asynchronously.
Downloading a Receipt
Fetches a receipt for a transaction.
Parameter
Type
Description
transactionId
Int
ID of the transaction.
phoneNumber
String
Customer’s phone number
orgId
Int
Organization ID.
listener
DownloadReceiptListener
Callback interface for receipt download success or failure.
Example Usage:
Update Pin
Updates the user’s transaction PIN.
Parameter
Type
Description
updatePinRequest
UpdatePinRequest
Object containing PIN update details.
listener
UpdatePinListener
Callback interface for success or failure.
Example Usage:
Get Transaction History
Retrieves a list of user transactions.
Parameter
Type
Description
page
Int
Page number for pagination. e.g 0
size
Int
Number of transactions per page. e.g 10
phoneNumber
String
Customer’s phone number.
orgId
Int
Organization ID.
transactionId
Int?
(Optional) Specific transaction ID filter.
startAmount
Int?
(Optional) Minimum transaction amount filter.
endAmountTo
Int?
(Optional) Maximum transaction amount filter.
startDate
String?
(Optional) Start date filter, format DD-MM-YYYY
endDate
String?
(Optional) End date filter, format DD-MM-YYYY
listener
TransactionHistoryListener
Callback for transaction history retrieval.
Get Transaction Detail
Retrieves details of a specific transaction.
Parameter
Type
Description
transactionId
Int
ID of the transaction.
phoneNumber
String
Customer’s phone number.
orgId
Int
Organization ID.
listener
TransactionDetailListener
Callback interface for transaction details.
Troubleshooting & FAQs
1. Why am I getting "SDK not initialized" error?
Ensure you call PayContactlessCustomerSDK.initialize(context)
in your Application
class before calling getInstance()
.
2. Why is Bluetooth connection failing?
Ensure Bluetooth and Location permissions are granted.
3. Why is downloadReceipt()
not returning data?
downloadReceipt()
not returning data?Check your network connectivity and ensure the correct transaction ID is passed.
Last updated