KashierDevelopersKashier Developers
In-person payments

App-to-app integration

Connect your Android app to POS terminals via the SDK

Prerequisites

Contact Kashier to onboard your application before you start. You will be asked for:

  • Server IP addresses: the IP addresses of your servers (for both incoming and outgoing calls/requests from your application).
  • Application (APK) file: the APK file of your application.

Download the SDK

Download the KashierIntegration release (kashierintegration-0.0.7-release.aar)

Install

  1. Add the AAR file to the libs folder. Convert your app from Android to Project view, then navigate to the app > libs folder.

    Adding the AAR file

  2. Add the dependencies. You need to include the dependency below in your build.gradle.

    Adding dependencies

Now you're ready to sync your project.

Usage

The SDK provides two functions to initiate payment: startSale() and startDetails().

  1. Import the following classes.

    Import the following classes

  2. Implement KashierIntegrationCallback and KashierIntegrationFactory.

    Kotlin implementation of KashierIntegrationCallback

    Java implementation of KashierIntegrationCallback

  3. To make a sale transaction, call the startSale method and pass the following parameters:

    ParameterDescription
    amountThe amount of the transaction sale.
    currencyEGP, USD, GBP, EUR.
    merchantOrderIdYour integration ID.
    paymentMethodcard, wallet, installment, valu.
    printReceipttrue: Allow auto printing for the receipt; false: Do not allow auto printing for the receipt.
    metaDatamapOf(String(), Any()): Any data you want to pass through the integration.
  4. To get details of any transaction, call the startDetails method using the transaction ID. You need to pass the same parameters as in step 3, plus one additional parameter:

    ParameterDescription
    trxIdThe ID of the transaction.

    Kotlin transaction

    Java transaction

  5. As a result of the above code, you should expect values returned in your response to update your backend.

    Kotlin response

    Java response

  6. Response codes:

    Response CodeDescription
    500Transaction canceled.
    400Transaction failure.
    200Transaction success.

On this page