hyper-sdk-plugin
Advanced tools
Comparing version 2.0.19 to 2.0.20-rc1
{ | ||
"name": "hyper-sdk-plugin", | ||
"version": "2.0.19", | ||
"version": "2.0.20-rc1", | ||
"description": "Cordova plugin for HyperSDK which enables payment orchestration via different dynamic modules. More details available at https://developer.juspay.in/v2.0/docs/introduction . Some part of module depends heavily on native functionalities and are not updatable dynamically.", | ||
@@ -5,0 +5,0 @@ "cordova": { |
@@ -13,5 +13,11 @@ # HyperSDK Cordova plugin | ||
## Minimum Requirement | ||
### Android | ||
The minimum version of cordova-android supported with HyperSDK is [10.0.0](https://github.com/apache/cordova-android/blob/master/RELEASENOTES.md#1000-jul-17-2021) which uses `androidx` and `AppCompatActivity`. | ||
## Getting the SDK | ||
SDK is available as a node depdendecy via: | ||
SDK is available as a node depdendecy via: | ||
@@ -22,6 +28,8 @@ ```sh | ||
Also it can be added as direct branch reference: | ||
## Updating your clientId | ||
```sh | ||
cordova plugin add git+ssh://git@bitbucket.org/juspay/hyper-sdk-cordova#master | ||
Update your clientId provided by Juspay Support Team in the `MerchantConfig.txt` file present under `platforms/android/app/` | ||
```txt | ||
clientId = <clientId shared by Juspay Team> | ||
``` | ||
@@ -107,26 +115,1 @@ | ||
### Backpress Handling | ||
For android, system or hardware backpress needs to be handled. Override onBackPressed() method provided by activity and call HyperSDK's onBackPressed() method to check whether the activity needs to handle backpress or SDK is handling it. | ||
```java | ||
@Override | ||
public void onBackPressed() { | ||
boolean backPressHandled = HyperSDKPlugin.onBackPressed(); | ||
if (!backPressHandled) { | ||
super.onBackPressed(); | ||
} | ||
} | ||
``` | ||
### Reset Activity | ||
For android, override onDestroy method of the activity and call HyperSDK's resetActivity() method to avoid any memory leaks | ||
```java | ||
@Override | ||
public void onDestroy() { | ||
HyperSDKPlugin.resetActivity(); | ||
super.onDestroy(); | ||
} | ||
``` |
@@ -116,9 +116,9 @@ const fs = require('fs'); | ||
// Add the Complete path to the MainActivity | ||
const newActivityPath = utilities.getAndroidSourcePath(context) + "/" + packageName.replace(/\./g, "/") + '/MainActivity.java'; | ||
const mainActivityPath = utilities.getAndroidSourcePath(context) + "/" + packageName.replace(/\./g, "/") + '/MainActivity.java'; | ||
// will replace FragmentActivity with our HyperActivity. | ||
let newSuperClass = fs.readFileSync(newActivityPath).toString(); | ||
const addedActivity = `in.juspay.hypersdk.HyperActivity` | ||
newSuperClass = newSuperClass.replace("extends FragmentActivity", "extends " + addedActivity); | ||
let mainActivityCode = fs.readFileSync(mainActivityPath).toString(); | ||
const newSuperClass = "extends in.juspay.hypersdk.HyperActivity"; | ||
mainActivityCode = mainActivityCode.replace("extends CordovaActivity", newSuperClass); | ||
@@ -128,3 +128,3 @@ | ||
// so that HyperActivity.java could be accessed directly. | ||
fs.writeFile(newActivityPath, newSuperClass, function(err) { | ||
fs.writeFile(mainActivityPath, mainActivityCode, function(err) { | ||
if (err) return console.error(err); | ||
@@ -138,2 +138,2 @@ }); | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
481
37809
1
1
113