topwise 0.0.1
topwise: ^0.0.1 copied to clipboard
Flutter plugin for Topwise SDK.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:topwise/print.dart';
import 'package:topwise/topwise.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
final _topwisePlugin = Topwise();
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: Column(
children: [
ElevatedButton(
onPressed: () {
_topwisePlugin.initialize("2000").then((value) { print(value); });
},
child: const Text("start transaction"),
),
ElevatedButton(
onPressed: () {
var args = Print(
marchantname: "VERDANT MICROFINANCE BANK",
datetime: "27 Jan 2023,06:55AM",
terminalid: "2LUX4199",
merchantid: "2LUXAA00000001",
transactiontype: "CARD WITHDRAWAL",
copytype: "Merchant",
rrn: "561409897476",
stan: "904165",
pan: "539983******1954",
expiry: "2303",
transactionstatus: "DECLINED",
responsecode: "55",
message: "Incorrect PIN",
appversion: "1.5.3",
amount: "200",
bottommessage: "Buy Airtime and Pay Electricity bills here anytime! AnyDAY!",
);
_topwisePlugin.startprinting(args).then((value) {print(value);});
},
child: const Text("print withdraw"),
),
ElevatedButton(
onPressed: () {
var args = Print(
marchantname: "VERDANT MICROFINANCE BANK",
datetime: "27 Jan 2023,06:55AM",
terminalid: "2LUX4199",
merchantid: "2LUXAA00000001",
transactiontype: "CARD WITHDRAWAL",
accountname: "ODEJINMI TOLUWALOPE ABRAHAM",
copytype: "Merchant",
stan: "904165",
accountnumber: "3076302098",
bank: "First Bank",
transactionstatus: "DECLINED",
responsecode: "55",
message: "Incorrect PIN",
appversion: "1.5.3",
amount: "200",
bottommessage: "Buy Airtime and Pay Electricity bills here anytime! AnyDAY!",
);
_topwisePlugin.startprinting(args).then((value) {print(value);});
},
child: const Text("print transfer"),
),
],
),
),
),
);
}
}