React Native Plugin

React native module for HyperSDK enables payment orchestration via different dynamic modules.

Refer hyper-sdk-react to check the package on npm registry.

Installation

npm install hyper-sdk-react

OR

yarn add hyper-sdk-react

1. Android

Step 1: Add the following maven URL in top build.gradle.

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

Step 2: Add the following ext properties in top build.gradle if you want to override the base SDK version present in the plugin

buildscript {
   ...
   ext {
       ...
       hyperSDKVersion = "2.1.7"
       useDynamicAssets = true
      ...
   }
   ...
}

Note: This version is just for explanatory purposes and may change in the future. Contact Juspay support team for the latest SDK version.

Step 3: Place the MerchantConfig.txt file alongside the root(top) build.gradle file. The contents of the file should be as follows.

clientId = <clientId> shared by Juspay Team

2. iOS

Step 1: Add the following post_install script in the pod file. This helps to download all the latest assets (while doing pod install) required for proper functioning of your payment page integration.

post_install do |installer|
 fuse_path = "./Pods/HyperSDK/Fuse.rb"
 clean_assets = false # Pass true to re-download all the assets
 if File.exist?(fuse_path)
   if system("ruby", fuse_path.to_s, clean_assets.to_s)
   end
 end
end

Step 2: The MerchantConfig.txt contains a clientId which helps the SDK to download assets specific to your application.

Place this file inside the folder where the pod file is present. This file doesn't need to be added to the project. The content of the file should be as follows:

clientId = <clientId> shared by Juspay Team

Step 3: Run the following command inside the iOS folder of your react native project:

pod install

👍

The Output of pod install should give below logs in addition to other logs.

[HyperSDK] Client ID - clientId shared by Juspay Team
[HyperSDK] Downloading assets...
[HyperSDK] XX file(s) downloaded/updated.
[HyperSDK] Adding the required URL Schemes & Queries Schemes in plist files
[HyperSDK] Plist file path: ./{Project Name}/Info.plist
[HyperSDK] Done.

Add the following property in package.json of your project before running pod install if you want to override the base SDK version present in the plugin

{
  "scripts": {
  ....
  },
  "dependencies": {
  ....
  },
  "devDependencies": {
  ....
  },
  "hyperSdkIOSVersion": "2.1.16"
}

Note: This version is just for explanatory purposes and may change in the future. Contact Juspay support team for the latest SDK version.