Coder Social home page Coder Social logo

mangopay2-java-sdk's Introduction

Mangopay Java SDK Build Status

MangopaySDK is a Java client library to work with Mangopay REST API.

Compatibility Note

Since v1.0.6 of this SDK, you must be using at least v2.01 of the API (more information about the changes required)

Be aware that since v2.0.0 of this SDK, v1.x is not be supported anymore. Every new features will only be added to v2.x versions only. v2.x version is a refactored version, which now fits with Java coding conventions. It contains some major breaking changes that needs some adaptations on your side.

Installation

SDK has been written in Java 7.

The SDK is published as a Maven artifact on Maven Central Repository (http://search.maven.org/) and can be used with Gradle or Maven.

repositories {
    mavenCentral()
}

dependencies {
    compile 'com.mangopay:mangopay2-java-sdk:1.2.0'
}
<dependency>
  <groupId>com.mangopay</groupId>
  <artifactId>mangopay2-java-sdk</artifactId>
  <version>1.2.0</version>
</dependency>

License

MangopaySDK is distributed under MIT license, see LICENSE file.

Unit Tests

JUnit tests are placed under tests directory.

Contacts

Report bugs or suggest features using issue tracker at GitHub.

Account creation

You can get yourself a free sandbox account or sign up for a production account (note that validation of your production account can take a few days, so think about doing it in advance of when you actually want to go live).

Configuration

Using the credential info from the signup process above, you should then set api.Config.ClientId to your Mangopay Client ID and api.Config.ClientPassword to your passphrase.

api.Config.BaseUrl is set to sandbox environment by default. To enable production environment, set it to https://api.mangopay.com.

    import com.mangopay.MangoPayApi;

    // ...

    MangoPayApi api = new MangoPayApi();

    // configuration
    api.Config.ClientId = "your-client-id";
    api.Config.ClientPassword = "your-client-password";
    //api.Config.BaseUrl = "https://api.mangopay.com";

    // call some API methods...
    List<User> users = api.Users.getAll();

Sample usage

    import com.mangopay.MangoPayApi;
    import com.mangopay.entities.User;
    import com.mangopay.entities.BankAccount;
    import com.mangopay.core.Pagination;
    import java.util.List;

    // ...

    MangoPayApi api = new MangoPayApi();

    // get some user by id
    User john = api.Users.get(someId);

    // change and update some of his data
    john.Tag += " - CHANGED";
    api.Users.update(john);

    // get all users (with pagination)
    Pagination pagination = new Pagination(1, 8); // get 1st page, 8 items per page
    List<User> users = api.Users.getAll(pagination);

    // get his bank accounts
    pagination = new Pagination(2, 10); // get 2nd page, 10 items per page
    List<BankAccount> accounts = api.Users.getBankAccounts(john.Id, pagination);

mangopay2-java-sdk's People

Contributors

andrzej-rojek avatar catacraciun avatar celinelz avatar cosmin-m21 avatar hectorespert avatar hobailey avatar jonathanlalou avatar lukasz-drzewiecki avatar mickaelpois avatar mkoppanen avatar nboire avatar paulhristea 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.