npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@nearpaydev/nearpay-ionic-sdk

v0.0.3

Published

nearpay sdk for ionic based apps

Downloads

6

Readme

Nearpay Ionic Plugin

Nearpay SDK for Embeded and Remote usage

  • Embeded Nearpay plugin for Android device payment using NFC. Plugin supported from Minimum SDK version 26. This plugin will work based on Nearpay SDK

  • Remote Nearpay for all types of devices (Android, iOS, Web), where the RemoteNearpay will connect to a proxy that will complete the payment

Install plugin

npm install @nearpaydev/nearpay-ionic-sdk --save

Plugin will support minimum supported ANDROID SDK version 26 and above only.

EmbededNearpay (Android Only)

import {
  AuthenticationType,
  EmbededNearpay,
  Environments,
  Locale,
} from '@nearpaydev/nearpay-ionic-sdk';

const embededNearpay = new EmbededNearpay({
  authtype: AuthenticationType.email, // the Authentication type (Email, mobile, etc)
  authvalue: '<Enter Your Email Here>', // the Authentication value
  environment: Environments.sandbox, // Transation enviroment
  locale: Locale.default, // [Optional] language options
});

EmbededNearpay obeject should be created once and served to the wholl application

Authentications Types

  • Login ( support both Email or Mobile user will chose )
  • Email
  • Mobile
  • JWT

Setup (Optional)

embededNearpay.setup(); // will start a setup

Purchase

embededNearpay.purchase({
  amount: 1000, // Required, maens 10.00
  transactionUUID: uuidv4(), //[Optional] speacify the transaction uuid
  customerReferenceNumber: '', // [Optional] referance number for customer use only
  enableReceiptUi: true, // [Optional] show the reciept in ui
  enableReversalUi: true, //[Optional] enable reversal of transaction from ui
  enableUiDismiss: true, //[Optional] the ui is dimissible
  finishTimeout: 60, //[Optional] finish timeout in seconds
  onPurchaseSuccess: receipts => console.log(receipts), //[Optional] callback on suceess
  onPurchaseFailed: err => console.log(err), //[Optional] callback on error
});

Refund

embededNearpay.refund({
  amount: 1000, // [Required], means 10.00
  originalTransactionUUID: 'f5079b9d-b61c-4180-8a4d-9780f7a9cd8f', // [Required] the orginal trnasaction uuid that you want to refund
  transactionUUID: uuidv4(), //[Optional] speacify the transaction uuid
  customerReferenceNumber: '', //[Optional]
  enableReceiptUi: true, // [Optional] show the reciept in ui
  enableReversalUi: true, //[Optional] enable reversal of transaction from ui
  editableReversalAmountUI: true, // [Optional] edit the reversal amount from uid
  enableUiDismiss: true, //[Optional] the ui is dimissible
  finishTimeout: 60, //[Optional] finish timeout in seconds
  adminPin: '0000', // [Optional] when you add the admin pin here , the UI for admin pin won't be shown.
  onRefundSuccess: receipts => console.log(receipts), //[Optional] callback on suceess
  onRefundFailed: err => console.log(err), //[Optional] callback on error
});

Reverse

embededNearpay.reverse({
  originalTransactionUUID: '2ddbbd15-a97e-4949-b5c2-fa073ab750eb', // [Required] the orginal trnasaction uuid that you want to reverse
  enableReceiptUi: true, // [Optional] show the reciept in ui
  enableUiDismiss: true, //[Optional] the ui is dimissible
  finishTimeout: 60, //[Optional] finish timeout in seconds
  onReverseSuccess: receipts => console.log(receipts), //[Optional] callback on suceess
  onReverseFailed: err => console.log(err), //[Optional] callback on error
});

Reconcile

embededNearpay.reconcile({
  enableReceiptUi: true, // [Optional] show the reciept in ui
  enableUiDismiss: true, //[Optional] the ui is dimissible
  finishTimeout: 60, //[Optional] finish timeout in seconds
  adminPin: '0000', // [optional] when you add the admin pin here , the UI for admin pin won't be shown.
  onReconcileSuccess: receipts => console.log(receipts), //[Optional] callback on suceess
  onReconcileFailed: err => console.log(err), //[Optional] callback on error
});

Session

embededNearpay.session({
  sessionID: 'ea5e30d4-54c7-4ad9-8372-f798259ff589', // Required
  enableReceiptUi: true, // [Optional] show the reciept in ui
  enableReversalUi: true, // [Optional] enable reversal of transaction from ui
  enableUiDismiss: true, // [Optional] the ui is dimissible
  finishTimeout: 60, // [Optional] finish timeout in seconds
  onSessionOpen: receipts => console.log(receipts), // [Optional] callback on session open
  onSessionClose: session => console.log(session), // [Optional] callback on session close
  onSessionFailed: err => console.log(err), // [Optional] callback on session error
});

getTransaction

get a transaction by uuid

embededNearpay.getTransaction({
  transactionUUID: 'a2fd6519-2b37-4336-be6d-5520bb3b6427', // Required, transaction uuid to fetch
  onResult: receipts => {},
  onFail: error => {},
});

getTransactionsList

get transactions

embededNearpay.getTransactionsList({
  page: 1, // [Optional] page number
  limit: 20, // [Optional] number of elements per page
  onResult: banner => {},
  onFail: error => {},
});

getReconciliation

get a reconciliation by uuid

embededNearpay.getReconciliation({
  reconciliationUUID: '6d4a48b8-d194-4aad-92c9-a77606758799', // Required, reconciliation uuid to fetch
  onResult: receipt => {},
  onFail: error => {},
});

getReconciliationsList

get reconciliations

embededNearpay.getReconciliationsList({
  page: 1, // [Optional] page number
  limit: 20, // [Optional] number of elements per page
  onResult: banner => {},
  onFail: error => {},
});

Logout

embededNearpay.logout();

Nearpay plugin response will be be in below formats

Model Response