Getting Started

The official Android SDK for embedding Felloh payment forms in your Android app. Supports card payments and open banking.

- Github Repository


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.

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

ValueDescription
Environment.PRODUCTIONLive payments (default)
Environment.STAGINGStaging environment for testing
Environment.SANDBOXSandbox 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)
    );