Flick Payment SDK (GBP Only) - Flutter Integration Guide
Overview
A Flutter SDK for integrating bank payments (Open Banking) in UK applications, allowing users to pay directly from their bank accounts.
Getting Started
To use this package, add flick_payment_sdk as a dependency in your pubspec.yaml
:
Installation
For installation instructions, please see the Installation tab
dependencies:
flick_payment_sdk: ^1.0.2
Then run:
flutter pub get
Example App
We provide a complete example application demonstrating SDK integration. Check the Example tab
Usage
Basic Implementation
- Import the package:
import 'package:flick_payment_sdk/flick_payment_sdk.dart';
- Create an instance of FlickPayment:
final FlickPayment flickPayment = FlickPayment();
- Initialize the payment with your configuration:
final success = await flickPayment.initialize(
PaymentConfig(
customerEmail: 'customer@example.com',
amount: '500', // Amount in pence (£5.00)
currency: 'GBP',
transactionId: 'UNIQUE_ID_${DateTime.now().millisecondsSinceEpoch}',
apiKey: 'your_apikey',
redirectUrl: 'https://your-app.com/payment-callback',
),
onPaymentCompleted: (PaymentCompletionResult result) {
// Handle payment result
final details = result.responseData;
final status = result.transactionStatus;
print('${status}! Reference: ${details.transactionRef}');
},
);
- Add the payment button to your widget tree:
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
// Your other widgets...
flickPayment.createPaymentButton(context),
],
),
);
}