cash_gl_plugin 1.0.7 cash_gl_plugin: ^1.0.7 copied to clipboard
A Flutter plugin for cash_gl including payment and other tools with android, created by Chongyu Yuan.
import 'dart:async';
import 'package:cash_gl_plugin/cash_gl_plugin.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
const String CAPTCHA_SITE_KEY = "6LcKqfQUAAAAAC1I5Bjg0WI9RMc6wK9gjwG29Nr3";
Future<void> main() async {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
RaisedButton(
child: Text("打开payWithMpurse"),
onPressed: () {
_payWithMpurse("25", "656565656565", "59128959686",
"mp12769", "1578361012213", "158166@mpause");
}),
RaisedButton(
child: Text("打开liveness"),
onPressed: () {
_liveness();
}),
],
)),
);
}
_payWithMpurse(String amount, String txnId, String mpQueryId,
String partnerId, String createTime, String payerVa) async {
PayWithMpurseResult result = await new CashGlPlugin().payWithMpurse(
amount, txnId, mpQueryId, partnerId, createTime, payerVa);
print('result.resultCode: ${result.resultCode}');
Fluttertoast.showToast(msg: result.resultCode, timeInSecForIosWeb: 4);
// setState
}
_liveness() async {
LivenessResult result = await new CashGlPlugin().liveness();
print('LivenessResult: $result');
Fluttertoast.showToast(msg: result.toString(), timeInSecForIosWeb: 4);
// setState
}
}