Flutter
Dart SDK Compatibility
For Dart versions < 3.0.0:
sdk: ">=2.12.0 <3.0.0"
Please check the following Flutter Plugin
For any technical help please contact: [itsupport@hesabe.com]
For Dart version 3 and above:
sdk: ">=2.12.0 <4.0.0"
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:
-
Download and add the package/plugin in your project’s root folder and add the dependency in your
pubspec.yaml
file -
Then run
flutter pub get
Example pubspec.yaml
:
dependencies:
hesabe:
path: ./hesabe
- import 'package:hesabe/hesabe.dart';
- 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
);
- 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
});
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.