2. Initiating the SDK
To initialise the SDK, client needs to call the initiate SDK API. The initiate api call boots up EC SDK and makes it ready for all other operations
Follow the below steps to make an initiate SDK call
EC SDK exposes the HyperSDKPlugin object. This object can be accessed via cordova.plugins.HyperSDKPlugin
The HyperSDKPlugin instance should be created only after the onDeviceReady event is fired.
Initiate API takes two parameters as input. One of the parameter is a JSON object referred as InitiatePayload. This payload contains certain key value pairs used by the SDK to perform a successful initiate
Refer to the following table for information about the description and sample payload.
Unique uuid-v4 string
Example:- $requestId
Value: in.juspay.hyperapi
Parameters required to call Hyper SDK API
Value: initiate
Unique merchant id shared during onboarding
Unique Client id shared during onboarding
Environment to be used for the session. Accepted value is production
During its lifecycle, SDK emits multiple events to communicate about the transaction status. All of these events are received by the hyperSDKCallback function.
This callback handler is passed as the second argument to the initiate API call.
The final step is to call the Initiate SDK API.
The initiate method takes stringifed InitiatePayload as argument. Use the functions created in the above steps to create the parameters
Initiate is a fire-and-forget call. For every HyperService instance you should call initiate only once.

