xfers-java

Xfers Java Bindings

License

License

MIT
Categories

Categories

Java Languages
GroupId

GroupId

com.xfers
ArtifactId

ArtifactId

xfers-java
Last Version

Last Version

1.19.0
Release Date

Release Date

Type

Type

jar
Description

Description

xfers-java
Xfers Java Bindings
Project URL

Project URL

https://github.com/Xfers/xfers-java
Project Organization

Project Organization

Xfers
Source Code Management

Source Code Management

https://github.com/Xfers/xfers-java/tree/master

Download xfers-java

How to add to project

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

Dependencies

compile (4)

Group / Artifact Type Version
com.google.code.gson : gson jar 2.7
com.mashape.unirest : unirest-java jar 1.4.9
com.google.guava : guava jar 19.0
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Xfers Java Bindings

You can sign up for a Xfers account at https://xfers.com.

Requirements

Java 1.6 and later.

Installation

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>com.xfers</groupId>
  <artifactId>xfers-java</artifactId>
  <version>1.19.0</version>
</dependency>

Non-Maven users

You'll need to manually install the following JARs:

Documentation

Please see the API docs for the most up-to-date documentation.

Usage

XfersExample.java

import com.xfers.Xfers;
import com.xfers.model.Charge;
import com.xfers.model.Item;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class XfersExample {

    public static void main(String[] args) {
        Xfers.apiKey = "pXcfdAKNorDe_o1eou1NSp4mwssiEzem_6sg8fwnZWs";
        Xfers.setSGSandbox();

        try {
            System.out.println("Listing charges without filter");
            List<Charge> charges = Charge.listAll();
            for (Charge charge : charges) {
                System.out.println(charge.toString());
                List<Item> items = charge.getItems();
                for (Item item : items) {
                    System.out.println(item.toString());
                }
            }

            System.out.println("Listing charges with filter");
            Map<String, Object> params = new HashMap<String, Object>();
            params.put("limit", "1");

            charges = Charge.listAll(params);
            for (Charge charge : charges) {
                System.out.println(charge.toString());
            }

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

}

Exceptions

AuthenticationException -> given 401 by Xfers. These are usually xfers_api_token related bug.
InvalidRequestException, -> given 400 error by Xfers. Most Expected Error will belong in this categort
APIException -> status non 400, 401, 200. (usually indicates 500 error/ unexpected error, please escalate to Xfers when this happens)
APIConnectionException -> Happens if the HTTP method used is not in (POST, GET, PUT, PATCH). Should not happen in your client app.
UnirestException -> Happens if xfers URL given is unreachable (wrong URL). Should not happen in your client app.

com.xfers

Xfers

Xfers Pte Ltd

Versions

Version
1.19.0
1.18.0
1.17.0
1.16.0
1.15.0
1.14.0
1.13.0
1.12.0
1.11.0
1.10.2
1.10.1
1.10.0
1.9.0
1.8.0
1.7.0
1.6.0
1.5.0
1.4.0
1.3.0
1.2.0
1.1.0
1.0.0