Skip to content

teamforage/forage-android-sdk

Repository files navigation

Forage Android SDK (v4.1.1)

You can use the Forage Android SDK to process online-only and/or Terminal POS EBT payments. The SDK provides UI components known as Forage Elements and associated methods that perform payment operations.

Get started with our Quickstart guides (online-only, POS) and reference documentation, or keep reading for instructions on how to install the library or run the sample app.

Install the library

To install the SDK, add this dependency to your module build.gradle:

plugins {
    id 'com.android.application'
    id 'kotlin-android'
}

android {
    ...
}

dependencies {
    ...

    // Forage Android SDK
    implementation 'com.joinforage:forage-android:<sem_ver>'

    ...
}

Run the Sample App

The /sample-app/ folder in this repository contains a very simple integration of the Forage SDK. To get it running:

  1. Download Android Studio.
    • The app was developed with Android Studio Giraffe and Iguana.
  2. Clone this repo to your local machine.
  3. In Android Studio, open the cloned forage-android-sdk project folder.
    • Android Studio will start downloading the Gradle dependencies. Wait for dependencies to download before moving forward.
  4. Create a session token.
  5. Confirm your Forage Merchant ID in the dashboard (sandbox | prod).
  6. Save your authentication token and Merchant ID as constants in the TokensViewModel.kt file.
    • The app will prompt you for an authentication token and Merchant ID on the first page of the app, but it takes defaults from this file.
  7. Run the sample app on your emulated device of choice.
  8. Use any 16 to 19 digit card number starting with "9999" to complete the payment flow.
    • Invalid cards will still be accepted by the Forage Sandbox API.
    • Trigger error scenarios with these sample cards.

Dependencies