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 🙏

© 2026 – Pkg Stats / Ryan Hefner

msdk-react-native

v0.3.0

Published

m

Readme

MSDK React Native

NPM Version

React Native SDK for integrating payment capabilities into mobile applications.

Installation

npm install msdk-react-native

or

yarn add msdk-react-native

Import

import {
  initializePayment,
  getParamsForSignature,
  type EcmpPaymentInfo,
  EcmpActionType,
  EcmpMockModeType,
  EcmpScreenDisplayMode,
  type EcmpAdditionalField,
  type EcmpRecipientInfo,
  type EcmpRecurrentData
} from 'msdk-react-native';

Basic Usage

1. Create Payment Information Object

const paymentInfoWithoutSignature: EcmpPaymentInfo = {
  projectID: "YOUR_PROJECT_ID",
  paymentID: "YOUR_PAYMENT_ID",
  paymentAmount: 100.50,
  paymentCurrency: 'USD',
  paymentDescription: 'Test payment',
  customerID: '12',
  regionCode: 'US',
  languageCode: 'en',
  hideSavedWallets: false,
  // Optional fields
  token: '',
  receiptData: ''
};

2. Generate Signature

// Get parameters for signature
const paramsForSignature = await getParamsForSignature(paymentInfoWithoutSignature);

// Generate signature (use your secret key)
const signature = SignatureGenerator.generateSignature(paramsForSignature, "YOUR_SECRET_KEY");

// Create final object with signature
const paymentInfo: EcmpPaymentInfo = {
  ...paymentInfoWithoutSignature,
  signature: signature
};

3. Initialize Payment

await initializePayment(
  {
    actionType: EcmpActionType.Sale,
    paymentInfo: paymentInfo,
    isDarkTheme: false,
    mockModeType: EcmpMockModeType.disabled
  },
  (result) => {
    console.log('Payment result:', result);
    // Handle payment result
  }
);

Operation Types

EcmpActionType.Sale      // Sale
EcmpActionType.Auth      // Authorization
EcmpActionType.Verify    // Verification
EcmpActionType.Tokenize  // Tokenization

Additional Features

Screen Display Settings

const screenDisplayModes = [
  EcmpScreenDisplayMode.hideSuccessFinalPage,
  EcmpScreenDisplayMode.hideDeclineFinalPage
];

Additional Fields

const additionalFields: EcmpAdditionalField[] = [
  {
    type: 'field_type',
    value: 'field_value'
  }
];

Recipient Information

const recipientInfo: EcmpRecipientInfo = {
  walletOwner: 'John Doe',
  walletId: 'wallet123',
  country: 'US',
  pan: '1234567890123456',
  cardHolder: 'John Doe',
  address: '123 Main St',
  city: 'New York',
  stateCode: 'NY'
};

Recurrent Payment Setup

const recurrentData: EcmpRecurrentData = {
  register: true,
  type: 'monthly',
  expiryDay: '31',
  expiryMonth: '12',
  expiryYear: '2025',
  period: 'month',
  interval: 1,
  time: '10:00',
  startDate: '2024-01-01',
  scheduledPaymentID: 'schedule_123'
};

Full Configuration

await initializePayment(
  {
    actionType: EcmpActionType.Sale,
    paymentInfo: paymentInfo,
    isDarkTheme: false,
    mockModeType: EcmpMockModeType.disabled,
    screenDisplayModes: screenDisplayModes,
    additionalFields: additionalFields,
    recipientInfo: recipientInfo,
    recurrentData: recurrentData,
    hideScanningCards: true,
    brandColor: '#3498db',
    storedCardType: 0,
    // Google Pay
    googleMerchantId: 'merchant_id',
    googleMerchantName: 'Merchant Name',
    googleIsTestEnvironment: true,
    // Apple Pay
    applePayMerchantID: 'merchant.com.example',
    applePayDescription: 'Payment description',
    applePayCountryCode: 'US'
  },
  (result) => {
    console.log('Payment result:', result);
    // Handle result
  }
);

Mock Modes

EcmpMockModeType.disabled  // Disabled
EcmpMockModeType.success   // Always successful result
EcmpMockModeType.decline   // Always decline

Result Handling

The callback function receives an object with payment result that contains information about operation status, error codes, and other data.