Mobile
Introduction
The Software Development Kits for Android and iOS are libraries with a simple set of tools that allow you to easily communicate with the Paysafe Wallet API. The Android SDK is written in Kotlin using coroutines but Java is fully supported as well, using callback functions. The iOS SDK is a dynamic framework written in Swift.
By using the SDK, you can take advantage of pre-built features such as:
- Automatic SDK setup.
- Automatic token management.
- Built-in services for performing HTTP API calls to the Paysafe Wallet API.
- UI elements for PCI DSS sensitive data.
Main Concepts
Asynchronous Operations
The Android SDK is using suspend
functions to perform asynchronous operations using Kotlin coroutines.
All suspend
functions are safe to call from the main thread. Each suspend
function has a Java
version, suffixed with Async, with the same parameters and a callback.
The iOS SDK uses completion closures to notify caller when async operation is completed. Completion closure is always
called on the Main thread and provides Result
with either data or error. Async functions also return cancellation
handle for canceling in flight operations.
Wallet
All SDK features are exposed through the Wallet
object. The Wallet object is responsible for the SDK setup and
all services and API operations are accessible through it.
Wallet Operations
The SDK provides a set of services that are used for performing HTTP requests to the Paysafe Wallet API. Each of those services are responsible for different flows, such as user management, transactions, deposits, etc.
Error Handling
The SDK provides a unified approach to handling errors by throwing a WalletException
/WalletError
whenever an error
is returned by the Paysafe Wallet API.
UI Appearance
Appearance of UI elements provided in the SDK can be customized. You can either completely re-style the UI, override specific values or use the default appearance.
Colors
Colors are customized using semantic color palette based on their usage:
Background Colors
Colors for element backgrounds.
Label(foreground) Colors
Colors for foreground non-interactive elements like labels and icons.
Special Foreground Colors
Foreground colors used for special cases.
Action Colors
Colors for interactive foreground elements like button and links.
Fonts
The following fonts can be customized
- Title 1
- Title 2
- Title 3
- Title 4
- Subtitle 1
- Subtitle 2
- Text 1
- Text 2
- Button
- Caption 1
- Caption 2
Corner radius
Three tokens are provided to customize corner radius (rounded corners).
- Small - Checkbox
- Medium - Button, Text input, Dropdown
- Large - Bottom sheet
Border width
One token is provided to customize border width.
Assets
Icons and other images can be customized by providing own assets.