hyper-sdk-plugin
Advanced tools
Comparing version 2.0.5 to 2.0.6
{ | ||
"name": "hyper-sdk-plugin", | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"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": { |
@@ -8,3 +8,2 @@ # HyperSDK Cordova plugin | ||
- [Usage](#usage) | ||
- [Contributing](../CONTRIBUTING.md) | ||
@@ -36,3 +35,4 @@ ## About | ||
All payload ref is available at [HyperSDK doc](https://developer.juspay.in/v4.0/). | ||
EC Headless - All payload ref is available at [HyperSDK EC doc](https://developer.juspay.in/v2.0/). | ||
Payment Page - All payload ref is available at [HyperSDK Payment page doc](https://developer.juspay.in/v4.0/). | ||
@@ -48,3 +48,3 @@ ### PreFetch | ||
"payload" : { | ||
"clientId" : "<merchantId>_platform" | ||
"clientId" : "<client_id>" | ||
} | ||
@@ -80,2 +80,4 @@ } | ||
Initiate payload - All payload ref is available at [HyperSDK initiate](https://developer.juspay.in/v2.0/docs/initiate-payload). | ||
### Process | ||
@@ -106,4 +108,5 @@ | ||
Process payload - All payload ref is available at [HyperSDK process](https://developer.juspay.in/v2.0/docs/process-payload). | ||
## TODO | ||
1. Activity result handling is pending - Code added, Not tested | ||
1. Add dynamic assets plugin for android and ios |
@@ -1,29 +0,33 @@ | ||
var cordova = require("cordova"), | ||
exec = require("cordova/exec"); | ||
cordova.define("hyper-sdk-plugin.HyperSDKPlugin", function (require, exports, module) { | ||
var cordova = require("cordova"), | ||
exec = require("cordova/exec"); | ||
// Using one callback as HyperSDK is more event based | ||
// than callback based | ||
var pluginCallback; | ||
// Helper method to call the native plugin | ||
function callNative(name, args) { | ||
args = args || [] | ||
exec(pluginCallback, pluginCallback, "HyperSDKPlugin", name, [args]) | ||
} | ||
/** | ||
* @module HyperSDK | ||
*/ | ||
module.exports = { | ||
preFetch:function(payload, callback){ | ||
pluginCallback = callback; | ||
callNative("preFetch", payload); | ||
}, | ||
initiate:function(payload, callback){ | ||
pluginCallback = callback; | ||
callNative("initiate", payload); | ||
}, | ||
process:function(payload){ | ||
callNative("process", payload); | ||
} | ||
} | ||
// Using shared callback as HyperSDK is more event based | ||
// than callback based | ||
var sharedCallback; | ||
// Helper method to call the native plugin | ||
function callNative(name, args, pluginCallback) { | ||
args = args || [] | ||
exec(pluginCallback, pluginCallback, "HyperSDKPlugin", name, [args]) | ||
} | ||
/** | ||
* @module HyperSDK | ||
*/ | ||
module.exports = { | ||
preFetch: function (payload, callback) { | ||
callNative("preFetch", payload, callback); | ||
}, | ||
initiate: function (payload, callback) { | ||
sharedCallback = callback; | ||
callNative("initiate", payload, sharedCallback); | ||
}, | ||
process: function (payload) { | ||
callNative("process", payload, sharedCallback); | ||
}, | ||
onBackPress: function (callback) { | ||
callNative("backPress", {}, callback); | ||
} | ||
} | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
32255
356
107