monnify_flutter_sdk 0.0.1-alpha02 copy "monnify_flutter_sdk: ^0.0.1-alpha02" to clipboard
monnify_flutter_sdk: ^0.0.1-alpha02 copied to clipboard

outdated

Flutter Plugin for Monnify SDK

monnify_flutter_sdk #

Flutter plugin for Monnify SDK

pub package

Getting Started #

To use this plugin, add monnify_flutter_sdk as a dependency in your pubspec.yaml file.

How to use #

This plugin exposes two APIs:

1. Initialize #

Initialize the plugin. This should be done once, preferably in the initState of your widget.

import 'package:monnify_flutter_sdk/monnify_flutter_sdk.dart';
import 'package:monnify_flutter_sdk/ApplicationMode.dart';
import 'package:monnify_flutter_sdk/Transaction.dart';
import 'package:monnify_flutter_sdk/TransactionResponse.dart';
import 'package:monnify_flutter_sdk/SubAccountDetails.dart';

class _MyAppState extends State<MyApp> {

  @override
  void initState() {
    super.initState();
    MonnifyFlutterSdk.initialize(
              'YOUR_API_KEY', 
              'CONTRACTCODE', 
              ApplicationMode.TEST
    )
  }
}

2. Initialize Payment #

Create an object of the Transaction class and pass it to the initializePayment function

Future<void> initPayment() async {
    TransactionResponse transactionResponse =
          await MonnifyFlutterSdk.initializePayment(Transaction(
              2000,
              "NGN",
              "Customer Name",
              "mail.cus@tome.er",
              "PAYMENT_REF",
              "Description of payment",
              []
          )
    );
}

The TransactionResponse class contains the below fields

String paymentDate;
double amountPayable;
double amountPaid;
String paymentMethod;
String transactionStatus;
String transactionReference;
String paymentReference;

Need more information? #

For further info about Monnify's mobile SDKs, including transaction status types, see the documentations for the Android and iOS SDKs

12
likes
0
pub points
51%
popularity

Publisher

unverified uploader

Flutter Plugin for Monnify SDK

Homepage

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on monnify_flutter_sdk