S-Money API Client

S-Money API client for Java and Android

License

License

Categories

Categories

CLI User Interface
GroupId

GroupId

com.payintech
ArtifactId

ArtifactId

s-money-client
Last Version

Last Version

16.10
Release Date

Release Date

Type

Type

jar
Description

Description

S-Money API Client
S-Money API client for Java and Android
Project URL

Project URL

https://github.com/payintech/smoney-java-client
Project Organization

Project Organization

PayinTech
Source Code Management

Source Code Management

https://github.com/payintech/smoney-java-client.git

Download s-money-client

How to add to project

<!-- https://jarcasting.com/artifacts/com.payintech/s-money-client/ -->
<dependency>
    <groupId>com.payintech</groupId>
    <artifactId>s-money-client</artifactId>
    <version>16.10</version>
</dependency>
// https://jarcasting.com/artifacts/com.payintech/s-money-client/
implementation 'com.payintech:s-money-client:16.10'
// https://jarcasting.com/artifacts/com.payintech/s-money-client/
implementation ("com.payintech:s-money-client:16.10")
'com.payintech:s-money-client:jar:16.10'
<dependency org="com.payintech" name="s-money-client" rev="16.10">
  <artifact name="s-money-client" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.payintech', module='s-money-client', version='16.10')
)
libraryDependencies += "com.payintech" % "s-money-client" % "16.10"
[com.payintech/s-money-client "16.10"]

Dependencies

compile (3)

Group / Artifact Type Version
com.squareup.retrofit2 : retrofit jar 2.1.0
com.squareup.retrofit2 : converter-gson jar 2.1.0
joda-time : joda-time jar 2.9.4

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

S-Money API client

Latest release Build GitHub license Join the chat at https://gitter.im/payintech/smoney-java-client

s-money-client is a Java based library compatible with Android facilitating the usage of the REST API provided by S-Money (s-money.fr).


Questions and issues

The GitHub issue tracker is only for bug reports and feature requests. Anything else, such as questions for help in using the library, should be posted in StackOverflow under tags s-money-client, java and android (if applicable).

Build the library

To compile s-money-client, you must ensure that Java 7 and Maven are correctly installed and are functional.

#> mvn compile
#> mvn package -DskipTests=true

How to run unit tests?

The API provided by S-Money requires the use of an authentication token. Therefore, before you can run the unit tests, it is necessary to provide this token by creating a configuration file.

You will find below the model of smoney.properties configuration file that is to be created in the src/test/resources directory.

##
## S-Money properties file
## ~~~~~
## Filename: smoney.properties
##
smoney.api.endpoint      = https://rest-pp.s-money.fr/api/sandbox/
smoney.api.token         = <YOUR_SMONEY_ACCESS_TOKEN>
smoney.transport.timeout = 15

After you are sure that the configuration is valid, you can run the unit tests with the following command:

#> mvn test

Due to S-Money sandbox servers performance and depending of your network speed, is it possible that some tests timeout. To avoid this issue, you can rise up the timeout value from 15 to a greater value.

Add s-money-client to your project

Gradle

dependencies {
    compile 'com.payintech:s-money-client:16.10'
}

Maven

<dependency>
    <groupId>com.payintech</groupId>
    <artifactId>s-money-client</artifactId>
    <version>16.10</version>
</dependency>

SBT

libraryDependencies += "com.payintech" % "s-money-client" % "16.10"

Usage

Synchronous call

final SMoneyService service = SMoneyServiceFactory.createService();
final Call<List<UserEntity>> listCall = service.listUsers();
final Response<List<UserEntity>> response = listCall.execute();

if (response.isSuccessful()) {
    for (final UserEntity user : response.body()) {
        System.out.println(user.AppUserId);
    }
}

Asynchronous call

final SMoneyService service = SMoneyServiceFactory.createService();
final Call<List<UserEntity>> listCall = service.listUsers();

listCall.enqueue(new Callback<List<UserEntity>>() {

    @Override
    public void onResponse(final Response<List<UserEntity>> response, final Retrofit retrofit) {
        if (response.isSuccessful()) {
            for (final UserEntity user : response.body()) {
                System.out.println(user.AppUserId);
            }
        }
    }

    @Override
    public void onFailure(final Throwable t) {
        t.printStackTrace();
    }
});

License

This project is released under terms of the MIT license.

com.payintech

PayinTech

Open source, from PayinTech with love

Versions

Version
16.10
16.09
16.07
16.04
16.02
16.01u1
16.01
15.12