3. Initiating the SDK
To initialise the SDK, client needs to call the initiate SDK API. The initiate api call boots up Express Checkout SDK and makes it ready for all other operations
Follow the below steps to make an initiate SDK call
Initiate is to be called in the onCreate() method of your application's main activity (Home screen). Not following this will lead to increased latency.
Express Checkout SDK exposes the HyperServices class. Create an object of this class for all upcoming operations
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 request and response payload
Unique uuid-v4 string
Example: abcd-12345-abcd-12345
Value: in.juspay.hyperapi
Parameters required to call Hyper SDK API
Operation to be performed in the SDK. Should be initiate for this call.
Value: initiate
The merchant id provided by Juspay
Unique identifier associated with static resources assigned by juspay.
Same as merchant_id
Juspay remote environment to be used for completing an operation.
For production, pass production To be used for Live traffic
For sandbox, pass sandbox. To be used for UAT/testing environment
During its lifecycle, SDK emits multiple events to communicate about the transaction status. All of these events are received by an instance of HyperPaymentsCallbackAdapter.
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 two parameters: InitiatePayload and HyperPaymentsCallbackAdapter. 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.

