💳🐜 Access features on your Payant dashboard from an Android App
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
.github/ISSUE_TEMPLATE
.idea
.settings
app
gradle/wrapper
.gitignore
.project
LICENSE
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

PayantAndroid

Codacy Badge Maintainability CircleCI GitHub license

Payant Android can be used to access features on your Payant account dashboard.

For better understanding read the Payant API documentation before using this library.

Each of the major operations has a Manager Class in the PayantAndroid library, these managers are PayantClientManager, PayantInvoiceManager, PayantPaymentManager, PayantWalletmanager, PayantProductManager. These Manager Classes perform all needed operations that are performed on your dashboard, for instance the PayantClientManager Class can ADD, GET, EDIT, and DELETE a Client.

How to use

  1. Add JitPack to your build file.
allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}
  1. Add the Library dependency
dependencies {
     implementation 'com.github.LEMUBIT:PayantAndroid:1.1.0'
}
  1. Ensure that your app has internet permissions by making sure the uses-permission line below is present in the AndroidManifest.xml.
<uses-permission android:name="android.permission.INTERNET" />
  1. Initialize the SDK in onCreate.

The first argument is the Application Context while the second argument is a boolean value which is set to true when you are testing with a Live private key and set to false when you are using a Demo private key.

  Payant.init(getApplicationContext(),true);
  1. Set the private key.

Private key should be set after initializing the SDK.

   Payant.setPrivateKey("XXXXXXXXXXXX");
  1. Use Manager Classes

Use the manager Class of the operation you want to perform. For instance perhaps you want to get the information of a Client with ID 166, you would use the Client Manager's getPayantClient() method.

    PayantClientManager.getPayantClient(166, new PayantClientManager.OnGetPayantClientListener() {
           @Override
           public void onManagerResponse(PayantClientInfo payantClientInfo) {
               Toast.makeText(MainActivity.this, payantClientInfo.toString(), Toast.LENGTH_SHORT).show();
           }

           @Override
           public void onFailure(Throwable t) {
               Toast.makeText(MainActivity.this, t.getMessage(), Toast.LENGTH_SHORT).show();
           }
       });

In the sample above, the object PayantClientInfo contains the information of the Client whose info was requested.

FAQs

Why are you using Private Keys?

This library isn't meant to be used in apps that are distributed to different clients, though that is possible, it is rather to be used in in-house applications which are secure and access to Payant dashboard features are needed.

Where is the full documentation?

The library can be used right away but full documentation would be out soon...