Info |
---|
See Cancellation Service on the Amadis Wiki for more information about the Cancellation Service. |
...
Below is an example derived from a cancellation of an original transaction(payment).
Code Block |
---|
PaymentResult result;
result = arkos.doPayment(arkosConfig.AsBytes(), paymentParams.AsBytes()); //In your payment function
paymentParams.AddAscii(ArkosTags.ReferenceData,result.trxReference); //In your cancellation function |
Below is an example derived from a cancellation of an original transaction(payment).
Code Block |
---|
PaymentResult result; result = arkos.doPayment(arkosConfig.AsBytes(), paymentParams.AsBytes()); //In your payment function paymentParamspublic static PaymentParams createReversal(String trxReference) { PaymentParams params = new PaymentParams(PaymentServiceID.Cancellation); TlvTree originalTransaction = params.AddChild(ArkosTags.OriginalTransaction); originalTransaction.AddEMVDate(ArkosTags.TransactionDate, cal.get(Calendar.YEAR) % 100, cal.get(Calendar.MONTH) + 1, cal.get(Calendar.DAY_OF_MONTH)); originalTransaction.AddEMVTime(ArkosTags.TransactionTime, cal.get(Calendar.HOUR), cal.get(Calendar.MINUTE), cal.get(Calendar.SECOND)); originalTransaction.AddAscii(ArkosTags.ReferenceData,result.trxReference"1234567890"); //In your cancellation function |
Below is an example derived from a cancellation of an original transaction(payment).
Code Block |
---|
paymentParams originalTransaction.AddEnum(ArkosTags.SelectedService, PaymentServiceID.Payment); params .AddBin(ArkosTags.TransactionAmount, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x200x00, 0x00 }); paymentParams params .AddBin(ArkosTags.AmountAuthorised, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x200x00, 0x00 }); params paymentParams.AddBin(ArkosTags.TransactionAmountBeforeAdjustment, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x200x00, 0x00 }); TlvTree originalTransaction = paymentParams.AddChild(ArkosTags.OriginalTransaction); return params; } |
It is to be noted that, upon carrying out a cancellation/reversal, the transaction reference is now set under the TlvTree Original Transaction.
It is mandatory to include the original transaction date, time, and service( which will always be payment and will later be overridden by the value we get from the batch for the corresponding transaction reference number).
Code Block |
---|
originalTransaction.AddEMVDate(ArkosTags.TransactionDate, cal.get(Calendar.YEAR) % 100, cal.get(Calendar.MONTH) + 1, cal.get(Calendar.DAY_OF_MONTH)); originalTransaction.AddEMVTime(ArkosTags.TransactionTime, cal.get(Calendar.HOUR), cal.get(Calendar.MINUTE), cal.get(Calendar.SECOND)); originalTransaction.AddBin(ArkosTags.LocalTimezone, utcOffset); originalTransaction.AddAscii(ArkosTags.ReferenceData,"1234567890"); originalTransaction.AddEnum(ArkosTags.SelectedService, PaymentServiceID.Payment); paymentParams.AddAscii(ArkosTags.ReferenceData, |
trxReference
= "1234567890"
...
in our example.