SDK APIs
SDK APIs
SSMPOSSDK
This section documents the public API that the app could use for attestation, and transaction purposes.
init
This method initializes the Fasstap™ MPOS SDK, with the sent in configurations.
init(Context context, SSMPOSSDKConfiguration configuration)
PARAMETER
context | Context Context of the caller class. |
configuration | SSMPOSSDKConfiguration SSMPOSSDKConfiguration object that contains all the configuration information to configure the Fasstap™ MPOS SDK. |
RETURN VALUE
SSMPOSSDK | Singleton object that represents Fasstap™ MPOS SDK. |
Context context = getApplicationContext();
SSMPOSSDKConfiguration config = SSMPOSSDKConfiguration.Builder.create()
.setAttestationHost(BuildConfig.ATTESTATION_HOST)
.setAttestationHostCertPinning(BuildConfig.ATTESTATION_CERT_PINNING)
.setAttestationHostReadTimeout(10000L)
.setAttestationRefreshInterval(300000L)
.setAttestationStrictHttp(true)
.setAttestationConnectionTimeout(30000L)
.setLibGooglePlayProjNum("757874674469") // use own google play project number
.setLibAccessKey(BuildConfig.ACCESS_KEY)
.setLibSecretKey(BuildConfig.SECRET_KEY)
.setUniqueID(edtUserID.getText().toString()) // please set the userID shared by Soft Space
.setDeveloperID(edtDeveloperID.getText().toString())
.setEnvironment(BuildConfig.FLAVOR_environment.equals("uat") ? Environment.UAT : Environment.PROD)
.build();
SSMPOSSDK.init(context, config);
getInstance
This method returns the initialized SSMPOSSDK singleton. Please do make sure init
is called prior to calling this method, IllegalStateException
shall be thrown if otherwise.
getInstance()
RETURN VALUE
SSMPOSSDK | Singleton object that represents Fasstap™ MPOS SDK. |
getTransaction
This method returns the Transaction
representation object that can be used to handle transactions upon Fasstap™ MPOS SDK initialized successfully.
getTransaction()
RETURN VALUE
Transaction | Transaction object that’s used to handle transaction related operations. |
hasRequiredPermission
Check if the app has already granted with the Fasstap™ MPOS SDK required permissions.
hasRequiredPermission(Context context)
PARAMETER
context | Context Context of the caller class. |
configuration | SSMPOSSDKConfiguration SSMPOSSDKConfiguration object that contains all the configuration information to configure the Fasstap™ MPOS SDK. |
RETURN VALUE
boolean | Flag indicates if the app has granted with the necessary permissions. |
requestPermissionIfRequired
Have the Fasstap™ MPOS SDK request for the necessary permissions.
requestPermissionIfRequired(Activity app, int code)
PARAMETER
app | Activity The activity that is requesting for the permission so Android framework could handle the request prompt. The activity should also overrides |
code | int The request code that Android’s Framework should be forwarding back to main project’s |
RETURN VALUE
boolean | Flag indicates if the permissions have all been granted prior to calling this method. |
hasGrantPermission
Check if the permissions requested are all granted without issue. Please make a call to requestPermissionIfRequired
method prior to this.
hasGrantPermission(int[] grantResult)
PARAMETER
grantResult | int[] The grant results forwarded from |
RETURN VALUE
boolean | Flag indicates if the permissions have all been granted. |
isRunningOnRemoteProcess
Check if the application is running on remote process.
isRunningOnRemoteProcess(Context context)
PARAMETER
context | Context The context of application. |
RETURN VALUE
boolean | Flag indicates if the application is running on remote process. |
getCotsId
To get the device ID.
getCotsId()
RETURN VALUE
String | Device ID. |
getSdkVersion
To get the Fasstap™ MPOS SDK version.
getSdkVersion()
RETURN VALUE
String | Fasstap™ MPOS SDK version. |
SSMPOSSDKConfiguration
This is the configuration class that is uses to configure the Fasstap™ MPOS SDK. This class does not have exposable API, but it contains a builder class that could be used to set the configuration value. The builder class will be discussed in the following section.
SSMPOSSDKConfiguration.Builder
This is the builder class for SSMPOSSDKConfiguration
.
create
Create a new SSMPOSSDKConfiguration.Builder
object.
create()
RETURN VALUE
SSMPOSSDKConfiguration.Builder | A new |
setLibAccessKey
To set the Access Key. This field is mandatory. Soft Space will provide the Access Key.
setLibAccessKey(String libAccessKey)
PARAMETER
libAccessKey | String The access key given by Soft Space. |
RETURN VALUE
SSMPOSSDKConfiguration.Builder | A new |
setLibSecretKey
To set the Secret Key. This field is mandatory. Soft Space will provide the Secret Key.
setLibSecretKey(String libSecretKey)
PARAMETER
libSecretKey | String The Secret key given by Soft Space. |
RETURN VALUE
SSMPOSSDKConfiguration.Builder | A new |
setLibGoogleApiKey
To set the Google API Key for Google Safetynet Attestation purpose. This field is mandatory.
This requires developer to register an account under Google Developer Console > Android Device Verification API. For more information, please visit this link.
setLibGoogleApiKey(String libGoogleApiKey)
PARAMETER
libGoogleApiKey | String The Google API key obtains from Google Developer Console site. |
RETURN VALUE
SSMPOSSDKConfiguration.Builder | A new |
setLibGooglePlayProjNum
To set the Google Play Project Number for Google Play Integrity API purpose. This field is mandatory. Refer to Play Integrity Enrolment guide.
setLibGooglePlayProjNum(String libGooglePlayProjNum)
PARAMETER
libGooglePlayProjNum | String The Google Play Project Number obtains from Google Cloud Console. |
RETURN VALUE
SSMPOSSDKConfiguration.Builder | A new |
setAttestationHost
To set the attestation server’s URL. This field is mandatory if attestation is enabled.
setAttestationHost(String attestationHost)
PARAMETER
attestationHost | String The attestation server’s URL. |
RETURN VALUE
SSMPOSSDKConfiguration.Builder | A new |
setAttestationRefreshInterval
To set the attestation refresh interval in milliseconds. This interval serves as the time before next attestation would kick start automatically in the background after one attestation has done.
setAttestationRefreshInterval(Long attestationRefreshInterval)
PARAMETER
attestationRefreshInterval | Long The attestation refresh interval in milliseconds. |
RETURN VALUE
SSMPOSSDKConfiguration.Builder | A new |
setAttestationHostReadTimeout
To set the attestation host’s socket read timeout value in milliseconds.
setAttestationHostReadTimeout(Long attestationHostReadTimeout)
PARAMETER
attestationHostReadTimeout | Long The attestation host's socket read timeout value in milliseconds. |
RETURN VALUE
SSMPOSSDKConfiguration.Builder | A new |
setAttestationConnectionTimeout
To set the attestation host’s socket connection timeout value in milliseconds.
setAttestationConnectionTimeout(Long attestationConnectionTimeout)
PARAMETER
attestationConnectionTimeout | Long The attestation host's connection timeout value in milliseconds. |
RETURN VALUE
SSMPOSSDKConfiguration.Builder | A new |
setAttestationStrictHttp
To set if the attestation host is using certificate pinning.
setAttestationStrictHttp(Boolean attestationStrictHttp)
PARAMETER
attestationStrictHttp | Boolean Flag if SDK should use Certificate pinning for verification. |
RETURN VALUE
SSMPOSSDKConfiguration.Builder | A new |
setAttestationHostCertPinning
To set the attestation host’s certificate if SDK should verify with certificate pinning method.
setAttestationHostCertPinning(String attestationHostCertPinning)
PARAMETER
attestationHostCertPinning | String Attestation server’s certificate. |
RETURN VALUE
SSMPOSSDKConfiguration.Builder | A new |
setUniqueID
To set the unique ID provided by Soft Space.
setUniqueID(String uniqueID)
PARAMETER
uniqueID | String The uniqueID from Soft Space. |
RETURN VALUE
SSMPOSSDKConfiguration.Builder | A new |
setDeveloperID
To set the developer ID provided by Soft Space.
setDeveloperID(String developerID)
PARAMETER
developerID | String The developerID from Soft Space. |
RETURN VALUE
SSMPOSSDKConfiguration.Builder | A new |
setEnvironment
To set the environment of SDK, configuration file is required as per each of the different Environment:
- DEV:
config_dev.env
- SIT:
config_sit.env
- UAT:
config_uat.env
- PROD:
config_prod.env
setEnvironment(Environment environment)
PARAMETER
environment | Environment The environment of SDK. |
RETURN VALUE
SSMPOSSDKConfiguration.Builder | A new |
Transaction
This is the interface representation of transactional handling of Fasstap™ MPOS SDK. It provides API for to start transaction, etc. It also holds the transactional result codes while processing transactions. Upon initing the Fasstap™ MPOS SDK successfully, main project could then make API call via SSMPOSSDK.getInstance().getTransaction()
to obtain the Transaction class and starts.
startTransaction
Instruct Fasstap™ MPOS SDK to start a transaction with the MPOSTransactionParams
. This will make Fasstap™ MPOS SDK starts listening to NFC events and the card events (like user tapped card, or timeout occurs) will be reflected with onTransactionUIEvent
method in TransactionEvents
.
Various transaction events that requires main project to handle the implementation will take place under TransactionEvents
interface too. For more information regarding TransactionEvents
, please refer to MPOSTransaction.TransactionEvents.
Eventhough Fasstap™ MPOS SDK handles the NFC events itself, it does not render any UI that instructs user to tap card on the phone. Prompting user with proper tap card UI before calling startTransaction
is strongly recommended.
startTransaction(Activity context, MPOSTransactionParams trxParams, TransactionEvents callback)
PARAMETER
context | Activity The activity that starts the transaction. Please note that Activity class instance is required here instead of plain context. |
trxParams | MPOSTransactionParams The parameters for this transaction like amount. For more information, please refer to MPOSTransactionParams. |
callback | TransactionEvents The callback implementation class for various transactional and card events. Please refer to MPOSTransaction.TransactionEvents. |
RETURN VALUE
Boolean | A flag that is indicating if the transaction has started successfully. Please take note that this flag does not indicate the transaction has been carried out successfully. Transaction results or events will be done via |
MPOSTransactionParams transactionalParams = MPOSTransactionParams.Builder.create()
.setReferenceNumber("referenceNo")
.setAmount("1000")
.build();
SSMPOSSDK.getInstance().getTransaction().startTransaction(this, transactionalParams, new MPOSTransaction.TransactionEvents() {
@Override
public void onTransactionResult(int result, MPOSTransactionOutcome transactionOutcome) {
runOnUiThread(new Runnable() {
@Override
public void run() {
if(result == TransactionSuccessful)
{
String outcome = "Transaction ID :: " + transactionOutcome.getTransactionID() + "\n";
outcome += "Reference No :: " + transactionOutcome.getReferenceNo() + "\n";
outcome += "Approval code :: " + transactionOutcome.getApprovalCode() + "\n";
outcome += "Card number :: " + transactionOutcome.getCardNo() + "\n";
outcome += "Cardholder name :: " + transactionOutcome.getCardHolderName() + "\n";
outcome += "Acquirer ID :: " + transactionOutcome.getAcquirerID() + "\n";
outcome += "RRN :: " + transactionOutcome.getRrefNo();
}
else
{
if(transactionOutcome != null)
{
writeLog(transactionOutcome.getStatusCode() + " - " + transactionOutcome.getStatusMessage());
}
else
{
writeLog("Error ::" + result);
}
}
}
});
}
@Override
public void onTransactionUIEvent(int event) {
runOnUiThread(new Runnable() {
@Override
public void run() {
if (event == TransactionUIEvent.CardReadOk)
{
// you may customize card reads OK sound & vibration, below is some example
ToneGenerator toneGenerator = new ToneGenerator(AudioManager.STREAM_MUSIC, ToneGenerator.MAX_VOLUME);
toneGenerator.startTone(ToneGenerator.TONE_DTMF_P, 500);
Vibrator v = (Vibrator) MainActivity.this.getSystemService(Context.VIBRATOR_SERVICE);
if (v.hasVibrator())
{
v.vibrate(VibrationEffect.createOneShot(200, VibrationEffect.DEFAULT_AMPLITUDE));
}
}
else if (event == TransactionUIEvent.RequestSignature)
{
writeLog("Signature is required");
}
}
});
}
});
abortTransaction
To try to cancel an ongoing transaction.
abortTransaction()
RETURN VALUE
Boolean | A flag that indicates if the transaction has cancelled successfully. |
startQRTransaction
Instruct Fasstap™ MPOS SDK to start a QR transaction with the MPOSTransactionParams
. This will generate a QR related response in TransactionOutcome
.
Various transaction events that requires main project to handle the implementation will take place under TransactionEvents
interface too. For more information regarding TransactionEvents
, please refer to MPOSTransaction.TransactionEvents.
startQRTransaction(Activity context, MPOSTransactionParams trxParams, TransactionEvents callback)
PARAMETER
context | Activity The activity that starts the transaction. Please note that Activity class instance is required here instead of plain context. |
trxParams | MPOSTransactionParams The parameters for this transaction like amount & QR Type. For more information, please refer to MPOSTransactionParams. |
callback | TransactionEvents The callback implementation class for various transactional and card events. Please refer to MPOSTransaction.TransactionEvents. |
RETURN VALUE
Boolean | A flag that is indicating if the transaction has started successfully. Please take note that this flag does not indicate the transaction has been carried out successfully. Transaction results or events will be done via |
abortQRTransaction
To try to cancel an ongoing QR transaction.
abortQRTransaction()
RETURN VALUE
Boolean | A flag that indicates if the QR transaction has cancelled successfully. |
voidTransaction
To void a transaction.
voidTransaction(Activity context, MPOSTransactionParams trxParams, TransactionEvents callback)
PARAMETER
context | Activity The activity that voids the transaction. Please note that activity is required here instead of plain context. |
trxParams | MPOSTransactionParams The parameters for this void transaction like transaction ID. |
callback | TransactionEvents The callback implementation class for various transactional and card events. |
RETURN VALUE
Boolean | A flag that is indicating if the void transaction has started successfully. Please take note that this flag does not indicate the void transaction has carried out successfully. Transaction results or events will be done via |
MPOSTransactionParams transactionalParams = MPOSTransactionParams.Builder.create()
.setMPOSTransactionID(edtTrxID.getText().toString())
.build();
SSMPOSSDK.getInstance().getTransaction().voidTransaction(this, transactionalParams, new MPOSTransaction.TransactionEvents() {
@Override
public void onTransactionResult(int result, MPOSTransactionOutcome transactionOutcome) {
runOnUiThread(new Runnable() {
@Override
public void run() {
if(result == TransactionSuccessful) {
// Successful
}
else {
if (transactionOutcome != null) {
writeLog(transactionOutcome.getStatusCode() + " - " + transactionOutcome.getStatusMessage());
}
}
}
});
}
@Override
public void onTransactionUIEvent(int event) {
runOnUiThread(new Runnable() {
@Override
public void run() {
writeLog("onTransactionUIEvent :: " + event);
}
});
}
});
refundTransaction
To refund a transaction.
refundTransaction(Activity context, MPOSTransactionParams trxParams, TransactionEvents callback)
PARAMETER
context | Activity The activity that refunds the transaction. Please note that activity is required here instead of plain context. |
trxParams | MPOSTransactionParams The parameters for this refund transaction like transaction ID or |
callback | TransactionEvents The callback implementation class for various transactional and card events. |
RETURN VALUE
Boolean | A flag that is indicating if the refund transaction has started successfully. Please take note that this flag does not indicate the refund transaction has carried out successfully. Transaction results or events will be done via |
performSettlement
To perform a settlement.
performSettlement(Activity context, MPOSTransactionParams trxParams, TransactionEvents callback)
PARAMETER
context | Activity The activity that performs the settlement. Please note that activity is required here instead of plain context. |
trxParams | MPOSTransactionParams The parameters object. |
callback | TransactionEvents The callback implementation class for various transactional events. |
RETURN VALUE
Boolean | A flag that is indicating if the settlement has started successfully. Please take note that this flag does not indicate the settlement has carried out successfully. Transaction results or events will be done via |
MPOSTransactionParams transactionalParams = MPOSTransactionParams.Builder.create()
.build();
SSMPOSSDK.getInstance().getTransaction().performSettlement(this, transactionalParams, new MPOSTransaction.TransactionEvents() {
@Override
public void onTransactionResult(int result, MPOSTransactionOutcome transactionOutcome) {
runOnUiThread(new Runnable() {
@Override
public void run() {
if(result == TransactionSuccessful) {
// Successful
}
else {
if (transactionOutcome != null) {
writeLog(transactionOutcome.getStatusCode() + " - " + transactionOutcome.getStatusMessage());
}
}
}
});
}
@Override
public void onTransactionUIEvent(int event) {
runOnUiThread(new Runnable() {
@Override
public void run() {
writeLog("onTransactionUIEvent :: " + event);
}
});
} });
refreshToken
To refresh token.
refreshToken(Activity context, TransactionEvents callback)
PARAMETER
context | Activity The activity that initiate the refresh token operation. Please note that activity is required here instead of plain context. |
callback | TransactionEvents The callback implementation class for various transactional events. |
RETURN VALUE
Boolean | A flag that is indicating if the refresh token operation has started successfully. Please take note that this flag does not indicate the refresh token has carried out successfully. Transaction results or events will be done via |
SSMPOSSDK.getInstance().getTransaction().refreshToken(this, new MPOSTransaction.TransactionEvents() {
@Override
public void onTransactionResult(int result, MPOSTransactionOutcome transactionOutcome) {
if(result == TransactionSuccessful) {
// Success
} else {
// Failed
}
}
@Override
public void onTransactionUIEvent(int event) {
// UI event
writeLog("onTransactionUIEvent :: " + event);
}
});
sendReceipt
To send an e-receipt.
sendReceipt(Activity context, MPOSTransactionParams trxParams, TransactionEvents callback)
PARAMETER
context | Activity The activity that performs send receipt. Please note that activity is required here instead of plain context. |
trxParams | MPOSTransactionParams The parameters for send receipt like email, mobile number. |
callback | TransactionEvents The callback implementation class for various transactional events. |
RETURN VALUE
Boolean | A flag that is indicating if the send receipt has started successfully. Please take note that this flag does not indicate the send receipt has carried out successfully. Transaction results or events will be done via |
uploadSignature
To upload signature.
uploadSignature(MPOSTransactionParams trxParams)
PARAMETER
trxParams | MPOSTransactionParams The parameter for upload signature is signature. |
RETURN VALUE
Boolean | A flag that is indicating if the upload signature has started successfully. Please take note that this flag does not indicate the upload signature has carried out successfully. Transaction results or events will be done via |
MPOSTransactionParams transactionalParams = MPOSTransactionParams.Builder.create()
.setSignature(base64SignatureString)
.build();
SSMPOSSDK.getInstance().getTransaction().uploadSignature(transactionalParams);
getTransactionStatus
To get transaction status.
getTransactionStatus(Activity context, MPOSTransactionParams trxParams, TransactionEvents callback)
PARAMETER
context | Activity The activity that gets the transaction status. Please note that activity is required here instead of plain context. |
trxParams | MPOSTransactionParams The parameters for this get transaction status like transaction ID. |
callback | TransactionEvents The callback implementation class for various transactional events. |
RETURN VALUE
Boolean | A flag that is indicating if the get transaction status has started successfully. Please take note that this flag does not indicate the get transaction status has carried out successfully. Transaction results or events will be done via |
MPOSTransactionParams transactionalParams = MPOSTransactionParams.Builder.create().build();
if (trxID.length() > 0)
{
transactionalParams = MPOSTransactionParams.Builder.create()
.setMPOSTransactionID(edtTrxID.getText().toString())
.build();
} else if (referenceNo.length() > 0) {
transactionalParams = MPOSTransactionParams.Builder.create()
.setReferenceNumber(edtRefNo.getText().toString())
.build();
}
SSMPOSSDK.getInstance().getTransaction().getTransactionStatus(this, transactionalParams, new MPOSTransaction.TransactionEvents() {
@Override
public void onTransactionResult(int result, MPOSTransactionOutcome transactionOutcome) {
runOnUiThread(new Runnable() {
@Override
public void run() {
if(result == TransactionSuccessful)
{
if (transactionOutcome.getStatusCode().equals(TRX_STATUS_APPROVED))
{
// approved
}
else if (transactionOutcome.getStatusCode().equals(TRX_STATUS_SETTLED))
{
// settled
}
String outcome = "Status :: " + transactionOutcome.getStatusCode() + " - " + (mapStatusCode(transactionOutcome.getStatusCode()).length()>0?mapStatusCode(transactionOutcome.getStatusCode()):transactionOutcome.getStatusMessage()) + "\n";
outcome += "Reference no :: " + transactionOutcome.getReferenceNo() + "\n";
outcome += "Amount auth :: " + transactionOutcome.getAmountAuthorized() + "\n";
outcome += "Transaction ID :: " + transactionOutcome.getTransactionID() + "\n";
outcome += "Transaction date :: " + transactionOutcome.getTransactionDate() + "\n";
outcome += "Batch no :: " + transactionOutcome.getBatchNo() + "\n";
outcome += "Approval code :: " + transactionOutcome.getApprovalCode() + "\n";
outcome += "Invoice no :: " + transactionOutcome.getInvoiceNo() + "\n";
outcome += "AID :: " + transactionOutcome.getAid() + "\n";
outcome += "Card type :: " + transactionOutcome.getCardType() + "\n";
outcome += "Application label :: " + transactionOutcome.getApplicationLabel() + "\n";
outcome += "Card number :: " + transactionOutcome.getCardNo() + "\n";
outcome += "Cardholder name :: " + transactionOutcome.getCardHolderName()+ "\n";
outcome += "RRN :: " + transactionOutcome.getRrefNo();
}
else
{
if(transactionOutcome != null)
{
writeLog(transactionOutcome.getStatusCode() + " - " + transactionOutcome.getStatusMessage());
}
else
{
writeLog("Error ::" + result);
}
}
}
});
}
@Override
public void onTransactionUIEvent(int event) {
runOnUiThread(new Runnable() {
@Override
public void run() {
writeLog("onTransactionUIEvent :: " + event);
}
});
}
});
MPOSTransaction.TransactionEvents
This is a small class that holds various kinds of transaction related events and codes. The event groups within TransactionEvents
are TransactionUIEvent
, TransactionResult
. Below are some callback methods under TransactionEvents
.
onTransactionResult
Callback method that will be raised when transaction has finish processes and kernel returns result, together with online host response message.
onTransactionResult(int result, TransactionOutcome transactionOutcome)
PARAMETER
result | int Result of processing transaction returned by the transaction-processing kernel. For more information about possible result, please refer to Transaction.TransactionEvents.TransactionResult. |
transactionOutcome | TransactionOutcome The transaction outcome object that carries status and details. |
onTransactionUIEvent
Callback method that will be raised when there is any kind of UI event that needs to display to user for acknowledgement purpose.
onTransactionUIEvent(int uiEvent)
PARAMETER
uiEvent | int The event code that raised the UI event. Please refer to Transaction.TransactionEvents.TransactionUIEvent for more information. |
Transaction.TransactionEvents.TransactionUIEvent
This class holds the possible UI events raised by Tap to Pay SDK that may need to show the user.
Data Type | Value | Description |
---|---|---|
int | 71 | PresentCard Event code indicates reader is ready for transaction. |
int | 72 | CardPresented Event code indicates the card is detected by the reader. |
int | 74 | PresentCardTimeout Event code indicates present card has timeout. |
int | 23 | CardReadOk Event code indicates the contactless card has been processed successfully, can remove card from the terminal. |
int | 24 | CardReadError Event code indicates the contactless card processing has failed. |
int | 25 | CardReadRetry Event code indicates card read is incomplete and card read retry has been called. |
int | 73 | Authorising Event code indicates sending for online authorization. |
int | 70 | RequestSignature Event code indicates request for signature. |
Transaction.TransactionEvents.TransactionResult
This class holds the possible transaction processing result codes that will be raised with onTransactionResult
callback method.
Data Type | Value | Description |
---|---|---|
int | 0 | TransactionSuccessful Event code indicates transaction has been carried out successfully and the transaction cycle has been completed as well. |
int | 7004 | TransactionDeclined Event code indicates the transaction is declined by kernel. |
int | 7005 | TransactionFailed Event code indicates the kernel has failed to process the transaction. |
int | 7006 | TransactionNoAppError Event code indicates the card tapped does not have any schemes in it. |
int | 7007 | TransactionFailedAllowFallback Event code indicates the transaction has failed but allowing fallback mechanism. Please handle this error the same way as how TransactionFailed is handled. |
int | 7008 | TransactionCardExpired Event code indicates the transaction has failed due to the card tapped has expired. |
int | 7020 | TransactionOnlineFailed Event code indicates the transaction has failed due to online host rejection. |
int | 7024 | TransactionCancel Event code indicates the transaction has been cancelled intentionally by the user. |
int | 7028 | TransactionTimeout Event code indicates the transaction has failed due to timer that starts counting since transaction start has elapsed. |
int | 7054 | TransactionRequireCDCVM Event code indicates that CDCVM is required, advise customer to see phone for instructions. |
int | 7056 | TransactionTryAgain Event code indicates the Tap to Pay SDK has failed to communicate with the card tapped. This is most likely happened when the card has moved away in the midst of transaction processing. |
int | 7059 | TransactionPinNotSupported Event code indicates the transaction has failed due to transaction amount above CVM limit and PIN is not supported for the particular card type. |
TransactionOutcome
This class holds the transaction outcome that will be raised with onTransactionResult
callback method.
Data Type | Field | Mandatory | Description |
---|---|---|---|
String | statusCode | Y | Status code of the transaction. |
String | statusMessage | Y | Status message of the transaction. |
Sales Only | |||
String | approvalCode | Y | Approval code from Host. |
String | transactionID | Y | Transaction ID from MPOS server, to be used for SendReceipt or Void. |
String | cardNo | Y | Masked PAN number. |
String | cardType | Y | Card type. 0 – Visa 1 – Mastercard 2 – AMEX 3 – JCB 7 – UnionPay 10 – Diners 11 – TPN 22 – VCCS(NAPAS) 23 – Discover |
String | cardHolderName | N | Card holder name from EMV data. |
String | aid | Y | AID from EMV data. |
String | transactionDate | Y | Transaction Date of the transaction. |
String | transactionTime | Y | Transaction Time of the transaction. |
String | acquirerID | N | Acquirer ID of the transaction. |
String | applicationCryptogram | N | Application Cryptogram of the transaction. |
String | terminalVerificationResults | N | TVR of the transaction. |
String | transactionStatusInfo | N | TSI of the transaction. |
String | merchantIdentifier | N | MID of the transaction. |
String | terminalIdentifier | N | TID of the transaction. |
String | invoiceNo | N | Invoice No of the transaction. |
String | contactlessCVMType | N | Contactless CVM Type of the transaction. |
String | rrefNo | N | RRN of the transaction. |
String | transactionCert | N | TC of the transaction. |
String | merchantCategoryCode | N | MCC of the transaction. |
String | receiptUrl | N | URL for e-receipt of the transaction. |
String | transactionDateTime | N | Full date time of the transaction. |
String | referenceNo | N | Unique reference no of the transaction. |
String | traceNo | N | Trace No of the transaction. |
QR Sales Only | |||
String | qrID | Y | ID of the QR transaction. |
String | qrData | Y | QR content that used to generate QR code. |
Bitmap | qrCode | Y | QR code image of the requested QR type in Bitmap form. |
MPOSTransactionParams.Builder
This is the builder class for MPOSTransactionParams
.
setAmount
Setting the amount value for the transaction. The amount should be in String
format, and it should only be numeric form. Please do not include the decimal point while setting the amount.
For example, if the amount is 5.99, please pass in as '599' in String
. If it is 599.00, please pass in '59900'.
For sale and refund transactions
setAmount(String amount)
PARAMETER
amount | String The transaction amount. |
RETURN VALUE
MPOSTransactionParams.Builder | The current object of the builder class of |
setCardRequiredForRefund
Indicator for refund transaction type.
For refund transaction
setCardRequiredForRefund(boolean cardRequiredForRefund)
PARAMETER
cardRequiredForRefund | boolean The refund indicator. |
RETURN VALUE
MPOSTransactionParams.Builder | The current object of the builder class of |
setMPOSTransactionID
Setting the sales/refund transaction ID value for the Void transaction, returned from MPOS server during Sale/Refund transaction.
For void transaction
setMPOSTransactionID(String mposTransactionID)
PARAMETER
mposTransactionID | String The transaction ID from MPOS server. |
RETURN VALUE
MPOSTransactionParams.Builder | The current object of the builder class of |
setQRType
QR type for QR transaction.
For QR sales
setQRType(QRType qrType)
PARAMETER
qrType | QRType The QR type.
|
RETURN VALUE
MPOSTransactionParams.Builder | The current object of the builder class of |