S-Money API Client

S-Money API client for Java and Android

Лицензия

Лицензия

Категории

Категории

CLI Взаимодействие с пользователем
Группа

Группа

com.payintech
Идентификатор

Идентификатор

s-money-client
Последняя версия

Последняя версия

16.10
Дата

Дата

Тип

Тип

jar
Описание

Описание

S-Money API Client
S-Money API client for Java and Android
Ссылка на сайт

Ссылка на сайт

https://github.com/payintech/smoney-java-client
Организация-разработчик

Организация-разработчик

PayinTech
Система контроля версий

Система контроля версий

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

Скачать s-money-client

Как подключить последнюю версию

<!-- 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"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
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)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12

Модули Проекта

Данный проект не имеет модулей.

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

Версии библиотеки

Версия
16.10
16.09
16.07
16.04
16.02
16.01u1
16.01
15.12