com.github.javadev:passninja

The mobile wallet NFC pass service Passninja

License

License

Categories

Categories

Ninja User Interface Web Frameworks
GroupId

GroupId

com.github.javadev
ArtifactId

ArtifactId

passninja
Last Version

Last Version

1.2
Release Date

Release Date

Type

Type

jar
Description

Description

com.github.javadev:passninja
The mobile wallet NFC pass service Passninja
Project URL

Project URL

https://github.com/flomio/passninja-java
Source Code Management

Source Code Management

https://github.com/flomio/passninja-java

Download passninja

How to add to project

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

Dependencies

compile (2)

Group / Artifact Type Version
com.fasterxml.jackson.core : jackson-databind jar 2.11.2
com.fasterxml.jackson.core : jackson-annotations jar 2.11.2

test (1)

Group / Artifact Type Version
junit : junit jar 4.13

Project Modules

There are no modules declared in this project.

passninja-java

Use passninja-java as a Maven package.

Contents

Installation

Include the following in your pom.xml for Maven:

<dependencies>
  <dependency>
    <groupId>com.github.javadev</groupId>
    <artifactId>passninja</artifactId>
    <version>1.2</version>
  </dependency>
  ...
</dependencies>

Gradle:

compile 'com.github.javadev:passninja:1.2'

Usage

PassNinjaClient

Use this class to init a Passninja object. Make sure to pass your user credentials to make any authenticated requests.

import com.passninja.Passninja;

String accountId = "**your-account-id**";
String apiKey = "**your-api-key**";

Passninja.init(accountId, apiKey);

We've placed our demo user API credentials in this example. Replace it with your actual API credentials to test this code through your PassNinja account and don't hesitate to contact PassNinja with our built in chat system if you'd like to subscribe and create your own custom pass type(s).

For more information on how to use passninja-java once it loads, please refer to the PassNinja JS API reference

PassNinjaClientMethods

This library currently supports methods for creating, getting, updating, and deleting passes via the PassNinja api. The methods are outlined below.

Create

Map<String, Object> pass = new HashMap<>();
pass.put("discount", "50%");
pass.put("memberName", "John");
PassninjaResponse<Pass> response = Pass.create("demo.coupon", /* passType */
    pass /* passData */);

System.out.println(response.getResponseBody().getUrls());
System.out.println(response.getResponseBody().getPassType());
System.out.println(response.getResponseBody().getSerialNumber());

Get

PassninjaResponse<Pass> response = Pass.get("demo.coupon", /* passType */
    "97694bd7-3493-4b39-b805-20e3e5e4c770" /* serialNumber */);

Update

Map<String, Object> pass = new HashMap<>();
pass.put("discount", "100%");
pass.put("memberName", "Ted");
PassninjaResponse<Pass> response = Pass.put("demo.coupon", /* passType */
    "97694bd7-3493-4b39-b805-20e3e5e4c770", /* serialNumber */
    pass /* passData */);

Delete

PassninjaResponse<Pass> response = Pass.delete("demo.coupon", /* passType */
    "97694bd7-3493-4b39-b805-20e3e5e4c770" /* serialNumber */);
System.out.println("Pass deleted. Serial_number: ", response.getResponseBody().getSerialNumber());
PassninjaResponse<Pass> response = Pass.deleteForce("demo.coupon", /* passType */
    "97694bd7-3493-4b39-b805-20e3e5e4c770" /* serialNumber */);
System.out.println("Pass deleted. Serial_number: ", response.getResponseBody().getSerialNumber());

Documentation

Versions

Version
1.2
1.1
1.0