joaopinacio / plugpag_flutter

PagSeguro - Plugpag, integração via bluetooth, com os leitores (Mini, Minizinha e Mobi Pin 10) e terminais (Moderninha Pro e Moderninha Wifi) agora no Flutter.
https://pub.dev/packages/plugpag_flutter
MIT License
3 stars 1 forks source link

plugpag_flutter

pub package stars build licence

Screenshot

Installation

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

dependencies:
  plugpag_flutter:

This will get you the latest version.

Setup

Android

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="YOUR_PACKAGE_NAME"
    // Add this line below
    xmlns:tools="http://schemas.android.com/tools">

    ...
</manifest>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="YOUR_PACKAGE_NAME"
    xmlns:tools="http://schemas.android.com/tools">
    <application
        android:label="YOUR_ANDROID_LABEL"
        // Add this line below (after android:label)
        tools:replace="android:label"
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher">

        ...
    </application>
</manifest>

app/build.gradle

defaultConfig {
    ...
    minSdkVersion 21
    ...    
}

dependencies {
    ...

    implementation 'android.br.com.uol.pagseguro:plugpag:4.9.4'
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.4.0'
}

IOS

🚧 Under development 🚧

Usage

To start using this package first import it in your Dart file.

import 'package:plugpag_flutter/plugpag_flutter.dart';

Initialize

var plugpag = PlugpagFlutter(onState: onState);

Basic example using it:

var plugpag = PlugpagFlutter(onState: (state) {});

await plugpag.requestPermissions();
await plugpag.requestAuthentication();
await plugpag.startTerminalDebitPayment(2.00);

Official Plugpag Docs