Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

rainxh11/chargily-epay-flutter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Installation:

Package link: Pub

Using flutter CLI:

flutter pub add chargily_epay_flutter

Or by editing pubspec.yaml:

Edit pubspec.yaml file to include chargily_epay_flutter package:

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

then run the command:

flutter pub get
# or
dart pub get

Usage:

import 'package:chargily_epay_flutter/chargily.dart'

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

    final invoice = Invoice(
        client: 'ahmed',
        clientEmail: '[email protected]',
        amount: 1500,
        discount: 20.0,
        webhookUrl: 'http://webhookurl.com/',
        backUrl: 'http://backurl.com/',
        comment: 'Purchace',
        mode: PaymentMethod.CIB,
        invoiceNumber: '12345');

    final response = await chargilyClient.createPayment(invoice);
}