iOS VipasoSDK
The main entry point for the Vipaso iOS SDK, organized into user
and payment
namespaces for clear separation of functionality.
User APIs
Handles user authentication and account management, organized by user type:
-
customer
: Customer user APIs for account signup, login/logout, and account recovery. -
business
: Business user APIs for login and logout operations. -
delegated
: External authentication APIs for third-party identity providers.
Payment APIs
Manages payment processing and transaction handling, organized by user type:
-
customer
: Customer payment APIs for handling payment requests, and viewing transaction history. -
customer.instrument
: Customer payment instrument APIs for adding, managing, and removing payment methods. -
business
: Business payment APIs for sending payment requests, canceling transactions, and accessing payment records.
Setup
Initialize the SDK as a singleton instance with your configuration and delegate to handle authentication state changes.
let vipaso = VipasoSDK(
config: VipasoConfiguration(
paymentBasePath: config.baseURL,
bleServiceUUID: config.bleUUIDService,
timeoutPaymentStatusBackendPollingSeconds: config.timeoutPaymentStatusBackendPollingSeconds,
bleConnectionStatusUUID: config.bleConnectionStatusUUID
),
delegate: delegate
)
Implement VipasoDelegate
to receive authentication and event callbacks:
extension YourRootCoordinator: VipasoDelegate {
func onAuthenticationStateChange(vipaso: VipasoSDKProtocol, authenticated: Bool) {
if authenticated {
// Show main app content
} else {
// Show authentication flow
}
}
func onEventTracked(name: String, parameters: [String: String]?) {
// Handle SDK analytics events (optional)
}
}
Use Cases
Practical implementation guides for common business scenarios:
- Customer & Business Login/Logout: Authentication flows for both customer and business users
- Customer account Recovery: Password recovery process using phone number and OTP verification
- Customer registration: Complete flow for creating new customer accounts with phone verification
- Delegated authentication: Integrating with third-party identity providers
- Online payment: Complete BLE payment flow between business and customer devices
- Offline payment: Processing payments without internet connectivity using pre-authorization