Versions Compared

Key

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

...

Expand
titleAccptrCmpltnAdvcRspn

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:caaa.004.001.06">
  <AccptrCmpltnAdvcRspn>
    <Hdr>
      <MsgFctn>CMPK</MsgFctn>
      <PrtcolVrsn>6.0</PrtcolVrsn>
      <XchgId>2</XchgId>
      <CreDtTm>2022-01-18T20:11:26.897+00:00</CreDtTm>
      <InitgPty>
        <Id>Amadis</Id>
      </InitgPty>
      <RcptPty>
        <Id>Amadis</Id>
      </RcptPty>
    </Hdr>
    <CmpltnAdvcRspn>
      <Envt>
        <AcqrrId>
          <Id>10009287351</Id>
        </AcqrrId>
        <MrchntId>
          <Id>00000NEXOMER001</Id>
        </MrchntId>
        <POIId>
          <Id>ASA00001</Id>
        </POIId>
      </Envt>
      <Tx>
        <TxId>
          <TxDtTm>2022-01-18T03:08:22.000-05:00</TxDtTm>
          <TxRef>00000001</TxRef>
        </TxId>
        <Rspn>APPR</Rspn>
      </Tx>
    </CmpltnAdvcRspn>
  </AccptrCmpltnAdvcRspn>
</Document>

To carry out an original credit transaction with an original transaction, below is an example:

Code Block
    public void addOriginalTransaction(String refundReferenceData, PaymentServiceID serviceID){
        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);

        TlvTree originalTransaction = params.paramTree.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.AddBin(ArkosTags.LocalTimezone, utcOffset);
        originalTransaction.AddAscii(ArkosTags.RefundReferenceData,refundReferenceData);
        originalTransaction.AddEnum(ArkosTags.SelectedService, serviceID);
    }

Code Block
// Minimal parameter set
TlvTree paymentParams = TlvTree.Empty();

paymentParams.AddEnum(ArkosTags.SelectedService, PaymentServiceID.OriginalCredit);
// Amounts are in BCD. In most cases, all 3 amounts should be the same value.
paymentParams.AddBin(ArkosTags.TransactionAmount, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x20, 0x00 });
paymentParams.AddBin(ArkosTags.AmountAuthorised, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x20, 0x00 });
paymentParams.AddBin(ArkosTags.TransactionAmountBeforeAdjustment, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x20, 0x00 });

PaymentParams.addOriginalTransaction("123456789",PaymentServiceID.Payment);
// The system needs to provide the Date and Time of this transaction, and the local 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);
paymentParams.AddEMVDate(ArkosTags.TransactionDate, cal.get(Calendar.YEAR) % 100, cal.get(Calendar.MONTH) + 1, cal.get(Calendar.DAY_OF_MONTH));
paymentParams.AddEMVTime(ArkosTags.TransactionTime, cal.get(Calendar.HOUR), cal.get(Calendar.MINUTE), cal.get(Calendar.SECOND));
paymentParams.AddBin(ArkosTags.LocalTimezone, utcOffset);

paymentParams.AddAscii(ArkosTags.SelectedLanguage, "en");

// Call to the doPayment API, sending the Arkos configuration, and parameters as a byte Array
PaymentResult result = arkos.doPayment(configuration, paymentParams.AsBytes());