Skip to main content

Android Till SDK

Android Till Interface: By using the Android till interface you can directly talk to the terminal software. The benefit is that you can use an Android SDK to interact with the terminal but you can do that only for applications that will run on the terminal. If the application is not running on the terminal the Android till interface does not work. For the Android Till Interface you will need to add the SDK to your Android app as a dependency.

For testing and publication of your Android app please get in contact with us.

1) Add SDK & basics​

  • Include the Till SDK in your project (see repo README for gradle setup and artifacts).
  • Your app runs on the same terminal that has the Wallee Payment Application installed. GitHub

2) Create client and bind​

public class MainActivity extends AppCompatActivity {
private ApiClient client;

@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

ResponseHandler handler = new ResponseHandler() {
@Override
public void authorizeTransactionReply(TransactionResponse resp) {
// TODO: inspect resp (approved/declined, refs, amounts)
}
};

client = new ApiClient(handler);
client.bind(this); // bind to Wallee Till SDK service
}
}

(See repo for full example code.) GitHub

3) Authorize a transaction​

Currency currency = Currency.getInstance("CHF");
BigDecimal amount = new BigDecimal("23.60");
List<LineItem> items = new LineItem.ListBuilder("Item A", amount).build();

Transaction trx = new Transaction.Builder(items)
.setInvoiceReference("IREF-123")
.setMerchantReference("MREF-123")
.setCurrency(currency)
.build();

client.authorizeTransaction(trx);

Common operations available on ApiClient:

  • checkApiServiceCompatibility()
  • authorizeTransaction(...) (purchase/credit/reservation/adjust)
  • completeTransaction(...) (finish reservation)
  • voidTransaction(...) (cancel reservation)
  • cancelLastTransactionOperation()
  • settlement ops: executeSubmission, executeTransmission, executeFinalBalance
  • utilities: executeConfiguration, executeInitialisation, executeGeneratePanToken, getPinPadInformation GitHub

4) Handle responses​

Extend ResponseHandler to receive:

  • TransactionResponse, TransactionCompletionResponse, TransactionVoidResponse
  • SubmissionResult, TransmissionResult, FinalBalanceResult
  • GeneratePanTokenResponse, GetPinpadInformationResponse, GetConfigDataResponse GitHub