...
...
Based on your protocol, acquirer, or your transaction context, some of the following values could be mandatory as well as required.
This document applies to the Nexo version of the original transaction.
...
If you need specific values in your original transaction structures, an example will be provided below.
It is to be noted that our implementation of NOTE: If the original transaction structure differs in the TransactionIdentification section.
...
we decided to put the transactionReference and transactionDateTime directly in the OriginalTransaction DO to avoid unnecessary complexity.
Besides that, the same structure has been implemented and an example as mentioned above will be found belowis retrieved from the database, the values will be overwritten.
Code Block |
---|
public static void createOriginalTransaction(PaymentParams params, String transactionReference, PaymentServiceID serviceID){
TlvTree originalTrx = params.paramTree.AddChild(ArkosTags.OriginalTransaction);
originalTrx.AddAscii(ArkosTags.SaleReferenceIdentification,"saleReferenceIdentification");
//Date //Time //Timezone
Calendar cal = Calendar.getInstance();
int utcOffsetMinutes = cal.getTimeZone().getOffset(cal.getTimeInMillis()) / 1000 / 60;
byte[] utcOffset = new byte[2];
utcOffset[0] = (byte) (utcOffsetMinutes / 60);
utcOffset[1] = (byte) (utcOffsetMinutes % 60);
originalTrx.AddEMVDate(TransactionIdentificationID.Date, cal.get(Calendar.YEAR) % 100, cal.get(Calendar.MONTH) + 1, cal.get(Calendar.DAY_OF_MONTH));
originalTrx.AddEMVTime(TransactionIdentificationID.Time, cal.get(Calendar.HOUR), cal.get(Calendar.MINUTE), cal.get(Calendar.SECOND));
originalTrx.SetBin(ArkosTags.LocalTimezone, utcOffset);
originalTrx.AddAscii(TransactionIdentificationID.ReferenceData, transactionReference);
TlvTree poiIdentification = originalTrx.AddChild(ArkosTags.PoiIdentification);
poiIdentification.AddAscii(POIIdentificationID.TerminalIdentification,"Terminal1");
poiIdentification.AddEnum(POIIdentificationID.Type, POIIdentificationTypeID.ACCP);
poiIdentification.AddEnum(POIIdentificationID.Issuer, POIIdentificationIssuerID.ACCP);
poiIdentification.AddAscii(POIIdentificationID.ShortName,"Term");
originalTrx.AddAscii(ArkosTags.InitiatorTransactionIdentification,"InitiatorTransactionIdentification");
originalTrx.AddAscii(ArkosTags.RecipientTransactionIdentification,"RecipientTransactionIdentification");
originalTrx.AddEnum(ArkosTags.SelectedService, serviceID);
originalTrx.AddEnum(ArkosTags.TechnologySelected, SelectedTechnologyID.MagneticStripe);
// originalTrx.AddBin(ArkosTags.CashbackPresent, new byte[]{0x01});
// originalTrx.AddBin(ArkosTags.SupplementaryAmountPresent, new byte[]{0x01});
TlvTree transactionResult = originalTrx.AddChild(ArkosTags.TransactionResult);
TlvTree authorisationEntity = transactionResult.AddChild(TransactionResultID.AuthorisationEntity);
authorisationEntity.AddAscii(AuthorisationEntityID.AuthorisationEntityIdentification,"Identification");
authorisationEntity.AddEnum(AuthorisationEntityID.AuthorisationEntityType, AuthorisationEntityTypeID.ACCP);
authorisationEntity.AddEnum(AuthorisationEntityID.AuthorisationEntityIssuer, AuthorisationEntityIssuerID.ACCP);
authorisationEntity.AddAscii(AuthorisationEntityID.AuthorisationEntityCountry,"Cou");
authorisationEntity.AddAscii(AuthorisationEntityID.AuthorisationEntityShortName,"ShortName");
TlvTree responseToAuthorisation = transactionResult.AddChild(TransactionResultID.ResponseToAuthorisation);
responseToAuthorisation.AddEnum(ResponseToAuthorisationID.Response, ResponseID.APPR);
responseToAuthorisation.AddAscii(ResponseToAuthorisationID.ResponseReason,"Reason");
responseToAuthorisation.AddAscii(ResponseToAuthorisationID.AdditionalResponseInformation,"AdditionalInformation");
transactionResult.AddAscii(TransactionResultID.AuthorisationCode,"000001");
} |
NOTE: If your original transaction is of type payment, you can add those two tags if you want to include the presence of cashback or supplementary amount.
Code Block |
---|
// originalTrx.AddBin(ArkosTags.CashbackPresent, new byte[]{0x01}); // originalTrx.AddBin(ArkosTags.SupplementaryAmountPresent, new byte[]{0x01}); |
...
Code Block |
---|
public static PaymentParams CreateReversal(String transactionReference) { PaymentParams params = new PaymentParams(); setTerminalInfo(params); //service params.paramTree.AddEnum(ArkosTags.SelectedService, PaymentServiceID.Cancellation); createOriginalTransaction(params,transactionReference,PaymentServiceID.Payment); byte[] bcdAmount = IntToBCD(0); if (bcdAmount == null) { return null; } params.paramTree.AddBin(TransactionAmount, bcdAmount); params.paramTree.AddBin(AmountAuthorised, bcdAmount); params.paramTree.AddBin(TransactionAmountBeforeAdjustment, bcdAmount); return params; } |
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|