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

@databank.mn/pass_mtx_rtn_module

v0.0.11

Published

Pass Micro Transaction Module in React Native

Downloads

19

Readme

Pass Micro Transaction package of React Native

https://developer.pass.mn/

Platform Support

| Android | iOS | | :-----: | :---: | |✔️|✔️|

🔨 Installation

$ npm install -g @databank.mn/pass_mtx_rtn_module

⚙ IOS Setup

$ RCT_NEW_ARCH_ENABLED=1 bundle exec pod install

⚙ Android Setup

1. Open the android/gradle.properties file
2. Scroll down to the end of the file and switch the newArchEnabled property from false to true.

🔨 Turbo Native module documentation

Documentation: https://reactnative.dev/docs/next/the-new-architecture/pillars-turbomodules

⚙ Import

import PassMtxRTN from '@databank.mn/pass_mtx_rtn_module/js/NativePassMtx';

⚙ Initialization key config

After import package you need to create keys.json file in same directory in package.json and put below json in it. That fields are used to initialize pass mtx rtn library and used to make purchase through pass gateway safely.

{
    "name": "<your org name>",
    "app_id": "<you app id>",
    "app_user_id": "<your app user id>",
    "client_id": "<client id from databank>",
    "private_key": "<private key from databank>",
    "public_key": "<public key from databank>",
    "pos_ids": [
      "<allowed terminal id list>"
    ]
}

🕹️ Usage/Example

Initialization & Check connection

Development purpose you can use passStageInit function for select environment of PASS Purchase or other methods. When development done, change it to passInit.

  const keys = require('./keys.json')

  // Initialize For Staging ENV using AppID ClientID, PrivateKey, PublicKey,
  passStageInit(String appId, String clientId, String privatePem, String publicPem);

  // Initialize For Production ENV using AppID ClientID, PrivateKey, PublicKey,
  passInit(String appId, String clientId, String privatePem, String publicPem);

  // Get Pass API Status
  getPassPing();

  // Get Pass Version Info
  getPassVersion();

  // Initialization example using release mode
  var passInitResult = await PassMtxRTN?.passInit(keys.app_id, keys.client_id, keys.private_key, keys.public_key) ??
        'Unknown platform version';
  
  // Initialization example using debug mode
  var passStageInitResult =
        await PassMtxRTN?.passStageInit(keys.app_id, keys.client_id, keys.private_key, keys.public_key) ??
            'Unknown platform version';

Card Methods

Included methods of Card registration and Get card lists you added in PASS wallet or delete it.

  // Get card token by UserID
  getCard(String userId);

  // Saving user card info
  saveCard(String userId, String szPan, String cvv, String expDate, String cardHolderName);
  
  // Verify Card
  verifyCard(String userId, String verificationMethod, String verificationValue)

  // Delete User card
  deleteCard(String userId, String cardRef);

  // Set Default card
  setDefaultCard(String userId, String cardRef);

Purchase

Direct Purchase

Pass MTX RTN included micro transaction method makePassPurchase. paymentAmount field need to multiple by 100 for original amount. If user enters 1000 in TextEditor, multiply it 1000 * 100 than send it through paymentAmount field. HEY PASS ME...

  // Make Pass Purchase
  purchase( String userId, String orderId, String paymentToken, String paymentAmount, String expDate, String dbRefNo, String description)

  // Make Purchase Example
  var convertedAmount = (parseInt(amount) * 100).toString();
  var orderId = 'INAPPV1' + Date.now().toString();
  var dbRefNo = 'DTB' + Date.now().toString();
  var description = paymentDescription ?? 'rtn inapp purchase direct test';
  var response = PassMtxRTN?.purchase(
    keys.app_user_id,
    orderId,
    paymentToken,
    convertedAmount,
    expiryDate,
    dbRefNo,
    description,
  );

Customer Presented Mode Purchase

  // Inquiry the presented qr scanned by scanner and get process of payment
  orderEnquery(String userId, String orderId)

  // Optional: When amount above under CVM limit
  orderConfirm(
      String userId,
      String orderId,
      String confirmMethod,
      String confirmResult,
      String payToken,
      String expDate)

  // Cancel order by user
  orderCancel(String userId, String orderId)

📃 License

/*
#################################################################################
#                                                                               #
#                     COPYRIGHT (C) DATABANK LLC since 2017                     #
#                                                                               #
#          ALL RIGHTS RESERVED BY DATABANK LLC.  THIS PROGRAM MUST BE           #
#          USED SOLELY FOR THE PURPOSES OF DATABANK LLC AND ITS USERS.          #
#   NO PART OF THIS PROGRAM MAY BE MODIFIED IN SOURCE OR BINARY FORM BY OTHERS  #
#             WITHOUT THE PRIOR WRITTEN PERMISSION OF DATABANK LLC.             #
#                                                                               #
#     USE OF COPYRIGHT NOTICE DOES NOT EVIDENCE PUBLICATION OF THE PROGRAM.     #
#                                                                               #
#################################################################################
*/