quick_pay 1.0.1 icon indicating copy to clipboard operation
quick_pay: ^1.0.1 copied to clipboard

A Flutter plugin for QuickPay payments in your mobile application.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:uuid/uuid.dart';

import 'package:quick_pay/quick_pay.dart';

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  void _initQuickPay() {
    QuickPay.init(apiKey: 'PUT HERE YOUR QUICK PAY API KEY');
  }

  void _makePayment() async {
    try {
      final orderId = Uuid().v4().replaceAll('-', '').substring(0, 14); // TEST ORDER ID
      final price = 245.0 * 100;
      final payment = await QuickPay.makePayment(currency: 'DKK', orderId: orderId, price: price);
    } catch (error) {
      // TODO: handle error
    }
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              FlatButton(
                color: Colors.blue,
                onPressed: _initQuickPay,
                child: Text('init'),
              ),
              FlatButton(
                color: Colors.blue,
                onPressed: _makePayment,
                child: Text('make payment'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
3
likes
100
pub points
0%
popularity

Publisher

unverified uploader

A Flutter plugin for QuickPay payments in your mobile application.

Repository (GitHub)

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

flutter, meta

More

Packages that depend on quick_pay