Pay3 URL Mode
Pay3 provides URL Mode of integration for Pay3 web SDK. This is useful in case when the dApp does not need to include Pay3 SDK within the dApp. Here the dApp interacts with Pay3's solution using http url parameters. A customised Pay3 wallet and payment solution opens up in a new browser window where your user can securely do the login & transactions.
Following is the structure of the url, where strings within <> have be replaced with correct values.
pay3-hostname: Pay3 team will share the hostname of the Pay3 Web SDK. This will be different for development, pre-production and production environment.
- sdk-view: This parameter can take values web-sdk or web-sdk-pay based on the requirement of the dApp. Integrated wallet and payments solution is available at web-sdk, while payments only solution need web-sdk-pay.
- client-id: A unique client id is created for each client application. The client id is environment dependent.
- referrer: The client application needs to pass<application-identifier>. The value is of the form scheme://resource. For a web based integration use https url of the application eg: https://my-dapp.com. In case of an ios app use application id lik ios://com.my-ios-dapp, for android use android://com.my-android-dapp. The referrer is whitelisted for the client-id.
- action: The client application needs to pass <action-type>.This parameter can take values login or buy.
- data: The client application needs to pass <action-data-in-base64-encoding> for data query parameter. This data is base 64 encoding of the json string parameter associated with the action. Dapp needs to send a unique requestId value in the payload. Refer following sections for sample payload.
Pay3 Web SDK provides secure and easy login options for users. User will be able to connect to the wallet using Social, Email & Phone OTP or Wallet connect.
Following is a C# code that can be used with in Unity based code snippet that generates a URL of Login Modal with all the required params and opens it in a browser. This can be associated with a Login / Connect Wallet Button with in the dApp.
Best practice here is to store the requestId with in dApp's backend so that the Webhook callbacks can be validated.
This function opens Pay3 buy crypto modal. The Buy modal will guide the user through the digital asset purchase flow.
Following is a C# code that can be used with in Unity based code snippet that generates a URL of Buy Modal with all the required params and opens it in a browser. This can be associated with Buy Button with in the dApp.
After completing transactions in Pay3 Wallet Modal, the Pay3 SDK publishes webhook events. For more information refer to Webhooks