Prerequisites
Before integrating the Payment Widget, ensure you have:- Access to Uphold’s Enterprise REST API - Get in touch with an Uphold Sales representative or your Uphold Account Manager to get started.
Installation
The Payment Widget SDK is available as an NPM package. Install it in your project:Web Application Integration
For web applications, import and use the SDK directly in your JavaScript/TypeScript code:The
session parameter is a payment session object created through the Create Session endpoint. The specific session creation process and parameters vary depending on your use case. See the individual use case pages (Select for Deposit, Select for Withdrawal, Authorize) for detailed examples of how to create sessions for each flow.Native Application Integration
Native mobile applications integrate the Payment Widget using a WebView component that loads an HTML page containing the Payment Widget SDK. To handle Payment Widget events, your native application needs to implement a communication bridge between the WebView and native code. This bridge enables your native app to receive and respond to events from the Payment Widget.HTML Template for WebView
Create an HTML file that includes the Payment Widget SDK in your js bundle:Setting Up the WebView
Now that you have the HTML template, you need to set up the WebView in your native application to load this HTML file and configure event listeners to react to the Payment Widget events.iOS (Swift)
iOS (Swift)
Android (Java/Kotlin)
Android (Java/Kotlin)
React Native
React Native
Next Steps
Now that you understand how to integrate the Payment Widget SDK, explore what you can do:Use Cases
- Select for Deposit - Allows users to select an external account for depositing funds
- Select for Withdrawal - Allows users to select an external account for withdrawing funds
- Authorize - Authorizes transactions with user confirmation