Transactions Activity Result

Transactions Activity Result

On the onActivityResult(int requestCode, int resultCode, Intent data) The Intent data will contain the return value as extra all in String value. If there is a problem with the data sent to the application, an error code will be sent back into the TERMINALERRORCODE extraData, other wise, RSPCODE will be the response code from the switch.

Error Codes

Value of the error code if application reject:

Error code valueDescription
-1
No extra data is missing
-2

Amount, Invoice or idempotency key sent is invalid
-3
Transaction type is invalid
-4
Invoice sent is already used or do not exist for completion/void
-5
Invoice number is already voided
-6
Clerk is not on the terminal
-7
Authorization code is invalid
-8
Battery is too low (less than 8%)
-9
Original amount invalid
-10
Tip amount invalid
-11
DataCandy transaction
-12
Network error
-14
Transaction didn’t finish as expected, all data will still be return of the transaction status if any.

For example a transaction can be approved and for some reason didn’t end properly.

The intent result will contain “TERMINALERRORCODE=-14” and “RSPCODE=000”
-15
Termlink not installed
-16
Transaction in progress
-17
Idempotency re-use
-18
Idempotency waiting for response
-100
BroadPos error, not able to connect to termlink app
120
Terminal is block and cannot perform a transaction. A host download is needed most likely

Extra Data

List of extra data receive:

Extra data on activity result

Description

Note

“TERMINALERRORCODE”

Terminal error code

 

“RSPCODE”

Response code

“000” = approved

“05“ = Declined

empty mean it was cancelled

“AUTHCODE”

Authorization code

 

“BATCHNBR”

Batch number

 

SEQNBR

Transaction number

UUID of the transaction number

INVNBR

Invoice number

 

"IDEMPOTENCY_KEY"

Idempotency key of the transaction

UUID as String

“TIMESTAMP”

Timestamp

 

“ISSUERCARDTYPE”

Issuer card type

Visa = “VISA”
MasterCard = “MASTERCARD”
Amex = “AMEX
Discover = “DISCOVER”
Diners = “DINERS”
JCB = “JCB
Cash = “CASH”
Interac = “INTERAC”

“CARDTYPE”

Cardtype (C for Credit, D for Debit)

 

“MASKEDCARDNBR”

Masked card number

 

“EXPDATE”

Expiration date of the card

 

“ENTRYMODE”

Entry mode

“D“ = EMV Contact
”F” = Fallback
”M” = Manual entry
”C” = Contactless
”S” = Swipe

“APPLABEL”

Application label use.

 

“AID”

Application identification number

 

“TVR”

Terminal verification result

 

“TSI”

Transaction Status Indicator

 

CVM

CVM result

 

ARQC

Tag 9f26 application cryptogram

 

“AUTHRESULT”

Auhtorization result

-1 = null
0 = TC, offline approved
1 = AAC offlline declined
2 = ARQC online required

“ISDEBIT”

Transaction is debit or not, boolean value

 

“ACTTYPE”

account type of the transaction, 1 for checking, 2 for saving, string value

 

“AMOUNT”

Transaction amount

 

“TIP”

Tip amount

 

“CASHBACK”

Cashback amount

 

“FEES”

Fees amount

 

“APPVERS”

Application version

 

TERMID

Terminal ID

 

“TRXRSLTSTR”

Transaction result in String value

 

“TRXDATE”

Transaction date

 

“TRXTIME”

Transaction time

 

“MERCHNAME”

Merchant name

 

“MERCHSTRADR”

Merchant street address

 

“MERCHCITYPROV”

Merchant city and province

 

“EXTRADISP”

Extra data to display on receipt

 

“CLERKID”

Clerk Id

 

“CUSTLANG”

 

Customer language

"RECEIPT"

Receipt as plain text that can be used to print

text

“TRAININGMODE”

Training mode

True if training mode active

"AUTOSETTLETIME"

First auto settle time set in payment app.

Null if no time is set.

The time is in milliseconds, use it to get the hour and minutes of the settlement time.


“RECEIPT_DECISION”
The dec
ision made by the customer when asked if they want a receipt

One of the following:

  • DECLINED - Meaning that the customer does not want a receipt.

  • TIMEOUT - The screen timed out and no selection was made.

  • QR_CODE - The QR code option was selected. The Secure Payment application does not display a QR code. It would be up to the calling application to handle this.

  • EMAIL - The Email option was selected. The Secure Payment application does not send the email. It would be up to the calling application to handle this.

  • SMS - The SMS option was selected. The Secure Payment application does not send the SMS message. It would be up to the calling application to handle this.

  • PRINT - The print option was selected but the Secure Payment application cannot print it due to not having a printer.

  • TERMINAL_PRINTED - The print option was selected and the Secure Payment application has handled the printing already.

“CUSTOMER_EMAIL”
The email address that the customer has entered in on the Secure Payment application after selecting Email for their customer receipt.
  • Maximum length: 255

  • The email address returned here is validated to be well-formed.

“CUSTOMER_PHONE_NUMBER”
The phone number that the customer has entered in on the Secure Payment application after selecting Sms for their customer receipt.
  • For Canada & US numbers:

    • Maximum length: 10

    • Example: If the phone number entered was
      123 456 7890, the returned format would be: 1234567890

  • For other countries.

    • Minimum length: 3

    • Maximum length: 12

    • Terminal does not validate the format.

  • The phone number returned does not include country code.

“CUSTOMER_PHONE_COUNTRY_CODE”
The country code that the customer has selected in the Secure Payment application after selecting Sms for their customer receipt.
  • Maximum length: 6

  • The country code returned only contains digits

  • ie.

    • +1 → 1

    • +44 → 44

    • +44-1481 → 441481

Additional values from the settlement transaction only:


Extra data on activity result

Description

Extra data on activity result

Description

“BATCHNBR”

Settlement batch number

“SETTPREVAMOUNT”

Settlement previous batch settled amount

“SETTRESPCODE”

Settlement response code

“SETTAMOUNT”

Settlement total amount

“SETTDATETIME”

Settlement date time

“SETTCOUNT”

Settlement total count

“SETTAMEXCOUNT”

Settlement American Express count

“SETTAMEXTOTAL”

Settlement American Express total amount

“SETTDISCCOUNT”

Settlement Discover count

“SETTDISCTOTAL”

Settlement Discover total amount

“SETTJCBCOUNT”

Settlement JCB count

“SETTJCBTOTAL”

Settlement JCB total amount

“SETTINTERACCOUNT”

Settlement Interac count

“SETTINTERACTOTAL”

Settlement Interac total amount

“SETTMASTERCOUNT”

Settlement MasterCard count

“SETTMASTERTOTAL”

Settlement MasterCard total amount

“SETTVISACOUNT”

Settlement Visa count

“SETTVISATOTAL”

Settlement Visa total amount

Code Example

JavaScript
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
 
String value = "";
if (data != null )
{
value += "TERMINALERRORCODE = " + data.getIntExtra("TERMINALERRORCODE", 0) + "\n";
value += "MERCHNAME = " + data.getStringExtra("MERCHNAME") + "\n";
value += "MERCHSTRADR = " + data.getStringExtra("MERCHSTRADR") + "\n";
value += "MERCHCITYPROV = " + data.getStringExtra("MERCHCITYPROV") + "\n";
value += "EXTRADISP = " + data.getStringExtra("EXTRADISP") + "\n";
value += "TERMID = " + data.getStringExtra("TERMID") + "\n";
value += "TRXDATE = " + data.getStringExtra("TRXDATE") + "\n";
value += "TRXTIME = " + data.getStringExtra("TRXTIME") + "\n";
value += "RSPCODE = " + data.getStringExtra("RSPCODE") + "\n";
value += "AUTHCODE = " + data.getStringExtra("AUTHCODE") + "\n";
value += "BATCHNBR = " + data.getStringExtra("BATCHNBR") + "\n";
value += "SEQNBR = " + data.getStringExtra("SEQNBR") + "\n";
value += "INVNBR = " + data.getStringExtra("INVNBR") + "\n";
value += "TIMESTAMP = " + data.getStringExtra("TIMESTAMP") + "\n";
value += "ISSUERCARDTYPE = " + data.getStringExtra("ISSUERCARDTYPE") + "\n";
value += "CARDTYPE = " + data.getStringExtra("CARDTYPE") + "\n";
value += "MASKEDCARDNBR = " + data.getStringExtra("MASKEDCARDNBR") + "\n";
value += "EXPDATE = " + data.getStringExtra("EXPDATE") + "\n";
value += "ENTRYMODE = " + data.getStringExtra("ENTRYMODE") + "\n";
value += "APPLABEL = " + data.getStringExtra("APPLABEL") + "\n";
value += "AID = " + data.getStringExtra("AID") + "\n";
value += "TVR = " + data.getStringExtra("TVR") + "\n";
value += "TSI = " + data.getStringExtra("TSI") + "\n";
value += "AMOUNT = " + data.getStringExtra("AMOUNT") + "\n";
value += "TIP = " + data.getStringExtra("TIP") + "\n";
value += "CASHBACK = " + data.getStringExtra("CASHBACK") + "\n";
value += "FEES = " + data.getStringExtra("FEES") + "\n";
value += "APPVERS = " + data.getStringExtra("APPVERS") + "\n";
value += "TRXRSLTSTR = " + data.getStringExtra("TRXRSLTSTR") + "\n";
value += "CLERKID = " + data.getStringExtra("CLERKID") + "\n";
value += "ACTTYPE = " + data.getStringExtra("ACTTYPE") + "\n";
value += "CUSTLANG = " + data.getStringExtra("CUSTLANG") + "\n";
value += "ISDEBIT = " + (data.getBooleanExtra("ISDEBIT", false) ? "true" : "false" )+ "\n"; 
value += "TRAININGMODE = " + data.getBooleanExtra("TRAININGMODE", false) + "\n";
value += "AUTOSETTLETIME = " + data.getStringExtra("AUTOSETTLETIME") + "\n";
//SETTLEMENT
value += "SETTBATCH = " + data.getStringExtra("SETTBATCH") + "\n";
value += "SETTPREVAMOUNT = " + data.getStringExtra("SETTPREVAMOUNT") + "\n";
value += "SETTRESPCODE = " + data.getStringExtra("SETTRESPCODE") + "\n";
value += "SETTAMOUNT = " + data.getStringExtra("SETTAMOUNT") + "\n";
value += "SETTDATETIME = " + data.getStringExtra("SETTDATETIME") + "\n";
value += "SETTTOTAL = " + data.getStringExtra("SETTTOTAL") + "\n";
value += "SETTAMEXCOUNT = " + data.getStringExtra("SETTAMEXCOUNT") + "\n";
value += "SETTAMEXTOTAL = " + data.getStringExtra("SETTAMEXTOTAL") + "\n";
value += "SETTDISCCOUNT = " + data.getStringExtra("SETTDISCCOUNT") + "\n";
value += "SETTDISCTOTAL = " + data.getStringExtra("SETTDISCTOTAL") + "\n";
value += "SETTJCBCOUNT = " + data.getStringExtra("SETTJCBCOUNT") + "\n";
value += "SETTJCBTOTAL = " + data.getStringExtra("SETTJCBTOTAL") + "\n";
value += "SETTINTERACCOUNT = " + data.getStringExtra("SETTINTERACCOUNT") + "\n";
value += "SETTINTERACTOTAL = " + data.getStringExtra("SETTINTERACTOTAL") + "\n";
value += "SETTMASTERCOUNT = " + data.getStringExtra("SETTMASTERCOUNT") + "\n";
value += "SETTMASTERTOTAL = " + data.getStringExtra("SETTMASTERTOTAL") + "\n";
value += "SETTVISACOUNT = " + data.getStringExtra("SETTVISACOUNT") + "\n";
value += "SETTVISATOTAL = " + data.getStringExtra("SETTVISATOTAL") + "\n";
}
 
AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this).create();
alertDialog.setTitle("Alert");
alertDialog.setMessage(value);
alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "OK",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
alertDialog.show();
 
((TextView)findViewById(R.id.textView)).setText( "Response code = " + String.format("%03d",resultCode));
 
}
    • Related Articles

    • Transactions Activity Result

      On the onActivityResult(int requestCode, int resultCode, Intent data) The Intent data will contain the return value as extra all in String value. If there is a problem with the data sent to the application, an error code will be sent back into the ...
    • Transactions to DataCandy Application

      To call the PayFacto DataCandy application, a developer needs to create an Android intent. JavaScript Intent intent = new Intent("com.payfacto.payfactodatacandy.DATACANDY_ACTIVITY"); Extra Data Additional data are required to complete the intent: ...
    • Transactions to Secure Payment Application

      To call the PayFacto payment application, a developer needs to create an Android intent. JavaScript Intent intent = new Intent("com.payfacto.terminal.payment.PAYMENT_ACTIVITY"); Additional data is required to complete the intent as explained in the ...
    • Address Verification Status (AVS) Result Codes

      INTRODUCTION During a transaction where the customer's card is not presented at the merchant's location (inputType : I or M), the merchant can enter the address corresponding to his credit card statement on the payment page. This validation technique ...
    • Example Calls to the Secure Payment Application

      This page lists code examples for the various Secure Payment transactions Purchase JavaScript Intent intent = new Intent("com.payfacto.terminal.payment.PAYMENT_ACTIVITY");   intent.putExtra("TRANSACTION", "SALE"); intent.putExtra("AMOUNT", "100"); // ...