Socket
Book a DemoInstallSign in
Socket

@thecodetalker1/react-native-paytm

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thecodetalker1/react-native-paytm

A react native wrapper for PayTM

1.0.9
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

react-native-paytm

This library has been forked from https://github.com/elanic-tech/react-native-paytm Updated it to work with the latest version of react-native and latest PayTM SDK. Improved the documentaion as well.

Getting started

Alert: Built and tested only for iOS.

installation

Android

react-native link react-native-paytm

iOS

  • In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  • Go to node_modulesreact-native-paytm and add RNPayTm.xcodeproj
  • In XCode, in the project navigator, select your project. Add libRNPayTm.a to your project's Build PhasesLink Binary With Libraries
  • Run your project (Cmd+R)<

Usage

import paytm from 'react-native-paytm';
import { ..., DeviceEventEmitter, ... } from 'react-native';

....

// Daat received from PayTM
const paytmConfig = {
  MID: '...',
  WEBSITE: '...',
  CHANNEL_ID: '...',
  INDUSTRY_TYPE_ID: '...',
  CALLBACK_URL: 'https://securegw.paytm.in/theia/paytmCallback?ORDER_ID='
}

componentWillMount(){
    ...
    DeviceEventEmitter.addListener('PayTMResponse', this.onPayTmResponse);
    ...
}

onPayTmResponse(response) {
  // Process Response
  console.log(response);
}

runTransaction(amount, customerId, orderId, mobile, email, checkSum) {
    const callbackUrl = `${paytmConfig.CALLBACK_URL}${orderId}`;
    const details = {
      mode: 'Staging', // 'Staging' or 'Production'
      mid: paytmConfig.MID,
      industryType: paytmConfig.INDUSTRY_TYPE_ID,
      website: paytmConfig.WEBSITE,
      channel: paytmConfig.CHANNEL_ID,
      amount: `${amount}`, // String
      orderId: orderId, // String
      email: email, // String
      phone: mobile, // String
      custId: customerId, // String
      checksumhash: checkSum, //From your server using PayTM Checksum Utility 
      callback: callbackUrl
    };
    paytm.startPayment(details);
}

Keywords

react-native

FAQs

Package last updated on 09 Mar 2018

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.