GithubHelp home page GithubHelp logo

omise-java's Introduction

OMISE-JAVA

Maven Central Circle CI Discourse Forum

This library has been updated to v2.7.2, check the v1 branch for the previous version.

Omise-java provides a set of Java bindings to the Omise REST API. Please contact [email protected] if you have any questions regarding this library and the functionality it provides.

INSTALLATION

Android

WARNING: Android users should check out our omise-android repository instead.

This library requires Java 7 and up and is meant to be used with Java server implementations.

Gradle\Maven

Adds to your build.gradle file.

dependencies {
    compile 'co.omise:omise-java:2.7.2'
}

Shadow JAR

If you have dependency conflicts with omise-java jar you can try using the shadowed JAR version which has the JAR dependencies relocated to the co.omise.dependencies package.

You can obtain a shadowed jar by manually cloing the project and running the shadowJar task:

$ git clone git://github.com/omise/omise-java
$ cd omise-java
$ gradle shadowJar
:compileJava
:processResources
:classes
:shadowJar

BUILD SUCCESSFUL

$ ls builds/libs
omise-java-2.7.2-all.jar

USAGE

Obtain a set of API keys from the Omise Dashboard and creates a Client object:

Client client = new Client("pkey_test_123", "skey_test_123");

Access the API by calling methods on the provided Resource classes, for example to get current balance:

long money = client.balance().get().getTotal();

Creating a charge from a token:

Client client = new Client("pkey_test_123");

try {
    Charge charge = client.charges().create(new Charge.Create()
            .amount(100000) // THB 1,000.00
            .currency("THB")
            .card("tokn_test_123"));
    System.out.println("created charge: " + charge.getId());

} catch (IOException e) {
    e.printStackTrace();
}

LICENSE

MIT license

omise-java's People

Contributors

chakrit avatar nuxzero avatar pitiphong-p avatar thanapolr avatar

Watchers

James Cloos avatar Keny Ruyter avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.