Socket
Socket
Sign inDemoInstall

@juspay/ec-react-native-library

Package Overview
Dependencies
Maintainers
9
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@juspay/ec-react-native-library

A react-native native module library for the Juspay Express Checkout Sdk


Version published
Weekly downloads
2
Maintainers
9
Weekly downloads
 
Created
Source

@juspay/ec-react-native-library integration

This is react-native library for Juspay's Express Checkout SDK. For installing it to your project. Follow the below steps.

Installation

npm install @juspay/ec-react-native-library --save

// Required only if react-native version is below 0.60.0
react-native link @juspay/ec-react-native-library

Android

Add below maven url to your app/build.gradle

    maven {
        url "https://maven.juspay.in/jp-build-packages/hyper-sdk/"
    }

(Optional) Add the following ext properties in root build.gradle if you want to override either of the base SDK versions present in plugin:

buildscript {
  ....
   ext {
       ....
       hyperSDKVersion = "2.0.2-rc.65"
       hyperWrapperVersion = "2.0.0-19"
       ....
   }
   ....
}

Note: These versions are just for explanatory purposes and may change in future. Contact Juspay support team for the latest SDK versions.

iOS

Run the following command inside the ios folder of your react native project:

pod install

Usage

import EcReactNativeLibrary from '@juspay/ec-react-native-library';

var nbPayload = {
                  opName: "nbTxn",
                  paymentMethodType: "NB",
                  paymentMethod: "enter bank code", // 
                  redirectAfterPayment: "true",
                  format: "json"
                }
//Here payload format is specified for netbanking transaction. For different types of payload types 
//for other operations, refer https://developer.juspay.in/docs/expresscheckout-sdk


var requestPayload = {
                baseParams: {
                  merchant_id: "pass merchant id",
                  client_id: "pass client id",
                  transaction_id: "pass transaction id", //optional
                  order_id: "pass order id",
                  amount: "amount", //eg: "1.00"
                  customer_id : "pass customer id",
                  customer_email : "pass email",
                  customer_phone_number : "pass phone number",
                  environment: "pass environment" eg: "sandbox" or "prod"
                },
                serviceParams: {
                  service: "in.juspay.ec",
                  session_token: "pass client auth token",
                  endUrls: [], //eg: ["https://www.reload.in/recharge/", ".*www.reload.in/payment/f.*"]
                  payload: JSON.stringify(nbPayload) 
                },
                customParams: {} //customParams are optional key value pairs. 
              }
              EcReactNativeLibrary.startPayment( 
                  JSON.stringify(requestPayload), 
                  (successResponse) => {
                    console.log(successResponse);
                  },
                  (errorResponse) => {
                    console.log(errorResponse);
                  } 
              );

Keywords

FAQs

Package last updated on 10 Mar 2022

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