Flutter SDK

Get Started with Flutter SDK

flick_payment_sdk

Installation

dependencies:
  flick_payment_sdk: ^1.0.2

Then run:


flutter pub get

Usage
Step 1 : Import the package

import 'package:flick_payment_sdk/flick_payment_sdk.dart';

Step 2 : Create an instance of FlickPayment

final FlickPayment flickPayment = FlickPayment();

Step 3: Initialize the payment with your configuration

final success = await flickPayment.initialize(
  PaymentConfig(
    customerEmail: '[email protected]',
    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}');
  },
);

Step 4 : Add the payment button to your widget tree:

@override
Widget build(BuildContext context) {
  return Scaffold(
    body: Column(
      children: [
        // Your other widgets...
        flickPayment.createPaymentButton(context),
      ],
    ),
  );
}

License

This project is licensed under the MIT License - see the LICENSE file for details