...
doPayment is a blocking API call. Once requested, this service will run to completion.
Until a result is received, control should be fully ceded to the framework to ensure a valid processing of the operation. During this time, the framework may call any combination of Service callbacks to signal requested operations to the caller. Control should be given back as soon as possible to the framework in these cases - the system should still be considered under control from the framework.
This also applies to external operations like cancels Cancellation operations - once a cancel has been signaled to Arkos, the system should still process any requested service and wait for a completion of the service call. This may include transmits, displays or any othermore.
Standard usage
Code Block | ||
---|---|---|
| ||
// Create the minimal parameter set TlvTree paymentParams = TlvTree.Empty(); paymentParams.AddBin(ArkosTags.SelectedService, new byte[] { 0x00 }); // 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, 0x10, 0x00 }); paymentParams.AddBin(ArkosTags.AmountAuthorised, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x10, 0x00 }); paymentParams.AddBin(ArkosTags.TransactionAmountBeforeAdjustment, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x10, 0x00 }); // 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"); //Optional, add transaction channel paymentParams.AddEnum(ArkosTags.TransactionChannel,TransactionChannelID.Mpos); // Call to the doPayment API, sending the Arkos configuration, and parameters as a byte Array PaymentResult result = arkos.doPayment(configuration, paymentParams.AsBytes()); // Use the payment result Log.d("payment", "Result: " + result.result); |
...
Name | Tag | Format | Usage | |||||
---|---|---|---|---|---|---|---|---|
Selected Service |
|
| Identification of the payment service requested | |||||
Transaction Amount |
|
| Amount of the transaction | |||||
Authorised Amount |
|
| ||||||
Transaction Amount Before Adjustment |
|
| ||||||
Transaction Time |
|
| Time at which the current action is performed | |||||
Transaction Date |
|
| Date at which the current action is performed | |||||
Local Time Zone |
|
| Local Timezone in which the current action is performed | |||||
Selected Language |
|
|
...