Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

com.github.javadev:passninja

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

com.github.javadev:passninja

The mobile wallet NFC pass service Passninja

  • 1.4
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

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.4</version>
  </dependency>
  ...
</dependencies>

Gradle:

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

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());

PassTemplate

PassninjaResponse<PassTemplate> response = PassTemplate.find("ptk_0x2" /* passTemplateId */);
System.out.println("PassTemplate name: ", response.getResponseBody().getName());

Documentation

FAQs

Package last updated on 28 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc