Flutter Package for Chargily ePay Gateway

Chargily ePay Gateway

This Plugin is to integrate ePayment gateway with Chargily easily.

  • Currently support payment by CIB / EDAHABIA cards and soon by Visa / Mastercard


Using flutter CLI:

flutter pub add chargily_epay_flutter

Or by editing pubspec.yaml:

Edit pubspec.yaml file to include chargily_epay_flutter package:

  sdk: flutter
chargily_epay_flutter: any # <-- Add this

then run the command:

flutter pub get
# or
dart pub get


import 'package:chargily_epay_flutter/chargily.dart'

void main(List<String> args) async {
    final chargilyClient = Chargily('[API_KEY]');

    final invoice = Invoice(
        client: 'ahmed',
        clientEmail: '',
        amount: 1500,
        discount: 20.0,
        webhookUrl: '',
        backUrl: '',
        comment: 'Purchace',
        mode: PaymentMethod.CIB,
        invoiceNumber: '12345');

    final response = await chargilyClient.createPayment(invoice);

Note for who will be using the source code itself instead of the package:

this library uses retrofit to generate REST API Client, if you encounter any bug building the source, try regenerating the API Client with this command:

flutter pub run build_runner build --delete-conflicting-outputs