Giter VIP home page Giter VIP logo

atpay-java-client's Introduction

ATPay Java Client

A simple java client for the ATPay service

Dependency Management

We use Jitpack for our build server. You can access more instructions here

Maven

Add the repository

<repositories>
    <repository>
        <id>jitpack.io</id>
	<url>https://jitpack.io</url>
    </repository>
</repositories>

Add the dependency

<dependency>
    <groupId>com.github.mcjp78</groupId>
    <artifactId>ATPay-Java-Client</artifactId>
    <version>1.0</version>
</dependency>	

Gradle

Add the jitpack repository service.

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}

Add the dependency

implementation 'com.github.mcjp78:ATPay-Java-Client:1.0'

Examples

Creating a new order

        ATPay instance = new ATPay("123456"); //Build an ATPay Client with the default OkHttpClient (this can be changed if you need a proxy, etc)
        try
        {

            Order order = Order.builder() //Create a new Object Builder
                               .id("1223") //Set a Unique ID for the order for your records
                               .currency("USD") //Set the currency for the order. Currently only "USD" is supported
                               .failureReturnURL("https://atpay.io/failure") //Set the URL to return to on order cancel/order failure
                               .successReturnURL("https://atpay.io/success") //Set the URL to return to on order success
                               .value(1000) //Set the value of the order in CENTS. So 1$ USD = 100 Cents.
                               .build(); // Build the Order
            String checkoutURL = instance.newOrder(order); //Submit the order to the ATPay API
        }
        catch (OrderCreationException e)
        {
            //Handle Creation Error
        }
        catch (IOException ex)
        {
            //Handle IO Error
        }

For more info on order creation, visit The Order Documentation on ATPay Docs

atpay-java-client's People

Contributors

gramdev1 avatar

Watchers

 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.