Amadis

Merchant confirmation of a partially approved transaction

The Request Partially Approved Transaction Confirmation Function is used in case of partial authorization to make the attendant and the cardholder aware that the amount is partially approved and that the cardholder must pay an additional amount.

 

How to configure for partial approval?

In Application Profile Settings (APS), Tag: DF27 set byte 3 bit 6 to 1.

NOTE: This tag is found in the E6 template.

From the above corresponding nexo FAST flow, the amount left to be paid, requested amount and transaction amount can be accessed from the following functions:

 

@Override public void cardholderDisplay(int i, DisplayParams displayParams, byte[] bytes) { }

 

From cardholder Display callback, the byte[] bytes is the transaction context. We first create a Tlv tree from the transaction context and then, the following three functions are called when callback LeftToBePaid is called.

 

Tlvtree inner = TlvTree.FromRaw(bytes); private Integer requestedAmount; private Integer amount; public Integer getAmount() { byte[] amountBCD = inner.GetElementValue(ArkosTags.TransactionAmount); if(null != amountBCD) { amount = ArkosUtils.AmountBcdToInt(amountBCD); return amount; } return null; } public Integer getRequestedAmount() { byte[] amountBCD = inner.GetElementValue(ArkosTags.RequestedAmount); if(null != amountBCD) { requestedAmount = ArkosUtils.AmountBcdToInt(amountBCD); return requestedAmount; } return null; } public Integer getLeftToPay() { return requestedAmount - amount; }

Note: Amount corresponds to transaction amount of nexo FAST.

Below is an example.

 

public static Integer AmountBcdToInt(byte[] amountBytes) { if(amountBytes != null && amountBytes.length <= 6) { int amount = 0; for (int i = 0; i < 6; i++) { amount *= 100; amount += BcdToInt(amountBytes[i]); } return amount; } Log.e("ArkosUtils", "AmountBcdToInt Failed: Invalid Param"); return null; }

Note: This is the conversion of BCD to integer

The public boolean merchantConfirmPartiallyApprovedTransaction(DisplayParams displayParams, byte[] bytes) callback will be explain in the section below.

It is to be noted that same thing has to be done for this callback as done show before.