BCVN-EDCC - API Programming Guide v1.1.3 (EN)
BCVN-EDCC - API Programming Guide v1.1.3 (EN)
1.2 History
Term Description
EDC Electronic Data Capture
EDCC EDC Controller
ECR Electronic Cash Register
REQMsg Request Message
BCCard Vietnam-EDC CONTROLLER – API Programming Guide
2 Introduction
3 Function Specification
3.1 Overview
• EDCC decodes and validates data. If the data is valid, then EDCC
analyzes the REQMsg to extract the EDC information that the
transaction needs to send.
• EDCC records the transaction and forwards the result to the merchant
application server.
In order to send a request message from the ECR to EDCC, the ECR (3rd
application) should be generated by EDCC and assigned a pair of
identifiers and a {3-Id, 3rd-Key} pair. In this, the 3rd-Id is used to
identify the ECR and 3rd-Key applications is used to encrypt and
decrypt data during the exchange with EDCC. The message exchanges
between the Application Server and EDCC before encoding is organized in
JSON format. The path for calling the EDCC service like this:
ROOT-URL/API-INDICATOR/REQUEST-MESSAGE
For services that use the POST method to send a request to EDCC, the
send-message must be packaged in the following format:
• = {"KEY": "ThirdPartyID", "VALUE": "MessageContent"}
o KEY: is 3rd-Id
o VALUE: is the encrypted string of message content. This
message needs to be processed with 3rd-Key. Depending on the
type of transaction, the content of the message to be
processed will be different. This content is also formatted
using a JSON string with key-value pairs matching every
transaction.
3.6 SALE
3.7 VOID
• Response Step 1:
{
"RESULT": "Y",
"RESPONSE_CODE": "7000",
"DESCRIPTION": "Processing ... ",
"KEY": "0EF60A8890F44EBA8F68EB4BDC92F73B"
}
• Request Step 2: Continue sending a check result request with KEY
is the KEY that receive from the response in step 1. (See 3.9)
{
"EVENT": "CHECK_RESULT",
"KEY": "0EF60A8890F44EBA8F68EB4BDC92F73B"
}
• Response Step 2: Returns the VOID transaction result associated
with the CHECK RESULT transaction, in the form of an encrypted
JSON that has the following contents:
{
"APP": "PAYMENT_STD ",
"RESULT": "Y",
"RESPONSE_CODE": "00",
"DESCRIPTION": "Transaction was processed
successfully.",
"MERCHANT_CODE": "312948798231748 ",
"TERMINAL_ID": "98719284",
"CURRENCY_CODE": "704",
"REF_ID": "77770001",
"SERIAL_NUMBER": "3J125611",
"AMOUNT": "000015000000",
"EVENT": "VOID",
"PAN": "483542******0348",
"NAME": "VISA CARDHOLDER",
"REF_NO": "834473175214",
"APPV_CODE": "779848",
"CARD_TYPE": "VISA",
"INVOICE": "000010",
"DATE": "0301",
"TIME": "150932",
"ADD_PRINT": "",
"ADD_DATA": "",
"ORDER_ID": "",
"STAFF_ID": ""
}
3.8 SETTLEMENT
CLIENT_ID
Note: In case EDC has more than one Acquirer, EDC performs Settlement
for each Acquirer. Upon completion, the EDC prepares the results of the
entire Settlement transaction in the following format: Settlement
information of each Acquirer separated by "~" and content of each data
field separated by " # ". As follows:
• SETTLE_DATA Format:
TerminalID-1#MerchantID-1#DateTime-1#SaleTransNo-1#SaleAmt-
1#RefundTransNo-1 #RefundAmt-1#VoidSaleTransNo-1#VoidSaleTransAmt-
1#VoidRefundTransNo-1 #VoidRefundTransAmt-1~TerminalID-2#MerchantID-
2#DateTime-2
#SaleTransNo-2#SaleAmt-2#RefundTransNo-2#RefundAmt-2 #VoidSaleTransNo-
2#VoidSaleTransAmt-2#VoidRefundTransNo-2 #VoidRefundTransAmt-2~...
• Example:
99999999#999999999999999#20170822122153#6#000000120000
#0#000000000000#0#000000000000#0#000000000000~
00000000#123456789012345#20170822122153#1#000000000100#0#000000000000#0
#000000000000#0#000000000000
• In the event, the result of the transaction returns ECR and EDCC
continue to receive the CHECK_RESULT request with the old key, EDCC
will return the error code RESPONSE_CODE = 9995. Thus, the KEY is
valid only when the transaction is in the state of affairs.
Management and transaction results are only returned once for ECR.
• Function: Used to lay out the EDCs that are calling to EDCC
corresponding to MERCHANT_ID and MERCHANT_OUTLET_ID.
• http://ROOT-URL/API-INDICATOR/
• Method: POST
• Request: Same as described in section 3.3. Where the content of the
request message is a JSON string as follows:
{
"EVENT": "CONN",
"MERCHANT_OUTLET_ID": "000000000000000071000",
"MERCHANT_ID": "000000000070000",
"CLIENT_ID": "1111"
}
Response: Returns the total number of transactions that meet the search
criteria.
{
"RESULT": "Y",
"RESPONSE_CODE": "00",
"DESCRIPTION": "Transaction was processed successfully .",
"TOTAL_PAGE": 1,
"PAGE_INDEX": 1,
"TOTAL_ROW": 3,
"TRANX":[
{
"RESPONSE_CODE": "00",
"CARD_TYPE": "VISA",
"TIME": "155951",
"INVOICE": "000007",
"CURRENCY_CODE": "704",
"NAME": "VISA CARDHOLDER",
"TRANX_TYPE": "SALE",
Version 1.1.3 [EN] Page 25 of 38
BCCard Vietnam-EDC CONTROLLER – API Programming Guide
"DATE":"0301",
"AMOUNT": "000015000000",
"REF_NO": "997826890668",
"APPV_CODE": "153714",
"MERCHANT_OUTLET_ID": "432134143141243143124",
"MERCHANT_ID": "313131313133143",
"CLIENT_ID": "1111",
"TERMINAL_ID": "98719284",
"MERCHANT_CODE": "312948798231748",
"REF_ID": "77770001",
"ADD_PRINT": "MSSV_NGUYEN VAN A",
"ADD_DATA": "",
"ORDER_ID": "",
"STAFF_ID": ""
},
{
"RESPONSE_CODE": "00",
"CARD_TYPE": "VISA",
"TIME": "155922",
"INVOICE": "000006",
"CURRENCY_CODE": "704",
"NAME": "VISA CARDHOLDER",
"TRANX_TYPE": "SALE",
"DATE": "0301",
"AMOUNT": "000015000000",
"REF_NO": "665537444609",
"APPV_CODE": "478239",
"MERCHANT_OUTLET_ID": "432134143141243143124",
"MERCHANT_ID": "313131313133143",
"CLIENT_ID": "1111",
"TERMINAL_ID": "98719284",
"MERCHANT_CODE": "312948798231748",
"REF_ID": "77770001",
"ADD_PRINT": "",
"ADD_DATA": "",
"ORDER_ID": "",
"STAFF_ID": ""
},
{
"RESPONSE_CODE": "00",
"CARD_TYPE": "DEBIT",
"TIME": "152241",
"INVOICE": "000004",
"CURRENCY_CODE": "704",
"NAME": "TEST CARD",
"TRANX_TYPE": "VOID",
"DATE": "0301",
"AMOUNT": "000015000000",
"REF_NO": "148577140922",
"APPV_CODE": "996979",
"MERCHANT_OUTLET_ID ": "432134143141243143124",
"MERCHANT_ID": "313131313133143",
"CLIENT_ID": "1111",
"TERMINAL_ID": "92184124",
"MERCHANT_CODE": "432524525425432",
Version 1.1.3 [EN] Page 26 of 38
BCCard Vietnam-EDC CONTROLLER – API Programming Guide
"REF_ID": "77770001",
"ADD_PRINT": "",
"ADD_DATA": "",
"ORDER_ID": "",
"STAFF_ID": ""
}
]
}
3.13 QR Code
The size and type of each QR Code transaction field are shown in Table
14
$2.35 → 000000000235
CURRENCY_CODE String FIXED 3 M VND: 704, USD: 840
STAFF_ID String MAX 8 O
ADD_PRINT String MAX 100 O Destination account, using
to print account number
below the QR Code.
ADD_DATA String MAX 100 O Content tranfer
ORDER_ID String MAX 100 O
MERCHANT_OUTLET_ID String FIXED 21 M
MERCHANT_ID String FIXED 15 M
CLIENT_ID String FIXED 4 M
PRIORITY String FIXED 8 M Hard Coding "BankPlus"
VERSION String FIXED 3 M Hard Coding "1.0"
TYPE String FIXED 9 M Hard Coding "PAY_ORDER"
BILLCODE String MAX 50 M
MERCHANT_CODE String FIXED 12 M Hard Coding "BCCARD_VCB"
"VERSION": "1.0",
"TYPE": "PAY_ORDER",
"BILLCODE": "TH3232323",
"ADD_PRINT": "",
"ADD_DATA": "",
"ORDER_ID": "",
"STAFF_ID": ""
}
Listing 19: QR Code Response Message
"APPV_CODE": "00",
"CARD_TYPE": "VISA",
"INVOICE": "0000005",
"DATE": "2409",
"TIME": "1525",
"ADD_PRINT": "",
"ORDER_ID": "",
"MERCHANT_NAME": "",
"MERCHANT_ADD": ""
}
Listing 23: Print Receipt Response Message
4 Encrypt/Decrypt Message
import org.jpos.iso.ISOUtil;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.StandardCharsets;
array = memoryStream.ToArray();
}
}
}
return BitConverter.ToString(array).Replace("-", "").ToLower();
}