all_fintech_flutter_sdk 1.1.4
all_fintech_flutter_sdk: ^1.1.4 copied to clipboard
The most comprehensive Flutter SDK for Nigerian fintech APIs. Integrate Paystack, Flutterwave, Monnify, Opay, and Open Banking with beautiful UI components and enterprise security.
All Fintech Flutter SDK ๐ #
The most comprehensive Flutter SDK for Nigerian fintech APIs - Integrate payments, banking, and financial services with a single, unified interface.
๐ Why Choose All Fintech SDK? #
- ๐ฏ One SDK, Multiple Providers - Paystack, Flutterwave, Monnify, Opay, Open Banking
- ๐ Enterprise Security - OAuth 2.0, signature verification, webhook handling
- ๐จ Beautiful UI Components - Material Design 3 payment sheets and forms
- โก Production Ready - Offline support, error handling, circuit breaker patterns
- ๐ฑ Type Safe - Complete Dart models with null safety
- ๐ Dual Architecture - Data-only operations OR UI-enabled components
๐ Quick Start #
Installation #
dependencies:
all_fintech_flutter_sdk: ^1.0.0
Basic Setup #
import 'package:all_fintech_flutter_sdk/all_fintech_flutter_sdk.dart';
// Initialize SDK
final sdk = AllFintechSDK.initialize(
provider: FintechProvider.paystack,
apiKey: 'your-api-key',
publicKey: 'your-public-key', // Optional for some providers
isLive: false, // Set to true for production
);
๐ณ Payment Examples #
Paystack Integration #
// Data-only payment
final transaction = await sdk.paystack.data.initializeTransaction(
TransactionRequest(
email: 'customer@example.com',
amount: 50000, // Amount in kobo (โฆ500.00)
reference: 'unique-reference-${DateTime.now().millisecondsSinceEpoch}',
),
);
// UI-enabled payment sheet
await sdk.paystack.ui.showPaymentSheet(
context: context,
email: 'customer@example.com',
amount: 50000,
onSuccess: (transaction) {
print('Payment successful: ${transaction.reference}');
},
onError: (error) {
print('Payment failed: $error');
},
);
Flutterwave Integration #
// Create customer
final customer = await sdk.flutterwave.data.createCustomer(
FlutterwaveCustomerRequest(
email: 'customer@example.com',
name: 'John Doe',
phoneNumber: '+2348123456789',
),
);
// Process payment
await sdk.flutterwave.ui.showPaymentSheet(
context: context,
amount: 25000,
currency: 'NGN',
customerEmail: 'customer@example.com',
onSuccess: (charge) {
print('Flutterwave payment successful: ${charge.id}');
},
);
Monnify Integration #
// Initialize Monnify (uses OAuth 2.0)
final monnifySDK = AllFintechSDK.initialize(
provider: FintechProvider.monnify,
apiKey: 'your-api-key',
publicKey: 'your-secret-key',
isLive: false,
);
// Create reserved account
final account = await monnifySDK.monnify.data.createReservedAccount(
MonnifyReservedAccountRequest(
accountReference: 'unique-ref-123',
accountName: 'John Doe',
currencyCode: 'NGN',
contractCode: 'your-contract-code',
customerEmail: 'john@example.com',
),
);
// Show payment sheet
await monnifySDK.monnify.ui.showPaymentSheet(
context: context,
amount: 100000,
customerName: 'John Doe',
customerEmail: 'john@example.com',
paymentReference: 'pay-ref-${DateTime.now().millisecondsSinceEpoch}',
onSuccess: (transaction) {
print('Monnify payment completed: ${transaction.transactionReference}');
},
);
๐ฐ TransactPay Integration #
// Initialize TransactPay (uses encrypted communication)
final transactPaySDK = AllFintechSDK.initialize(
provider: FintechProvider.transactpay,
apiKey: 'your-api-key',
publicKey: 'your-encryption-key',
isLive: false,
);
// Create order
final order = await transactPaySDK.transactpay.data.createOrder(
TransactPayOrderRequest(
reference: 'TXN-${DateTime.now().millisecondsSinceEpoch}',
amount: 75000,
currency: 'NGN',
customer: TransactPayCustomer(
email: 'customer@example.com',
firstName: 'John',
lastName: 'Doe',
),
narration: 'Payment for services',
),
);
// Show payment sheet with card/bank options
await transactPaySDK.transactpay.ui.showPaymentSheet(
context: context,
amount: 75000,
customerEmail: 'customer@example.com',
customerFirstName: 'John',
customerLastName: 'Doe',
narration: 'Payment for services',
onSuccess: (response) {
print('TransactPay payment successful: ${response.reference}');
},
onError: (error) {
print('Payment failed: $error');
},
);
// Bank transfer payment
await transactPaySDK.transactpay.ui.showBankTransferSheet(
context: context,
orderReference: order.reference,
amount: 75000,
onSuccess: (response) {
print('Bank transfer initiated: ${response.reference}');
},
);
๐ฆ Open Banking Integration #
// Initialize Open Banking
final openBankingSDK = AllFintechSDK.initialize(
provider: FintechProvider.openBanking,
apiKey: 'your-client-id',
publicKey: 'your-client-secret',
baseUrl: 'https://api.openbanking.ng',
);
// Get customer accounts
final accounts = await openBankingSDK.openBanking.data.getAccounts(
consentToken: 'customer-consent-token',
);
// Show account selector UI
await openBankingSDK.openBanking.ui.showAccountSelector(
context: context,
consentToken: 'customer-consent-token',
onAccountSelected: (account) {
print('Selected account: ${account.accountNumber}');
},
onError: (error) {
print('Error: $error');
},
);
// Get transaction history
final transactions = await openBankingSDK.openBanking.data.getAccountTransactions(
'0123456789',
from: '2024-01-01',
to: '2024-12-31',
consentToken: 'customer-consent-token',
);
๐จ UI Components #
Payment Sheets #
All providers include beautiful, customizable payment sheets:
// Paystack payment sheet
await sdk.paystack.ui.showPaymentSheet(
context: context,
email: 'customer@example.com',
amount: 50000,
metadata: {'order_id': '12345'},
onSuccess: (transaction) => handleSuccess(transaction),
onError: (error) => handleError(error),
);
// Opay payment sheet with channel selection
await sdk.opay.ui.showPaymentSheet(
context: context,
amount: 75000,
orderNr: 'ORDER-${DateTime.now().millisecondsSinceEpoch}',
redirectUrl: 'https://yourapp.com/success',
webServiceUrl: 'https://yourapp.com/webhook',
standard: 'opay_8.1',
onSuccess: (transaction) => print('Opay success: ${transaction.transactionId}'),
);
Management Dialogs #
// Show transaction status
await sdk.paystack.ui.showTransactionStatusDialog(
context: context,
transaction: transaction,
);
// Show customer management
await sdk.flutterwave.ui.showCustomerForm(
context: context,
onCustomerCreated: (customer) => print('Customer created: ${customer.id}'),
);
๐ง Advanced Features #
Webhook Handling #
// Verify webhook signatures
final isValid = await sdk.webhooks.processWebhook(
payload: request.body,
signature: request.headers['x-paystack-signature'],
);
if (isValid) {
// Process webhook data
print('Webhook verified and processed');
}
Offline Support #
// Initialize offline manager
await sdk.initialize();
// Sync offline requests when connection is restored
await sdk.syncOfflineRequests();
Error Handling with Circuit Breaker #
try {
final transaction = await sdk.paystack.data.initializeTransaction(request);
} on FintechException catch (e) {
if (e is CircuitBreakerOpenException) {
// Handle circuit breaker open state
print('Service temporarily unavailable');
} else {
// Handle other fintech errors
print('Payment error: ${e.message}');
}
}
๐๏ธ Architecture #
Dual Service Pattern #
Every provider follows a consistent dual architecture:
// Data-only operations (headless)
final result = await sdk.provider.data.someOperation();
// UI-enabled operations (with widgets)
await sdk.provider.ui.showSomeSheet(context: context);
Provider Switching #
// Easy provider switching
FintechProvider currentProvider = FintechProvider.paystack;
switch (currentProvider) {
case FintechProvider.paystack:
await sdk.paystack.ui.showPaymentSheet(/* ... */);
break;
case FintechProvider.flutterwave:
await sdk.flutterwave.ui.showPaymentSheet(/* ... */);
break;
case FintechProvider.monnify:
await sdk.monnify.ui.showPaymentSheet(/* ... */);
break;
}
๐ Supported Providers #
Provider | Payments | Transfers | Customers | Subscriptions | Open Banking |
---|---|---|---|---|---|
Paystack | โ | โ | โ | โ | โ |
Flutterwave | โ | โ | โ | โ | โ |
Monnify | โ | โ | โ | โ | โ |
Opay | โ | โ | โ | โ | โ |
TransactPay | โ | โ | โ | โ | โ |
Open Banking | โ | โ | โ | โ | โ |
๐ Security Features #
- Signature Verification - All API requests are signed and verified
- OAuth 2.0 - Secure authentication for Open Banking and Monnify
- Webhook Security - Automatic signature validation for webhooks
- Token Management - Automatic token refresh and secure storage
- Encryption - AES-256-CBC encryption for sensitive data
๐งช Testing #
// Mock responses for testing
final mockSDK = AllFintechSDK.initialize(
provider: FintechProvider.paystack,
apiKey: 'test-key',
isLive: false, // Always use test mode for development
);
// Test payment flow
await mockSDK.paystack.data.initializeTransaction(
TransactionRequest(
email: 'test@example.com',
amount: 100000,
reference: 'test-ref-123',
),
);
๐ Documentation #
๐ Bug Reports & Feature Requests #
Found a bug or have a feature request? We'd love to hear from you!
๐ Reporting Bugs #
Before reporting:
- Check existing issues
- Include provider name, Flutter version, and error details
- Provide minimal code example to reproduce
โจ Feature Requests #
Popular requests:
- New fintech provider integrations
- Additional UI components
- Enhanced security features
- Performance improvements
๐ค Contributing #
We welcome contributions from the community! Here's how you can help:
Quick Start Contributing #
- Fork the repository
- Clone your fork:
git clone https://github.com/your-username/all_fintech_sdk.git
- Create a branch:
git checkout -b feature/your-feature-name
- Make your changes following our coding standards
- Test your changes thoroughly
- Submit a pull request
Contribution Areas #
- ๐ฆ New Providers - Add support for more Nigerian fintech APIs
- ๐จ UI Components - Enhance existing or create new Material Design widgets
- ๐ Security - Improve authentication and encryption features
- ๐ Documentation - Help improve guides and examples
- ๐งช Testing - Add unit tests and integration tests
- ๐ Bug Fixes - Fix issues and improve stability
Development Setup #
# Clone the repository
git clone https://github.com/chidiebere-edeh/all_fintech_sdk.git
cd all_fintech_sdk/flutter-sdk/all_fintech_flutter_sdk
# Install dependencies
flutter pub get
# Run tests
flutter test
# Run example app
cd example
flutter run
Coding Standards #
- Follow Dart/Flutter best practices
- Maintain the minimal code principle
- Add documentation for public APIs
- Include tests for new features
- Use conventional commit messages
Pull Request Guidelines #
- Clear title describing the change
- Detailed description of what was changed and why
- Link related issues using
Fixes #123
orCloses #123
- Test coverage for new functionality
- Documentation updates if needed
๐ License #
This project is licensed under the MIT License - see the LICENSE file for details.
๐จโ๐ป Author #
Chidiebere Edeh
- GitHub: @chidiebere-edeh
- Email: chidiebere.edeh@example.com
- LinkedIn: Chidiebere Edeh
๐ Acknowledgments #
- Nigerian fintech ecosystem for driving innovation
- Flutter community for excellent tooling and support
- All contributors who helped make this SDK possible
โญ Show Your Support #
If this SDK helped you build amazing fintech applications, please give it a โญ on GitHub!
Built with โค๏ธ for the Nigerian fintech ecosystem by Chidiebere Edeh