Skip to content

solidgate-tech/kotlin-sdk

Repository files navigation

Solidgate API

Maven Central

Kotlin SDK provides API options for integrating Solidgate’s payment orchestrator into your Kotlin applications.

Check our

Structure

SDK for Python contains Table of contents
src/ – main library source code for development
build.gradle.kts – script for managing dependencies and library imports
gradle.properties – configuration file for Gradle
Requirements
Installation
Usage
Errors

Requirements

  • Kotlin: 1.4 or later
  • Gradle or Maven: as a build tool
  • Solidgate account: Public and secret key (request via sales@solidgate.com)

Installation

To start using the Kotlin SDK:

  1. Add the SDK to your project according to your build tool.

    Maven

    <repositories>
     <repository>
         <id>jitpack.io</id>
         <url>https://jitpack.io</url>
     </repository>
     </repositories>
     
     <dependency>
         <groupId>com.github.Solidgate</groupId>
         <artifactId>solidgate-sdk</artifactId>
         <version>1.0.0</version>
     </dependency>

    Gradle

    <repositories>
     <repository>
         <id>jitpack.io</id>
         <url>https://jitpack.io</url>
     </repository>
     </repositories>
     
     <dependency>
         <groupId>com.github.Solidgate</groupId>
         <artifactId>solidgate-sdk</artifactId>
         <version>1.0.0</version>
     </dependency>
  2. Initialize the SDK with your public and secret key.

  3. Use test credentials for validation, then transition to production credentials for deployment.

Use the provided Dockerfile for running the SDK locally.


Usage

Charge a payment

val api = Api(HttpClient(), Credentials("testMerchant", "private0-test-test-test-key123456789"))

val attributes = Attributes(mapOf(
    "amount" to 123,
    "currency" to "USD",
    "customer_email" to "testuser@example.com",
    "ip_address" to "8.8.8.8",
    "order_description" to "Test subscription",
    "order_id" to "order12345",
    "platform" to "WEB",
    "card_cvv" to "XXX",
    "card_exp_month" to 12,
    "card_exp_year" to 24,
    "card_number" to "4111 11XX XXXX 1111"
))

val response = api.charge(attributes)

Errors

Handle errors.

try {
	val response = api.charge(attributes)
        } catch (e: Exception) {
	println(e.message)
}

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages