Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

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
titleAcceptorCancellationRequest

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:caaa.005.001.06">
  <AccptrCxlReq>
    <Hdr>
      <MsgFctn>CCAQ</MsgFctn>
      <PrtcolVrsn>6.0</PrtcolVrsn>
      <XchgId>18</XchgId>
      <CreDtTm>2022-02-22T00:54:05.000+00:00</CreDtTm>
      <InitgPty>
        <Id>Amadis</Id>
      </InitgPty>
      <RcptPty>
        <Id>Amadis</Id>
      </RcptPty>
    </Hdr>
    <CxlReq>
      <Envt>
        <Acqrr>
          <Id>
            <Id>10009287351</Id>
          </Id>
          <ParamsVrsn>2022-02-22 16:58:09</ParamsVrsn>
        </Acqrr>
        <Mrchnt>
          <Id>
            <Id>00000NEXOMER001</Id>
          </Id>
          <CmonNm>AMADIS 1111 Saint-Urbain Montréal</CmonNm>
        </Mrchnt>
        <POI>
          <Id>
            <Id>ASA00002</Id>
          </Id>
          <Cpblties>
            <CardRdngCpblties>PHYS</CardRdngCpblties>
            <CardRdngCpblties>MGST</CardRdngCpblties>
            <CardRdngCpblties>CICC</CardRdngCpblties>
            <CardRdngCpblties>ECTL</CardRdngCpblties>
            <CrdhldrVrfctnCpblties>FCPN</CrdhldrVrfctnCpblties>
            <CrdhldrVrfctnCpblties>MNSG</CrdhldrVrfctnCpblties>
            <CrdhldrVrfctnCpblties>FEPN</CrdhldrVrfctnCpblties>
            <ApprvlCdLngth>6</ApprvlCdLngth>
            <OnLineCpblties>SMON</OnLineCpblties>
            <MsgCpblties>
              <Dstn>CRCP</Dstn>
              <Dstn>MDSP</Dstn>
              <Dstn>MRCP</Dstn>
              <AvlblLang>en</AvlblLang>
              <AvlblLang>fr</AvlblLang>
              <AvlblLang>it</AvlblLang>
            </MsgCpblties>
          </Cpblties>
          <Cmpnt>
            <Tp>TERM</Tp>
            <Id>
              <PrvdrId>Google</PrvdrId>
              <Id>sdk_gphone_x86_arm</Id>
              <SrlNb>ArkosPay DEMOSN00</SrlNb>
            </Id>
            <Sts />
          </Cmpnt>
          <Cmpnt>
            <Tp>APLI</Tp>
            <Id>
              <PrvdrId>AMADIS</PrvdrId>
              <Id>ARKOS</Id>
            </Id>
            <Sts>
              <VrsnNb>3.0.8-dev-stub</VrsnNb>
            </Sts>
          </Cmpnt>
        </POI>
        <Card>
          <CardPdctPrfl>90</CardPdctPrfl>
          <CardBrnd>STANDARD</CardBrnd>
        </Card>
      </Envt>
      <Cntxt>
        <PmtCntxt>
          <CardPres>false</CardPres>
          <CrdhldrPres>false</CrdhldrPres>
          <AttndncCntxt>ATTD</AttndncCntxt>
          <CardDataNtryMd>DFLE</CardDataNtryMd>
        </PmtCntxt>
      </Cntxt>
      <Tx>
        <TxCaptr>false</TxCaptr>
        <MrchntCtgyCd>5555</MrchntCtgyCd>
        <TxId>
          <TxDtTm>2022-02-22T00:54:05.000+00:00</TxDtTm>
          <TxRef>00000009</TxRef>
        </TxId>
        <OrgnlTx>
          <SaleRefId>saleReferenceIdentification</SaleRefId>
          <TxId>
            <TxDtTm>2022-02-22T00:54:05.000-05:00</TxDtTm>
            <TxRef>0000000008</TxRef>
          </TxId>
          <POIId>
            <Id>Terminal1</Id>
            <Tp>ACCP</Tp>
            <Issr>ACCP</Issr>
            <ShrtNm>Term</ShrtNm>
          </POIId>
          <InitrTxId>InitiatorTransactionIdentification</InitrTxId>
          <RcptTxId>RecipientTransactionIdentification</RcptTxId>
          <TxTp>CRDP</TxTp>
          <CardDataNtryMd>MGST</CardDataNtryMd>
          <TxRslt>
            <AuthstnNtty>
              <Id>Identification</Id>
              <Tp>ACCP</Tp>
              <Issr>ACCP</Issr>
              <Ctry>Cou</Ctry>
              <ShrtNm>ShortName</ShrtNm>
            </AuthstnNtty>
            <RspnToAuthstn>
              <Rspn>APPR</Rspn>
              <RspnRsn>Reason</RspnRsn>
              <AddtlRspnInf>AdditionalInformation</AddtlRspnInf>
            </RspnToAuthstn>
            <AuthstnCd>000001</AuthstnCd>
          </TxRslt>
        </OrgnlTx>
        <RcncltnId>4</RcncltnId>
        <TxDtls>
          <Ccy>EUR</Ccy>
          <TtlAmt>0.00</TtlAmt>
        </TxDtls>
      </Tx>
    </CxlReq>
  </AccptrCxlReq>
</Document>

Expand
titleAcceptorCancellationResponse

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:caaa.006.001.06">
  <AccptrCxlRspn>
    <Hdr>
      <MsgFctn>CCAP</MsgFctn>
      <PrtcolVrsn>6.0</PrtcolVrsn>
      <XchgId>18</XchgId>
      <CreDtTm>2022-02-22T17:54:05.738+00:00</CreDtTm>
      <InitgPty>
        <Id>Amadis</Id>
      </InitgPty>
      <RcptPty>
        <Id>Amadis</Id>
      </RcptPty>
    </Hdr>
    <CxlRspn>
      <Envt>
        <AcqrrId>
          <Id>10009287351</Id>
        </AcqrrId>
        <MrchntId>
          <Id>00000NEXOMER001</Id>
        </MrchntId>
        <POIId>
          <Id>ASA00002</Id>
        </POIId>
      </Envt>
      <Tx>
        <TxId>
          <TxDtTm>2022-02-22T00:54:05.000+00:00</TxDtTm>
          <TxRef>00000009</TxRef>
        </TxId>
        <RcncltnId>4</RcncltnId>
        <TxDtls>
          <Ccy>EUR</Ccy>
          <TtlAmt>0.00</TtlAmt>
        </TxDtls>
      </Tx>
      <TxRspn>
        <AuthstnRslt>
          <AuthstnNtty>
            <Id>Hamacq</Id>
            <Tp>ACQR</Tp>
            <Issr>ACQR</Issr>
          </AuthstnNtty>
          <RspnToAuthstn>
            <Rspn>APPR</Rspn>
            <RspnRsn>Cancel always approved</RspnRsn>
          </RspnToAuthstn>
          <AuthstnCd>1234567</AuthstnCd>
        </AuthstnRslt>
      </TxRspn>
    </CxlRspn>
  </AccptrCxlRspn>
</Document>