flutter_mobilepay_payment 0.0.1 copy "flutter_mobilepay_payment: ^0.0.1" to clipboard
flutter_mobilepay_payment: ^0.0.1 copied to clipboard

outdatedDart 1 only

A Flutter plugin for integrating Scandinavian payment provider MobilePay.

pub package

Flutter MobilePay payment #

A Flutter plugin for integrating Scandinavian payment provider MobilePay.

Only Android support for now.

Usage #

Install the package by adding the line flutter_mobilepay_payment: ^0.0.1 to pubspec.yaml and run flutter packages get.

Import it in main.dart;

import 'package:flutter_mobilepay_payment/flutter_mobilepay_payment.dart';

and once in your app, initialize a AppSwitchPayment instance:

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  static AppSwitchPayment _mobilePay = AppSwitchPayment(
      "APPDK0000000000", Country.Denmark,
      captureType: CaptureType.Reserve);

  @override
  _MyAppState createState() => new _MyAppState(_mobilePay);
}

Then do a payment like this:

final payment = await mobilePay.pay("86715c57-8840-4a6f-af5f-07ee89107ece", 10.0);

If payment is null, that means that the payment was cancelled, i.e. the user backed out. If an error occurs, an exception will be thrown with the corresponding error code. Otherwise, the payment object will contain the paid amount and the transaction ID.

Flutter #

For help getting started with Flutter, view our online documentation.

For help on editing plugin code, view the documentation.

1
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A Flutter plugin for integrating Scandinavian payment provider MobilePay.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_mobilepay_payment