ingenico_device 0.0.1+1 ingenico_device: ^0.0.1+1 copied to clipboard
A new Flutter project.
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:ingenico_device/ingenico_device.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Column(
children: [
ElevatedButton(
onPressed: () async {
await IngenicoDevice.ingenicoInitialize(
"CAT6-64a80ac1-0ff3-4d32-ac92-5558a6870a88",
"https://uatmcm.roamdata.com/",
"4.2.3");
},
child: Text('Initialize')),
ElevatedButton(
onPressed: () async {
await IngenicoDevice.ingenicoLogin(
"FREEMAN-DEV", "12345678");
},
child: Text('Login')),
ElevatedButton(
onPressed: () async {
var devices = await IngenicoDevice.setDeviceType(
);
print(devices.toString());
},
child: Text('Set Device Type')),
ElevatedButton(
onPressed: () async {
var devices = await IngenicoDevice.search();
print(devices.toString());
},
child: Text('Search')),
ElevatedButton(
onPressed: () async {
var devices = await IngenicoDevice.setUpDevice();
print(devices.toString());
},
child: Text('Setup Device')),
ElevatedButton(
onPressed: () async {
var devices = await IngenicoDevice.creditSale("INR", 1000);
print(devices.toString());
},
child: Text('Process Credit Sale')),
],
)),
);
}
}