Activate Transaction
- VP3300 Initiates a CTLS transaction
Use this command when the ctls reader is in “Poll on Demand” mode to begin an EMV or contactless MagStripe Card transaction. When the reader is in “Poll on Demand” mode, the RF is turned on only after receiving an Activate Transaction command. When a valid Activate Transaction command is sent to the ctls reader, it starts polling for cards.
If the ctls reader does not find a supported card (an AID that matches one of the configured AIDs in the reader) for the specified time duration, it times out and ends the transaction. If the ctls reader finds a card within the specified time interval, it attempts to carry out the transaction. The transaction flow between the reader and the card depends on the type of card detected.
If the transaction is successful, the reader returns the data in CTLSResponse. If the transaction is not successful, yet it proceeded into the transaction state machine, the reader returns a Failed Transaction Record in the response data. The presence and format of the Clearing Record, Track Data and Failed Transaction record depends on the type of card that was detected.
Note: While an Activate command is in progress, only a Cancel may be sent. Do not send other commands until Activate Transaction has completed, because the reader will interpret these as a Cancel Transaction command.
- Parameters
-
tags | Activate TLV tags |
timeout | Timeout value in seconds. |
Activate TVL Tag | Description | Format | Length |
9A | Transaction Date | n6 (YYMMDD) | 3 |
9C | Transction Type | n2 | 2 |
5F2A | Transaction Currency Code | n2 | 2 |
5F36 | Transaction Currency Exponent | n1 | 1 |
9F02 | Amount, Authorized | n12 | 6 |
9F03 | Amount Other | n12 | 6 |
9F1A | Terminal Country Code | n3 | 2 |
9F21 | Transaction Time | n6 (HHMMSS} | 3 |
9F5A | Terminal Transaction Type | b | 1 |
Transaction Types: 0x00 = Purchase Goods/Services, 0x20 = Refund Terminal Transaction Type (Interac) 0x00 = Purchase, 0x01 = Refund
- Returns
- RETURN_CODE:
- 0x0000: Success: no error - RETURN_CODE_DO_SUCCESS
- 0x0001: Disconnect: no response from reader - RETURN_CODE_ERR_DISCONNECT
- 0x0002: Invalid Response: invalid response data - RETURN_CODE_ERR_CMD_RESPONSE
- 0x0003: Timeout: time out for task or CMD - RETURN_CODE_ERR_TIMEDOUT
- 0x0004: Invalid Parameter: wrong parameter - RETURN_CODE_ERR_INVALID_PARAMETER
- 0x0005: MSR Busy: SDK is doing MSR or ICC task - RETURN_CODE_SDK_BUSY_MSR
- 0x0006: PINPad Busy: SDK is doing PINPad task - RETURN_CODE_SDK_BUSY_PINPAD
- 0x0007: Unknown: Unknown error - RETURN_CODE_ERR_OTHER
- 0xFF00: Accept the online transaction RETURN_CODE_EMV_APPROVED
- 0xFF01: Decline the online transaction RETURN_CODE_EMV_DECLINED
- 0xFF02: Request to go online RETURN_CODE_EMV_GO_ONLINE
- 0xFF03: Transaction is terminated RETURN_CODE_EMV_FAILED
- 0xFF05: ICC format error or ICC missing data error RETURN_CODE_EMV_SYSTEM_ERROR
- 0xFF07: ICC didn't accept transaction RETURN_CODE_EMV_NOT_ACCEPTED
- 0xFF0A: Application may fallback to magstripe technology RETURN_CODE_EMV_FALLBACK
- 0xFF0C: Transaction was cancelled RETURN_CODE_EMV_CANCEL
- 0xFF0D: Timeout RETURN_CODE_EMV_TIMEOUT
- 0xFF0F: Other EMV Error RETURN_CODE_EMV_OTHER_ERROR
- 0xFF10: Accept the offline transaction RETURN_CODE_EMV_OFFLINE_APPROVED
- 0xFF11: Decline the offline transaction RETURN_CODE_EMV_OFFLINE_DECLINED
- Converting TLV to NSMutableDictionary
EMV data is received in TLV (Tag, Length, value) format: 950500000080009B02E8009F2701018A025A339F26080C552B9364D55CE5
This data contains the following EMV tags/values:
Tag | Length | Value |
9502 | 06 | 000000001995 |
9A | 03 | 140530 |
9C | 01 | 00 |
An example how to create an NSMutableDictionary with these values follows.
-(NSMutableDictionary*) createTLVDict{
NSMutableDictionary *emvTags = [[NSMutableDictionary alloc] initWithCapacity:0];
[emvTags setObject:@"000000001995" forKey:@"9502"];
[emvTags setObject:@"140530" forKey:@"9A"];
[emvTags setObject:@"00" forKey:@"9C"];
return emvTags;
}