Skip to content

Latest commit

 

History

History
196 lines (145 loc) · 5.81 KB

README.md

File metadata and controls

196 lines (145 loc) · 5.81 KB

splitit-onboarding-java-sdk

Splitit.OnBoarding.Api.V2

  • API version: 1.0.0

Splitit's Onboarding API

Automatically generated by the Konfig

Requirements

Building the API client library requires:

  1. Java 1.8+
  2. Maven (3.8.3+)/Gradle (7.2+)

If you are adding this library to an Android Application or Library:

  1. Android 8.0+ (API Level 26+)

Installation

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>com.konfigthis</groupId>
  <artifactId>splitit-onboarding-java-sdk</artifactId>
  <version>2.0.0</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your build.gradle:

// build.gradle
repositories {
  mavenCentral()
}

dependencies {
   implementation "com.konfigthis:splitit-onboarding-java-sdk:2.0.0"
}

Android users

Make sure your build.gradle file as a minSdk version of at least 26:

// build.gradle
android {
    defaultConfig {
        minSdk 26
    }
}

Also make sure your library or application has internet permissions in your AndroidManifest.xml:

<!--AndroidManifest.xml-->
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">
    <uses-permission android:name="android.permission.INTERNET"/>
</manifest>

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/splitit-onboarding-java-sdk-2.0.0.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

import com.konfigthis.splitit.client.ApiClient;
import com.konfigthis.splitit.client.ApiException;
import com.konfigthis.splitit.client.Configuration;
import com.konfigthis.splitit.client.auth.*;
import com.konfigthis.splitit.client.model.*;
import com.konfigthis.splitit.client.api.DataApi;

public class Example {
  public static void main(String[] args) {
    // Configure OAuth2 client credentials for "application" OAuth flow
    String clientId = System.getenv("CLIENT_ID");
    String secretId = System.getenv("CLIENT_SECRET");
    ApiClient apiClient = new ApiClient(clientId, secretId, null);

    // Set custom base path if desired
    // apiClient.setBasePath("https://onboarding-v2.sandbox.splitit.com");    

    DataApi apiInstance = new DataApi(apiClient);
    try {
      CountriesResponse result = apiInstance.getCountries()
            .execute();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DataApi#getCountries");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Documentation for API Endpoints

All URIs are relative to https://onboarding-v2.sandbox.splitit.com

Class Method HTTP request Description
DataApi getCountries GET /api/data/get-countries
DataApi getCurrencies GET /api/data/get-currencies
DataApi getProcessors GET /api/data/get-processors
DataApi getVerticals GET /api/data/get-verticals
DataApi statusLegend GET /api/data/status-legend
MerchantsApi create POST /api/merchants/create
MerchantsApi createDeveloper POST /api/merchants/create/developer
MerchantsApi get GET /api/merchants/get
MerchantsApi getDetails GET /api/merchants/get-details

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

oauth2

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes:
    • onboarding.api.v2: onboarding.api.v2

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.