Initialize the SDK
To initialize the SDK, call the.init() method on the SDK.
Replace the
[GR4VY_ID] with your instance identifier and [TOKEN] with the JWT created in step 2.
Additional options can be provided when launching the SDK.The instance ID is the unique identifier for the deployment of the system and is included in every API call.
Together with the environment (sandbox or production) it is used to connect to the right APIs, as well as dashboard.The possible values for your ID are one of
wpay, wpay1, wpay2, or wpay3. You are informed
in which instance your account has been set up.Launch & handle events
Next, it’s time to open the payment sheet with the.launch() method. The launch method requires attaching an event handler
that listens for transactions that have been created or failed, as well as more generic errors.
.launch() the presentingViewController is the current view controller this SDK is launched from.
The SDK presents the payment sheet on top of the current view controller, passing events back to the presenting view controller
via the onEvent callback.
Learn more about the events triggered by the iOS SDK in the events guide.