Flutter SDK
Our Flutter SDK provides a rich set of pre-built UI components and APIs to seamlessly integrate payment functionalities within your Flutter application.
Introduction
The Spotflow Flutter SDK
pallows you to integrate smooth and secure payment flows into your Flutter apps. It supports both Android and iOS platforms, making it versatile for mobile app development.
Requirements
Ensure your Flutter environment meets the following:
- context: Flutter 3.7.0 or later
- context: Dart 2.19 or later
- context: Compatible with Android (minSdkVersion 21) and iOS (iOS 11+)
- context: Internet permission for Android
(AndroidManifest.xml)
The Flutter SDK is currently a beta release. If you encounter any issues, kindly reach out to our support team at support@spotflow.one.
Installation
To use the Spotflow Flutter SDK
package, add the following dependencies to your pubspec.yaml
file:
dependencies:
spotflow_flutter: ^1.0.0 # or the latest version
Then run flutter pub get
to fetch the package.
Parameters Required by the SDK
Parameter | Type | Description |
---|---|---|
planId | String | The plan ID (optional). |
currency | String | Currency for the payment (e.g., "NGN"). |
amount | String | Amount to be paid (nullable). |
key | String | The API key for authenticating the transaction. |
encryptionKey | String | This key is used to encrypt the card for secure transactions. |
customerEmail | String | The email address of the customer. |
customerName | String | The name of the customer (optional). |
customerPhoneNumber | String | The phone number of the customer (optional). |
customerId | String | The unique identifier for the customer (optional). |
paymentDescription | String | Description of the payment (optional). |
appLogo | String | App logo widget (optional). |
appName | String | The name of the app (optional). |
debugMode | bool | Enable or disable debug mode. |
Always ensure that your key and encryptionKey are stored securely. Avoid hardcoding them in production apps.
Usage Example
Here is an example of how to make a payment using the Spotflow
package:
import 'package:spotflow_flutter/spotflow_flutter.dart';
SpotflowFlutter.startPayment(
context: context,
customerId: "cust_001",
customerEmail: "jane@example.com",
customerName: "Jane Doe",
customerPhoneNumber: "+123456789",
currency: "USD",
amount: 100.0,
key: "your_public_key",
encryptionKey: "your_encryption_key",
paymentDescription: "Payment for services",
planId: "plan_001",
appName: "MyApp",
appLogo: Image.asset('assets/logo.png'), // Or any Widget
debugMode: true,
);
Note
- context: Android: Ensure INTERNET permission is declared in
AndroidManifest.xml
- context: iOS: No special permissions required beyond basic networking
Testing Your Implementation
Test cards can be found here
Running the Example Project
An example project has been provided on our Github Repository. Clone the repository and navigate to the example folder. Open it with a supported IDE or run flutter run
from the terminal in that folder.