2.1.10 • Published 2 years ago

react-native-pg-react-native-sdk v2.1.10

Weekly downloads
395
License
MIT
Repository
-
Last release
2 years ago

react-native-pg-react-native-sdk

Getting started

$ npm install react-native-pg-react-native-sdk --save

or

$ yarn add react-native-pg-react-native-sdk --save

In case of Manual linking

$ react-native link react-native-pg-react-native-sdk

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-pg-react-native-sdk and add RNPgReactNativeSdkBridge.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNPgReactNativeSdk.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.reactlibrary.RNPgReactNativeSdkPackage; to the imports at the top of the file
  • Add new RNPgReactNativeSdkPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-pg-react-native-sdk'
    project(':react-native-pg-react-native-sdk').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-pg-react-native-sdk/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-pg-react-native-sdk')

Usage

import RNPgReactNativeSdk from 'react-native-pg-react-native-sdk';

/**
 * Starts Cashfree's Web Checkout Flow
 * @param params A map of <String, String> containing payment params.
 * @param env A String value describing environment of the payment('TEST' or 'PROD').
 * @param callback A callback to return back the result.
 */
RNPgReactNativeSdk.startPaymentWEB(params: Map<string, string>, env: string, callback: (responseJson: string) => void)

/**
 * Starts Cashfree's UPI Payment Flow
 * @param params A map of <String, String> containing payment params.
 * @param env A String value describing environment of the payment('TEST' or 'PROD').
 * @param callback A callback to return back the result.
 */
RNPgReactNativeSdk.startPaymentUPI(params: Map<string, string>, env: string, callback: (responseJson: string) => void)

/**
 * Starts Cashfree's Web Checkout Flow
 * @return A promise with a result as a JSON array containing upi apps installed in user device.
 * @example [
 {
      “displayName”: “Gpay”,
      “id”: “com.google.android.apps.nbu.paisa.user”,
      “icon”: “iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAYAAAA9zQYyAAAAAXNSR0IArs4c6QAA... (in base64)”
      },
 {
      “displayName”: “PHONEPE”,
      “id”: “com.phonepe.app”,
      “icon”: “iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAYAAAA9zQYyAAAAAXNSR0IArs4c6QAA... (in base64)”
      }
 ]
 * NOTE: the "icon" in the JSON is a base64 encoded icon string.
 * Use this function in conjunction with 'startPaymentUPI' and add the key as 'appName' in the params with the value as
 * 'id' to initiate a Seamless UPI flow.
 */
RNPgReactNativeSdk.getUPIApps()

/**
 * @param icon value of a app icon from method 'getUPIApps'
 * @return a string of icon which can be used directly to set a image source.
 */
RNPgReactNativeSdk.getIconString(icon: String)
2.1.10

2 years ago

2.1.9

2 years ago

2.1.8

2 years ago

2.1.7-dev.1

2 years ago

2.1.7

2 years ago

2.1.6-dev.1

3 years ago

2.1.6

3 years ago

2.1.2

3 years ago

2.1.4

3 years ago

2.1.3

3 years ago

2.1.5

3 years ago

2.1.5-dev.0

3 years ago

2.1.5-dev.1

3 years ago

2.1.0-dev.4

3 years ago

2.1.0-dev.3

3 years ago

2.1.0-dev.6

3 years ago

2.1.0-dev.5

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.1.0-dev.0

3 years ago

2.1.0-dev.2

3 years ago

2.1.0-dev.1

3 years ago

2.0.0

3 years ago

2.0.0-d.1

3 years ago

2.0.0-rc.7

3 years ago

2.0.0-dev.9

3 years ago

2.0.0-dev.8

3 years ago

2.0.0-dev.7

3 years ago

2.0.0-dev.6

3 years ago

2.0.0-dev.5

3 years ago

2.0.0-rc.3

3 years ago

2.0.0-rc.4

3 years ago

2.0.0-rc.5

3 years ago

2.0.0-dev.4

3 years ago

2.0.0-rc.2

3 years ago

1.1.9

3 years ago

2.0.0-dev.3

3 years ago

2.0.0-dev.2

3 years ago

2.0.0-rc.1

3 years ago

1.1.8

3 years ago

1.1.8-dev.1

3 years ago

2.0.0-beta.9

3 years ago

2.0.0-beta.8

3 years ago

1.1.8-dev.0

3 years ago

2.0.0-beta.7

3 years ago

1.1.8-internal.0

3 years ago

2.0.0-beta.6

3 years ago

2.0.0-beta.5

3 years ago

2.0.0-beta.4

3 years ago

1.1.7

3 years ago

2.0.0-beta.2

3 years ago

2.0.0-beta.1

3 years ago

2.0.0-beta.3

3 years ago

2.0.0-beta.0

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago