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.
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>'
...
}
The /sample-app/
folder in this repository contains a very simple integration of the Forage SDK. To get it running:
- Download Android Studio.
- The app was developed with Android Studio Giraffe and Iguana.
- Clone this repo to your local machine.
- 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.
- Create a session token.
- Warning: While you can create an authentication token during development instead, in production client-side requests must use session tokens.
- Confirm your Forage Merchant ID in the dashboard (sandbox | prod).
- 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.
- Run the sample app on your emulated device of choice.
- 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.
- Minimum API Level Android 5.0 (API level 21)
- kotlinx.coroutines v1.6.4
- 3rd party libraries:
- OkHttp v4.10.0