Android inter-app integration

4min

The CabCard driver app allows users to log in accept payments from an Android device.

The app can be installed from the Google Play Store.

Inter-app integration

It is possible to initiate transactions and receive the transaction outcome from a third-party app using the Android Intents API. This is referred to as an inter-app integration. It is a lightweight integration suitable for data dispatch providers.

Although it can be used with no further integration, for best results integration with the CabCard Webhooks service and HTTP RESTful API is recommended.

An example app (React Native / Expo) is provided here.

The basic steps are:

  1. Create an Intent, setting the package name to services.cabcard.driver and the classname to services.cabcard.driver
  2. Specify the action as transaction by setting an Intent extra named "action" with value transaction
  3. Compile the transaction parameters. This must include:
  • identifier: a unique identifier (e.g. a UUID) for the intent
  • amount: the transaction amount in currency minor units (pence), for example £10.56 (ten pounds and fifty-six pence) would be supplied as 1056
  1. Optionally you may also include the following transaction parameters:
  • reference: a transaction reference which will be stored against the resulting transaction, for example a booking, trip or order ID (max 99 characters)
  • originator: the name of your app, which will be displayed in the UI (max 20 characters)
  • currency: the transaction currency ISO code (alphanumeric 3 characters), e.g. "GBP". Currently, only GBP is supported so this field will be ignored.
  • customerEmailAddress: optional, used for convenient sending of receipts and e-com fallback
  • customerPhoneNumber: optional, used for convenient sending of receipts and e-com fallback

This is a simplistic Java sample code example.

Java