Skip to main content

Same-terminal application integration

1. Introduction

The merchant's POS application runs at the same POS terminal. It can pull up checkout component to complete payment through the payment integration APIs of CodePay Register.

Overall structure of Same terminal application integration

1.1 Typical process workflow

Same terminal application integration workflow
  1. POS application send order info (include order number, amount) to CodePay Register app to pull payment checkout component.
  2. The checkout component of CodePay Register collects the bank card information/mobile wallet user payment voucher and processes it securely, then merges it and order information in the transaction data, and sends the payment request to CodePay Gateway .
  3. CodePay Gateway processes the transaction packet and sends to payment gateway or acquire system.
  4. Payment gateway or acquire system responses result to CodePay Gateway .
  5. CodePay Gateway responses transaction result to CodePay Register application.
  6. CodePay Register application returns transaction result to POS application.

1.2 Integration method

POS application uses Android Intent to interact with CodePay Register application. The following diagram shows the interactions between this 2 applications.

Same terminal application integration workflow integration method,POS application uses Android Intent to interact with CodePay Register application
  1. POS application call "startActivityForResult" function to invoke the CodePay Register application .
  2. CodePay Register application parse the bundle data from POS application and then process transaction.
  3. Then CodePay Register application call "setResult" function after the transaction and "finish" own Activity.
  4. POS application received the transaction result by "onActivityResult" event.

2. Transaction APIs

Different aspects of each field are defined in this document according to the following conventions.

  • M: Required parameters
  • C: Required parameters when some conditions are met
  • O: Optional parameters
  • -: Not Present

2.1 Sale

Sale transaction refers to the payment operation performed by the cardholder when purchasing goods or services from a merchant. The transaction amount is deducted from the cardholder's account and transferred to the merchant's account.

2.1.1 Message

Name Type Length Request Response Description
versionStringMMAPI version, fixed value "1.1"
transTypeStringMMThe type code of Sale transaction, Fixed value 01
appIdString18M-The payment app id registered in Codepay Gateway, Please refer to the Payment gateway integration guide
transDataJSONMC
resultString-MRefer to appendix - Transaction result code
resultMsgString-CFailure message

transData field

Name Type Length Request Response Description
businessOrderNoStringMMThe order number of the merchant's point of sale application or business system, it must be unique in its system
paymentScenarioStringMM1 - card payment
2 - cash payment
3 - QR code payment, merchant present code and customers scan it
4 - QR code payment, customers present code and merchant scan it
paymentMethodStringCMSpecify a Payment method. This field is mandatory only when "paymentScenario" is set to "3" or "4".
Please refer to Payment method
cardTypeStringC-When "paymentScenario" field is set to "1", this field is mandatory.
1 - DEBIT_CARD
2 - CREDIT_CARD
3 - EBT_CARD
4 - GIFT_CARD
amtString12MMOrder amount
tipString12OOTip amount
transDateString8-MTransaction date, format: YYYYMMDD
transTimeString6-MTransaction time, format: HHMMSS
operatorString4-Ooperator's work number
authCodeString6-CAuthentication code. This field returns value when card payment transasction.
refNoString12-CRetrieval Reference Number .This field returns value when card payment transasction.
cardNoString19-CCard PAN number, It has been masked according to PCI specification. example: 430277****5723. This field returns value when card payment transasction.
entryModeString2-OThis field returns value when card payment transasction:
1 - Swipe magnetic stripe card
2 - Contact chip card
3 - Contactless chip card
4 - Manual entry input
transactionIDString32-MThe transaction id of CodePay Gateway.
noteString128O-The order note information
merchantIdString32-CThe merchant no
payChannelMerchantIDString32-CMerchant id of the payment channel,channel example: TSYS,ELAVON
payChannelTerminalIDString32-CTerminal id of the payment channel,channel example: TSYS,ELAVON
merchantNameString128-CThe merchant name
onScreenTipBoolean10-true: On-screen tip is required. false: On-screen tip is not required.
onScreenSignatureBoolean10-true: On-screen signature is required. false: On-screen signature is not required.

2.1.2 Sample code

Intent intent = new Intent();
intent.setAction("com.codepay.transaction.call");
intent.putExtra("version", "1.0");
intent.putExtra("appId", "{YOUR_APP_ID}");
intent.putExtra("transType", "01"); // Sale transaction
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("businessOrderNo","202202222222");
jsonObject.put("paymentScenario","1"); //Card payment
jsonObject.put("cardType", "1") //Debit
jsonObject.put("amt","2.15");
intent.putExtra("transData", jsonObject.toString());
} catch (JSONException e) {
e.printStackTrace();
}
startActivityForResult(intent, 1);

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
String result = data.getStringExtra("result");
String resultMsg = data.getStringExtra("resultMsg");
String transData = data.getStringExtra("transData");
if (result.equals("00")){
try {
JSONObject jsonObject = new JSONObject(transData);
String amount = jsonObject.getString("amt");
}catch(JSONException e){
e.printStackTrace();
}
}
}

2.2 Void

Void transaction usually means that within a short period of time after the transaction has been completed, the merchant needs to cancel the transaction for some reason (e.g., merchant error, customer change of mind, etc.).

  • The reversal must usually be done on the same day of the transaction and before the batch settlement.
  • Upon successful reversal, the original transaction amount will be refunded to the cardholder's account as if the transaction never occurred.
  • A reversal usually requires the original transaction voucher or related information for the operation.

2.2.1 Message

Name Type Length Request Response Description
versionStringMMAPI version, fixed value "1.1"
transTypeStringMMThe type code of Void transaction, Fixed value 02
appIdString18M-The payment app id registered in Codepay Gateway, Please refer to the Payment gateway integration guide
transDataJSONMC
resultString-MRefer to appendix - Transaction result code
resultMsgString-CFailure message

transData field

Name Type Length Request Response Description
originBusinessOrderNoStringMMThe order number of the original purchase transaction
businessOrderNoStringMMThe order number of the merchant's point of sale application or business system, it must be unique in its system
paymentMethodString-MPlease refer to Payment method
amtString12-MOrder amount
tipString12-OTip amount
transDateString8-MTransaction date, format: YYYYMMDD
transTimeString6-MTransaction time, format: HHMMSS
operatorString4-Ooperator's work number
authCodeString6-MAuthentication code. This field returns value when card payment transasction.
refNoString12-MRetrieval Reference Number .This field returns value when card payment transasction.
cardNoString19-MCard PAN number, It has been masked according to PCI specification. example: 430277****5723. This field returns value when card payment transasction.
entryModeString2-OThis field returns value when card payment transasction:
1 - Swipe magnetic stripe card
2 - Contact chip card
3 - Contactless chip card
4 - Manual entry input
transactionIDString32-MThe transaction id of CodePay Gateway.
merchantIdString32-CThe merchant no
payChannelMerchantIDString32-CMerchant id of the payment channel,channel example: TSYS,ELAVON
payChannelTerminalIDString32-CTerminal id of the payment channel,channel example: TSYS,ELAVON
merchantNameString128-CThe merchant name

2.2.2 Sample code

Intent intent = new Intent();
intent.setAction("com.codepay.transaction.call");
intent.putExtra("version", "1.0");
intent.putExtra("appId", "{YOUR_APP_ID}");
intent.putExtra("transType", "02"); // Void transaction
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("originBusinessOrderNo","202202222222");
jsonObject.put("businessOrderNo","202202222233");
intent.putExtra("transData", jsonObject.toString());
} catch (JSONException e) {
e.printStackTrace();
}
startActivityForResult(intent, 1);

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
String result = data.getStringExtra("result");
String resultMsg = data.getStringExtra("resultMsg");
String transData = data.getStringExtra("transData");
if (result.equals("00")){
try {
JSONObject jsonObject = new JSONObject(transData);
String amount = jsonObject.getString("amt");
}catch(JSONException e){
e.printStackTrace();
}
}
}

2.3 Refund

A refund transaction is a process in which a cardholder needs to return an item or cancel a service for some reason (e.g., a problem with the item, dissatisfaction with the service, etc.) after the transaction has cleared and requests that the amount paid be returned to the card account.

  • The refund may occur on the same day of the transaction, or a few days or more later.
  • Refunds usually require the cardholder to provide proof of purchase and a reason for the refund, and the merchant will refund the appropriate amount to the cardholder's card account after reviewing the refund.

2.3.1 Message

Name Type Length Request Response Description
versionStringMMAPI version, fixed value "1.1"
transTypeStringMMThe type code of Refund transaction, Fixed value 03
appIdString18M-The payment app id registered in Codepay Gateway, Please refer to the Payment gateway integration guide
transDataJSONMC
resultString-MRefer to appendix - Transaction result code
resultMsgString-CFailure message

transData field

Name Type Length Request Response Description
originBusinessOrderNoStringCCThe order number of the original Sale or Completion transaction.
businessOrderNoStringMMThe order number of the merchant's point of sale application or business system, it must be unique in its system
paymentScenarioStringMM1 - card payment
2 - cash payment
3 - QR code payment, merchant present code and customers scan it
4 - QR code payment, customers present code and merchant scan it
paymentMethodString-MPlease refer to Payment method
cardTypeStringC-When "paymentScenario" field is set to "1" and originBusinessOrderNo is empty, this field is mandatory.
1 - DEBIT_CARD
2 - CREDIT_CARD
3 - EBT_CARD
4 - GIFT_CARD
amtString12MMRefund amount.
tipString12OOTip amount
transDateString8-MTransaction date, format: YYYYMMDD
transTimeString6-MTransaction time, format: HHMMSS
operatorString4-Ooperator's work number
authCodeString6-CAuthentication code. This field returns value when card payment transasction.
refNoString12-CRetrieval Reference Number .This field returns value when card payment transasction.
cardNoString19-CCard PAN number, It has been masked according to PCI specification. example: 430277****5723. This field returns value when card payment transasction.
entryModeString2-OThis field returns value when card payment transasction:
1 - Swipe magnetic stripe card
2 - Contact chip card
3 - Contactless chip card
4 - Manual entry input
transactionIDString32-MThe transaction id of CodePay Gateway.
merchantIdString32-CThe merchant no
payChannelMerchantIDString32-CMerchant id of the payment channel,channel example: TSYS,ELAVON
payChannelTerminalIDString32-CTerminal id of the payment channel,channel example: TSYS,ELAVON
merchantNameString128-CThe merchant name

2.3.2 Sample code

Intent intent = new Intent();
intent.setAction("com.codepay.transaction.call");
intent.putExtra("version", "1.0");
intent.putExtra("appId", "{YOUR_APP_ID}");
intent.putExtra("transType", "03"); // Refund transaction
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("originBusinessOrderNo","202202222222");
jsonObject.put("businessOrderNo","202202222233");
jsonObject.put("paymentScenario","1");//Card payment
jsonObject.put("amt","1.2");
intent.putExtra("transData", jsonObject.toString());
} catch (JSONException e) {
e.printStackTrace();
}
startActivityForResult(intent, 1);

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
String result = data.getStringExtra("result");
String resultMsg = data.getStringExtra("resultMsg");
String transData = data.getStringExtra("transData");
if (result.equals("00")){
try {
JSONObject jsonObject = new JSONObject(transData);
String amount = jsonObject.getString("amt");
}catch(JSONException e){
e.printStackTrace();
}
}
}

2.4 Authorization

Authorization transactions are a type of card transaction authorization by which a merchant can ensure that the transaction amount is frozen or held in the customer's account until the transaction is completed.

During the authorization stage, the merchant requests authorization from the customer's bank for a specific amount, which is temporarily frozen if the customer has a sufficient available balance or credit limit in their account. This means that the amount is not actually deducted yet, but the customer cannot use the funds for other purchases during this time.

Authorization is commonly used in those situations where the final transaction amount is uncertain, common in lodging service, rental service, unattended self-service, etc.

2.4.1 Message

Name Type Length Request Response Description
versionStringMMAPI version, fixed value "1.1"
transTypeStringMMThe type code of Authorizaion transaction, Fixed value 04
appIdString18M-The payment app id registered in Codepay Gateway, Please refer to the Payment gateway integration guide
transDataJSONMC
resultString-MRefer to appendix - Transaction result code
resultMsgString-CFailure message

transData field

Name Type Length Request Response Description
businessOrderNoStringMMThe order number of the merchant's point of sale application or business system, it must be unique in its system
paymentMethodString-MPlease refer to Payment method
cardTypeStringM-1 -- DEBIT_CARD
2 -- CREDIT_CARD
3 -- EBT_CARD
4 -- GIFT_CARD
amtString12MMOrder amount
transDateString8-MTransaction date, format: YYYYMMDD
transTimeString6-MTransaction time, format: HHMMSS
operatorString4-Ooperator's work number
authCodeString6-MAuthentication code. This field returns value when card payment transasction.
refNoString12-MRetrieval Reference Number .This field returns value when card payment transasction.
cardNoString19-MCard PAN number, It has been masked according to PCI specification. example: 430277****5723. This field returns value when card payment transasction.
entryModeString2-OThis field returns value when card payment transasction:
1 - Swipe magnetic stripe card
2 - Contact chip card
3 - Contactless chip card
4 - Manual entry input
transactionIDString32-MThe transaction id of CodePay Gateway.
merchantIdString32-CThe merchant no
payChannelMerchantIDString32-CMerchant id of the payment channel,channel example: TSYS,ELAVON
payChannelTerminalIDString32-CTerminal id of the payment channel,channel example: TSYS,ELAVON
merchantNameString128-CThe merchant name
onScreenSignatureBoolean10-true: On-screen signature is required. false: On-screen signature is not required.

2.4.2 Sample code

Intent intent = new Intent();
intent.setAction("com.codepay.transaction.call");
intent.putExtra("version", "1.0");
intent.putExtra("appId", "{YOUR_APP_ID}");
intent.putExtra("transType", "04"); // Authorization transaction
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("businessOrderNo","202202222222");
jsonObject.put("cardType","1");//DEBIT_CARD
jsonObject.put("amt","1.2");
intent.putExtra("transData", jsonObject.toString());
} catch (JSONException e) {
e.printStackTrace();
}
startActivityForResult(intent, 1);

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
String result = data.getStringExtra("result");
String resultMsg = data.getStringExtra("resultMsg");
String transData = data.getStringExtra("transData");
if (result.equals("00")){
try {
JSONObject jsonObject = new JSONObject(transData);
String amount = jsonObject.getString("amt");
}catch(JSONException e){
e.printStackTrace();
}
}
}

2.5 Completion

Completion transaction is the process of requesting the merchant to formally debit the customer's account for the previously authorized amount after the authorization, when the actual consumption of the service or goods is complete and the final amount is determined. This step is a follow-up to the authorization and ensures that the merchant receives the payment.

For example, when a customer checks out of a hotel at the end of their stay, the hotel will compare the previously authorized amount to the actual amount spent; if the actual amount spent is higher, the hotel will request an additional authorization to cover the difference; if the actual amount spent is lower, only the actual amount spent will be deducted, and the remainder of the authorized amount will be released back to the customer's account.

2.5.1 Message

Name Type Length Request Response Description
versionStringMMAPI version, fixed value "1.1"
transTypeStringMMThe type code of Authorizaion Compleation transaction, Fixed value 06
appIdString18M-The payment app id registered in Codepay Gateway, Please refer to the Payment gateway integration guide
transDataJSONMC
resultString-MRefer to appendix - Transaction result code
resultMsgString-CFailure message

transData field

Name Type Length Request Response Description
originBusinessOrderNoString12M-The order number of the original purchase transaction
businessOrderNoStringMMThe order number of the merchant's point of sale application or business system, it must be unique in its system
paymentMethodString-MPlease refer to Payment method
amtString12MMAuthorization confirmation amount, final payment amount, and any excess amount during authorization will be refunded to the customer's account
transDateString8-MTransaction date, format: YYYYMMDD
transTimeString6-MTransaction time, format: HHMMSS
operatorString4-Ooperator's work number
authCodeString6-MAuthentication code. This field returns value when card payment transasction.
refNoString12-MRetrieval Reference Number .This field returns value when card payment transasction.
cardNoString19-MCard PAN number, It has been masked according to PCI specification. example: 430277****5723. This field returns value when card payment transasction.
entryModeString2-OThis field returns value when card payment transasction:
1 - Swipe magnetic stripe card
2 - Contact chip card
3 - Contactless chip card
4 - Manual entry input
transactionIDString32-MThe transaction id of CodePay Gateway.
merchantIdString32-CThe merchant no
payChannelMerchantIDString32-CMerchant id of the payment channel,channel example: TSYS,ELAVON
payChannelTerminalIDString32-CTerminal id of the payment channel,channel example: TSYS,ELAVON
merchantNameString128-CThe merchant name

2.5.2 Sample code

Intent intent = new Intent();
intent.setAction("com.codepay.transaction.call");
intent.putExtra("version", "1.0");
intent.putExtra("appId", "{YOUR_APP_ID}");
intent.putExtra("transType", "06"); // Authorization Completion transaction
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("originBusinessOrderNo","202202222233");
jsonObject.put("businessOrderNo","202202222222");
jsonObject.put("amt","1.2");
intent.putExtra("transData", jsonObject.toString());
} catch (JSONException e) {
e.printStackTrace();
}
startActivityForResult(intent, 1);

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
String result = data.getStringExtra("result");
String resultMsg = data.getStringExtra("resultMsg");
String transData = data.getStringExtra("transData");
if (result.equals("00")){
try {
JSONObject jsonObject = new JSONObject(transData);
String amount = jsonObject.getString("amt");
}catch(JSONException e){
e.printStackTrace();
}
}
}

2.6 Sale with Cashback

"Sale with Cashback" is commonly used in bank card transactions to refer to the ability of a customer to request an additional amount of cash from their bank account in addition to the cost of goods or services when paying for a purchase with a debit card. This service is usually found at the checkout counter of retail stores or supermarkets, where customers can select this option at checkout, thus avoiding the hassle of going to a bank or ATM to withdraw cash.

For example, if you spend $50 on a grocery store purchase and want $20 in cash, you can request a $70 transaction where $50 is paid to the supermarket and the remaining $20 is returned to you as cash. This transaction may appear in your bank account records as "Sale with Cashback" and total $70.

2.6.1 Message

Name Type Length Request Response Description
versionStringMMAPI version, fixed value "1.1"
transTypeStringMMThe type code of Cashback transaction, Fixed value 11
appIdString18M-The payment app id registered in Codepay Gateway, Please refer to the Payment gateway integration guide
transDataJSONMC
resultString-MRefer to appendix - Transaction result code
resultMsgString-CFailure message

transData field

Name Type Length Request Response Description
businessOrderNoStringMMThe order number of the merchant's point of sale application or business system, it must be unique in its system
paymentMethodString-MPlease refer to Payment method
cardTypeStringM-1 -- DEBIT_CARD
2 -- CREDIT_CARD
3 -- EBT_CARD
4 -- GIFT_CARD
amtString12MMOrder amount
cashAmountString12MMCashback amount
tipString12OOTip amount
transDateString8-MTransaction date, format: YYYYMMDD
transTimeString6-MTransaction time, format: HHMMSS
operatorString4-Ooperator's work number
authCodeString6-MAuthentication code. This field returns value when card payment transasction.
refNoString12-MRetrieval Reference Number .This field returns value when card payment transasction.
cardNoString19-MCard PAN number, It has been masked according to PCI specification. example: 430277****5723. This field returns value when card payment transasction.
entryModeString2-OThis field returns value when card payment transasction:
1 - Swipe magnetic stripe card
2 - Contact chip card
3 - Contactless chip card
4 - Manual entry input
transactionIDString32-MThe transaction id of CodePay Gateway.
merchantIdString32-CThe merchant no
payChannelMerchantIDString32-CMerchant id of the payment channel,channel example: TSYS,ELAVON
payChannelTerminalIDString32-CTerminal id of the payment channel,channel example: TSYS,ELAVON
merchantNameString128-CThe merchant name
onScreenTipBoolean10-true: On-screen tip is required. false: On-screen tip is not required.
onScreenSignatureBoolean10-true: On-screen signature is required. false: On-screen signature is not required.

2.6.2 Sample code

Intent intent = new Intent();
intent.setAction("com.codepay.transaction.call");
intent.putExtra("version", "1.0");
intent.putExtra("appId", "{YOUR_APP_ID}");
intent.putExtra("transType", "11"); // Cashback transaction
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("businessOrderNo","202202222222");
jsonObject.put("cardType","1");//Debit
jsonObject.put("amt","10.2");
jsonObject.put("cashAmount","1.2");
intent.putExtra("transData", jsonObject.toString());
} catch (JSONException e) {
e.printStackTrace();
}
startActivityForResult(intent, 1);

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
String result = data.getStringExtra("result");
String resultMsg = data.getStringExtra("resultMsg");
String transData = data.getStringExtra("transData");
if (result.equals("00")){
try {
JSONObject jsonObject = new JSONObject(transData);
String amount = jsonObject.getString("amt");
}catch(JSONException e){
e.printStackTrace();
}
}
}

2.7 Query

Query details of a specified transaction

2.7.1 Message

Name Type Length Request Response Description
versionStringMMAPI version, fixed value "1.1"
transTypeStringMMThe type code of Query transaction, Fixed value 21
appIdString18M-The payment app id registered in Codepay Gateway, Please refer to the Payment gateway integration guide
transDataJSONMC
resultString-MRefer to appendix - Transaction result code
resultMsgString-CFailure message

transData field

Name Type Length Request Response Description
businessOrderNoStringMMThe order number of the merchant's point of sale application or business system, it must be unique in its system
paymentScenarioString-M1 - card payment
2 - cash payment
3 - QR code payment, merchant present code and customers scan it
4 - QR code payment, customers present code and merchant scan it
paymentMethodString-MSpecify a Payment method. This field is mandatory only when "paymentScenario" is set to "3" or "4".
Please refer to Payment method
amtString12-MOrder amount
cashAmountString12-OCashback amount
tipString12-OTip amount
transDateString8-MTransaction date, format: YYYYMMDD
transTimeString6-MTransaction time, format: HHMMSS
operatorString4-Ooperator's work number
authCodeString6-CAuthentication code. This field returns value when card payment transasction.
transTypeString2-MType of transaction queried
refNoString12-CRetrieval Reference Number .This field returns value when card payment transasction.
cardNoString19-CCard PAN number, It has been masked according to PCI specification. example: 430277****5723. This field returns value when card payment transasction.
entryModeString2-OThis field returns value when card payment transasction:
1 - Swipe magnetic stripe card
2 - Contact chip card
3 - Contactless chip card
4 - Manual entry input
transactionIDString32-MThe transaction id of CodePay Gateway.
merchantIdString32-CThe merchant no
payChannelMerchantIDString32-CMerchant id of the payment channel,channel example: TSYS,ELAVON
payChannelTerminalIDString32-CTerminal id of the payment channel,channel example: TSYS,ELAVON
merchantNameString128-CThe merchant name

2.7.2 Sample code

Intent intent = new Intent();
intent.setAction("com.codepay.transaction.call");
intent.putExtra("version", "1.0");
intent.putExtra("appId", "{YOUR_APP_ID}");
intent.putExtra("transType", "21");
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("businessOrderNo","202202222222");
intent.putExtra("transData", jsonObject.toString());
} catch (JSONException e) {
e.printStackTrace();
}
startActivityForResult(intent, 1);

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
String result = data.getStringExtra("result");
String resultMsg = data.getStringExtra("resultMsg");
String transData = data.getStringExtra("transData");
if (result.equals("00")){
try {
JSONObject jsonObject = new JSONObject(transData);
String amount = jsonObject.getString("amt");
}catch(JSONException e){
e.printStackTrace();
}
}
}

2.8 Reprint

Reprint the specified transaction. It will be marked "Reprint" in the receipt.

2.8.1 Message

Name Type Length Request Response Description
versionStringMMAPI version, fixed value "1.1"
transTypeStringMMThe type code of Reprint transaction, Fixed value 22
appIdString18M-The payment app id registered in Codepay Gateway, Please refer to the Payment gateway integration guide
transDataJSONMC
resultString-MRefer to appendix - Transaction result code
resultMsgString-CFailure message

transData field

Name Type Length Request Response Description
businessOrderNoStringM-The order number of the merchant's point of sale application or business system, it must be unique in its system

2.8.2 Sample code

Intent intent = new Intent();
intent.setAction("com.codepay.transaction.call");
intent.putExtra("version", "1.0");
intent.putExtra("appId", "{YOUR_APP_ID}");
intent.putExtra("transType", "22");
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("businessOrderNo","202202222222");
intent.putExtra("transData", jsonObject.toString());
} catch (JSONException e) {
e.printStackTrace();
}
startActivityForResult(intent, 1);

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
String result = data.getStringExtra("result");
String resultMsg = data.getStringExtra("resultMsg");
String transData = data.getStringExtra("transData");
if (result.equals("00")){
try {
JSONObject jsonObject = new JSONObject(transData);
String amount = jsonObject.getString("amt");
}catch(JSONException e){
e.printStackTrace();
}
}
}

3. Appendix

3.1 Transaction result code

Category Result Code Description
Sucess00Transaction approved
Terminal kernel exceptionA003There is no EMV application in card
A008Transaction has been rejected
A020IC command failed
A0362 GAC Failed
A040Init SDK failed
Card recognizing exceptionC000Read card exception
C001Swipe card failed
C004Read card failed
C006Card conflict
C008IC card not allow swipe first
C009Read card time out
C011Track key not found
C014Mag-stripe mode contactless transaction not supported
Pin-pad exceptionG000PinPad exception
G003Enter pin canceled
G004Enter pin timeout
G005Enter pin failed
Package exceptionH010Mac Error
H011Signature verification fails
Network exceptionJ000Network exception
J002Network connection timeout
J003Network connect failed
J004Send data failed
J005Read data failed
J006Read data timeout
Transaction exceptionK018Use the same card as the original transaction
K019No data to be settled
K026Manual cancelation by operator
K027Transaction timeout
K029Low battery!
Third app invoking exceptionM002Parameter error
M003Invalid Amount
M007This function is not supported now
M008The invoke version is incorrect
M009Invalid application invoke
M010Can`t find original transaction
M011The original transaction cannot be void
M013The original transaction cannot be refund
M014The original transaction cannot be completion
Server exceptionN002CodePay service request exception
N003Acquire service request exception
User exception P001Incorrect account or password, please try again
P002The account is locked and cannot be logged in
Init exceptionQ001System time error, please connect the network to get the time automatically!
Q002AID is not configured
Q003Payment is not configured.Please contact support.
Other exceptionZ000Exception occurred. Further investigation required by technical support.