Prerequisites
Before installing the SDK, ensure you have:- Flutter SDK version 3.9.2 or higher
- A Hubtel merchant account with API credentials
- Your merchant ID and API key (Base64 encoded)
If you don’t have a Hubtel merchant account yet, visit Hubtel to sign up and obtain your credentials.
Installation Methods
The Hubtel Merchant Checkout SDK is currently available via GitHub. A pub.dev release is coming soon.Open your pubspec.yaml file
Locate the
pubspec.yaml file in the root directory of your Flutter project.Add the dependency
Add the following lines to your
dependencies section:The
ref parameter specifies the branch to use. You can also use a specific commit hash or tag for version pinning.Install the package
Run the following command in your terminal:This will download and install the SDK along with all its dependencies.
Platform-Specific Setup
The SDK works on both iOS and Android with minimal additional configuration.Android
No additional setup required. The SDK will work out of the box on Android devices.Ensure your
minSdkVersion in android/app/build.gradle is set to at least 21.iOS
No additional setup required. The SDK will work out of the box on iOS devices.Ensure your iOS deployment target is set to at least iOS 12.0 in your
ios/Podfile.Dependencies
The SDK automatically includes the following dependencies:provider- State managementwebview_flutter- For 3D Secure authenticationintl- Internationalization and formattingcached_network_image- Efficient image loadingpinput- OTP input fieldspdf&printing- Receipt generationsocket_io_client- Real-time payment updates
Import the Package
Once installed, import the SDK in any Dart file where you want to use it:CheckoutScreen- The main checkout UI widgetHubtelCheckoutConfiguration- Merchant configurationPurchaseInfo- Purchase detailsThemeConfig- Customization optionsUnifiedCheckoutPaymentStatus- Payment status enumCheckoutCompletionStatus- Checkout result data
Next Steps
Quick Start Guide
Learn how to configure and use the SDK in your app with a complete example