Skip to main content

Flutter

Dart SDK Compatibility

For Dart versions < 3.0.0:

sdk: ">=2.12.0 <3.0.0"

info

Please check the following Flutter Plugin

Hesabe Flutter Plugin

For any technical help please contact: [itsupport@hesabe.com]


For Dart version 3 and above:

sdk: ">=2.12.0 <4.0.0"

info

Please check the following Flutter Plugin

Hesabe Flutter Plugin for Dart 3+

For any technical help please contact: [itsupport@hesabe.com]


Integration Steps

You can integrate Hesabe Payment Gateway in your Flutter app by following the steps below:

  1. Download and add the package/plugin in your project’s root folder and add the dependency in your pubspec.yaml file

  2. Then run flutter pub get

Example pubspec.yaml:

dependencies:
hesabe:
path: ./hesabe
  1. import 'package:hesabe/hesabe.dart';
  2. Use the Sandbox environment URL and keys to test application with the Flutter plugin.

For example:

  Hesabe hesabe = Hesabe(
baseUrl: 'https://XXXX.hesabe.com', // Environment URL provided by Hesabe
accessCode: 'XXXXX', // Access code provided by Hesabe
ivKey: 'XXXXX', // Iv Key provided by Hesabe
secretKey: 'XXXXX', // Secret key provided by Hesabe
);
  1. Use Event Listener(s) to get the success and failure response from the Hesabe.

For example:

  hesabe.on(Hesabe.EVENT_PAYMENT_SUCCESS, (data) {
// TODO: Implementation pending
});

hesabe.on(Hesabe.EVENT_PAYMENT_ERROR, (data) {
// TODO: Implementation pending
});
info

Downloadable kit contains plugin code alongside readymade examples that can help you to integrate the hesabe plugin in your Flutter application. You can find example here Flutter Example Project.