Getting Started
The official Android SDK for embedding Felloh payment forms in your Android app. Supports card payments and open banking.
Requirements
- Android API 21+ (Android 5.0 Lollipop)
- Internet permission (added automatically by the SDK)
Installation
Add the JitPack repository to your project's settings.gradle, then add the SDK dependency to your app's build.gradle.
Add JitPack Repository
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add SDK Dependency
dependencies {
implementation 'com.github.felloh-org:android-sdk:1.0.0'
}
Quick Start
Create a FellohPayments instance by passing a ViewGroup container, your publishable API key, and optional
configuration. Then set an event listener and call render() with your ecommerce instance ID.
The ecommerce ID must be created server-side using one of the backend SDKs or the REST API. See the Ecommerce resource for details.
Quick Start
import com.felloh.sdk.FellohPayments;
import com.felloh.sdk.PaymentOptions;
import com.felloh.sdk.Environment;
// In your Activity or Fragment
FrameLayout container = findViewById(
R.id.payment_container
);
PaymentOptions options = new PaymentOptions()
.setEnvironment(Environment.SANDBOX);
FellohPayments payments = new FellohPayments(
container,
"pk_live_YOUR_PUBLIC_KEY",
options
);
payments.setEventListener(
new PaymentEventListener() {
@Override
public void onSuccess(TransactionData data) {
Log.d("Payment",
"Success: " + data.getTransactionId()
);
}
@Override
public void onDecline(TransactionData data) {
Log.d("Payment",
"Declined: " + data.getTransactionId()
);
}
}
);
payments.render("ecommerce-instance-uuid");
Constructor
The FellohPayments class accepts a container view, your public key, and an optional options object.
- Name
containerrequired- Type
- ViewGroup
- Description
The view to embed the payment form in.
- Name
publicKeyrequired- Type
- String
- Description
Your publishable API key from the Felloh dashboard. This is safe to include in client-side code.
- Name
options- Type
- PaymentOptions
- Description
Optional configuration for the payment form. See below.
Constructor
// Without options
FellohPayments payments = new FellohPayments(
container,
"pk_live_YOUR_PUBLIC_KEY"
);
// With options
FellohPayments payments = new FellohPayments(
container,
"pk_live_YOUR_PUBLIC_KEY",
options
);
Configuration
The PaymentOptions class controls how the payment form behaves.
PaymentOptions
- Name
setEnvironment()- Type
- Environment
- Description
The payment environment. Defaults to
Environment.PRODUCTION.
- Name
setMoto()- Type
- boolean
- Description
Enable Mail Order/Telephone Order mode. Defaults to
false.
- Name
setDesign()- Type
- PaymentDesign
- Description
UI options for the payment form. See below.
Environment
| Value | Description |
|---|---|
Environment.PRODUCTION | Live payments (default) |
Environment.STAGING | Staging environment for testing |
Environment.SANDBOX | Sandbox environment for testing |
PaymentDesign
- Name
payButton- Type
- boolean
- Description
Show the built-in pay button. Defaults to
true.
- Name
storeCard- Type
- boolean
- Description
Show the card storage option. Defaults to
true.
Full Configuration
PaymentOptions options = new PaymentOptions()
.setEnvironment(Environment.SANDBOX)
.setMoto(false)
.setDesign(
new PaymentDesign(true, true)
);
