The iOS SDK is currently a beta release. If you encounter any issues, kindly reach out to our support team at support@spotflow.one.
Project Requirements
To integrate the Spotflow iOS SDK into your project, ensure the following prerequisites are met:- Xcode 13.0 or later
- iOS 11.0 or higher
- Swift 5.3 or later
- Swift Package Manager (SPM) for dependency management
Installation
Using Swift Package Manager (SPM)
To addSpotFlow - iOS SDK to your project using Xcode or by updating your Package.swift file:
Parameters Required by the SDK
Never expose your key or encryptionKey directly in the app for production. Use a secure server to perform sensitive operations.
Navigating to the Payment Screen
To navigate to the payment screen and initiate a payment process, create an instance ofSpotFlowPaymentManager with the required parameters and pass it to SpotFlowPaymentUI.
Example Usage
SpotFlowPaymentUI Parameters
manager: An instance ofSpotFlowPaymentManager containing payment and customer information.
onPaymentSuccess: A closure that gets called when the payment is successful.
onPaymentFailure: A closure that gets called when the payment fails, with an error as a parameter
SpotFlowPaymentManager
SpotFlowPaymentManager is a struct that holds all necessary information for a payment transaction.
Properties/Parameters
string
required
The merchant ID
string
required
The plan ID
string
required
The API key
string
required
The Encryption key
string
required
The customer’s email
string
The customer’s name
string
The customer’s phone number
string
The customer ID
string
paymentDescription
img
The logo of the app
string
The name of the app
Handling Error Messages
This SDK provides comprehensive error handling mechanisms to assist in troubleshooting and providing informative feedback to users. Upon encountering an error, detailed error codes and descriptions are returned. By extracting error messages from the response, you can effectively communicate the issue to the user and take appropriate actions. Ensure you implement appropriate error handling mechanisms to provide informative feedback to the user.Testing
Thoroughly test the integration with different payment scenarios including successful payments, failures, and edge cases to ensure a smooth user experience. Spotflow provides testing helpers that allows you to simulate different payment scenarios For your convenience, here are the testing helpers available:- Card Testing: Test cards can be found here
- Bank Transfer Testing: Test bank transfer scenarios with the testing account details provided during your integration.

