Commit 64124429 authored by Izol's avatar Izol

topup confirm #2

parent 8341e589
......@@ -16,16 +16,16 @@
<option name="name" value="MavenRepo" />
<option name="url" value="https://repo.maven.apache.org/maven2/" />
</remote-repository>
<remote-repository>
<option name="id" value="Google9" />
<option name="name" value="Google9" />
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven4" />
<option name="name" value="maven4" />
<option name="url" value="https://storage.googleapis.com/download.flutter.io" />
</remote-repository>
<remote-repository>
<option name="id" value="Google7" />
<option name="name" value="Google7" />
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven2" />
<option name="name" value="maven2" />
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
......
......@@ -97,7 +97,7 @@ dependencies {
// library mdd
// change 11
implementation(group: 'com.mdd.topup', name: 'mifare_mdd_lib', version: '0.0.41', ext: 'aar')
implementation(group: 'com.mdd.topup', name: 'mifare_mdd_lib', version: '0.1.5', ext: 'aar')
implementation(group: 'com.mdd.payment', name: 'aar-deviceid-release', version: '2.0.6', ext: 'aar')
implementation(group: 'com.mdd.library', name: 'android-escpos-receipt', version: '1.0.1', ext: 'aar')
implementation(group: 'com.mdd.payment', name: 'nativecripto-release', version: '2.0.1', ext: 'aar')
......
......@@ -108,6 +108,7 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
val approvalCode = call.argument<String>("approval_code")
val paymentMethod = call.argument<String>("payment_method")
val paymentProvider = call.argument<String>("payment_provider")
val tid = call.argument<String>("tid")
val topupInquiryResponse = _mifareTicketing?.topupConfirm(
cardNumber!!,
......@@ -116,8 +117,10 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
approvalCode!!,
paymentMethod!!,
paymentProvider!!,
"TOP_SS${Date().time}"
)
"TOP_SS${Date().time}",
"TOP_SS${Date().time}",
tid!!,
)
result.success(Gson().toJson(topupInquiryResponse))
}
......@@ -225,6 +228,10 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
result?.success("success init engine")
}
override fun onSuccessMultiBinding(listTicket: List<Ticket>) {
TODO("Not yet implemented")
}
override fun onSuccessPostPerso(ticket: Ticket?) {
TODO("Not yet implemented")
}
......
......@@ -25,5 +25,7 @@
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Flutter for Android" level="project" />
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>
\ No newline at end of file
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=C:\Users\MDD HP\flutter
FLUTTER_APPLICATION_PATH=C:\Users\MDD HP\dolan-selfservice-master
FLUTTER_ROOT=/Users/macbookpro/Developer/flutter
FLUTTER_APPLICATION_PATH=/Users/macbookpro/dolan-selfservice-topup
COCOAPODS_PARALLEL_CODE_SIGN=true
FLUTTER_TARGET=lib\main.dart
FLUTTER_TARGET=lib/main.dart
FLUTTER_BUILD_DIR=build
FLUTTER_BUILD_NAME=1.0.0
FLUTTER_BUILD_NUMBER=1
......
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=C:\Users\MDD HP\flutter"
export "FLUTTER_APPLICATION_PATH=C:\Users\MDD HP\dolan-selfservice-master"
export "FLUTTER_ROOT=/Users/macbookpro/Developer/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/macbookpro/dolan-selfservice-topup"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib\main.dart"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
......
......@@ -91,6 +91,7 @@ class StartService {
static Future<String> topUpConfirm(
String cardNumber,
String lastBalance,
String tid,
String samReport,
String approvalCode,
String paymentMethod,
......@@ -101,6 +102,7 @@ class StartService {
result = await platform.invokeMethod("topup_confirm", <String, dynamic>{
'card_number': cardNumber,
'last_balance': lastBalance,
'tid' : tid,
'sam_report': samReport,
'approval_code': approvalCode,
'payment_method': paymentMethod,
......
......@@ -144,7 +144,6 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
@override
void dispose() {
idleDuration.dispose();
// timer?.cancel();
super.dispose();
}
......@@ -163,6 +162,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
_checkInternetSpeed(); // call _checkInternetSpeed function when there is internet connection
} else {
_statusColor = Colors.yellow;
}
});
}
......@@ -379,6 +379,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
var info,
infoMap,
lastBalance,
tid,
samReport,
paymentMethod,
paymentProvider,
......@@ -391,10 +392,12 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
samReport = infoMap['report'].toString();
paymentMethod = 'QRIS';
paymentProvider = PreferencesHelper.getString('provider');
tid = PreferencesHelper.getString('outletname');
tid = tid.substring(tid.length -4);
if (int.parse(lastBalance) > int.parse(prevBalance!)) {
countMax = 0;
var result = await StartService.topUpConfirm(cardNumber, lastBalance,
var result = await StartService.topUpConfirm(cardNumber, lastBalance, tid,
samReport, approvalCode, paymentMethod, paymentProvider);
print('topUpConfirm result: $result');
......@@ -1263,362 +1266,371 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
}
void denom(String outletName, var info) {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);
showDialog(
context: context,
builder: (context) {
return StatefulBuilder(builder: (context, StateSetter setState) {
return Center(
child: SingleChildScrollView(
child: AlertDialog(
title: Container(
padding: const EdgeInsets.symmetric(
horizontal: 20, vertical: 20),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(28),
image: const DecorationImage(
fit: BoxFit.cover,
image: AssetImage(
'assets/img_bg_card.png',
),
),
),
width: 1000,
margin:
const EdgeInsets.symmetric(vertical: 10, horizontal: 0),
child: Row(
children: [
Align(
alignment: Alignment.topLeft,
child: GestureDetector(
onTap: () {
Navigator.pop(context);
setState(() {
isShowingDialog = false;
});
if (timer != null) timer?.cancel();
tapIdle();
},
child: Icon(
Icons.arrow_back,
size: 32,
color: lightBackgroundColor,
return Container(
decoration: BoxDecoration(
image: const DecorationImage(
fit: BoxFit.cover,
image: AssetImage(
'assets/img_bg_card.png',
),
), ),
child:Center(
child: SingleChildScrollView(
child: AlertDialog(
backgroundColor: lightBackgroundColor,
title: Container(
padding: const EdgeInsets.symmetric(
horizontal: 20, vertical: 20),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(0),
image: const DecorationImage(
fit: BoxFit.cover,
image: AssetImage(
'assets/img_bg_card.png',
),
),
),
SizedBox(
width: 330,
),
Text(
'Isi Ulang Saldo',
style: blackTextStyle.copyWith(
fontSize: 25,
color: Colors.white,
fontWeight: bold,
letterSpacing: 2,
),
textAlign: TextAlign.center,
),
],
),
),
content: SingleChildScrollView(
child: ListBody(
children: <Widget>[
Container(
padding: EdgeInsets.symmetric(horizontal: 17),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Center(
child: Text(
'topup balance',
style: greyTextStyle.copyWith(
fontSize: 15,
fontStyle: FontStyle.italic,
fontWeight: light,
),
),
),
Text(
'Pilih nominal isi ulang',
style: blackTextStyle.copyWith(
fontSize: 20,
fontWeight: bold,
),
),
Text(
'Choose topup amount',
style: greyTextStyle.copyWith(
fontSize: 15,
fontStyle: FontStyle.italic,
fontWeight: light,
width: 1200,
margin:
const EdgeInsets.symmetric(vertical: 10, horizontal: 0),
child: Row(
children: [
Align(
alignment: Alignment.topLeft,
child: GestureDetector(
onTap: () {
Navigator.pop(context);
setState(() {
isShowingDialog = false;
});
if (timer != null) timer?.cancel();
tapIdle();
},
child: Icon(
Icons.arrow_back,
size: 32,
color: lightBackgroundColor,
),
),
SizedBox(
height: 20,
),
SizedBox(
width: 480,
),
Text(
'Isi Ulang Saldo',
style: blackTextStyle.copyWith(
fontSize: 25,
color: Colors.white,
fontWeight: bold,
letterSpacing: 2,
),
Row(
children: [
Expanded(
child: GestureDetector(
onTap: () {
if (timer != null) timer?.cancel();
tapIdle();
if (mounted) {
setState(() {
amountController!.text = cTopUp1;
});
}
},
child: Container(
padding:
EdgeInsets.symmetric(vertical: 15),
decoration: BoxDecoration(
border: Border.all(
color: amountController!.text ==
cTopUp1
? purpleColor
: Colors.black12),
borderRadius: BorderRadius.circular(7),
),
child: Center(
child: Text("50,000",
style: blackTextStyle.copyWith(
fontSize: 25,
fontWeight: bold,
)),
textAlign: TextAlign.center,
),
],
),
),
content: Container (
child: ListBody(
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Center(
child: Text(
'topup balance',
style: greyTextStyle.copyWith(
fontSize: 15,
fontStyle: FontStyle.italic,
fontWeight: light,
),
),
),
)),
SizedBox(
width: 10,
),
Expanded(
child: GestureDetector(
onTap: () {
if (timer != null) timer?.cancel();
tapIdle();
if (mounted) {
setState(() {
amountController!.text = cTopUp2;
});
}
},
child: Container(
padding:
EdgeInsets.symmetric(vertical: 15),
decoration: BoxDecoration(
border: Border.all(
color: (amountController!.text ==
cTopUp2)
? Color(0xff005DAC)
: Colors.black12),
borderRadius: BorderRadius.circular(7),
),
child: Center(
child: Text("150,000",
style: blackTextStyle.copyWith(
fontSize: 25,
fontWeight: bold,
)),
Text(
'Pilih nominal isi ulang',
style: blackTextStyle.copyWith(
fontSize: 20,
fontWeight: bold,
),
),
))
],
),
SizedBox(
height: 10,
),
Row(
children: [
Expanded(
child: GestureDetector(
onTap: () {
if (timer != null) timer?.cancel();
tapIdle();
if (mounted) {
setState(() {
amountController!.text = cTopUp3;
});
}
},
child: Container(
padding:
EdgeInsets.symmetric(vertical: 15),
decoration: BoxDecoration(
border: Border.all(
color: (amountController!.text ==
cTopUp3)
? Color(0xff005DAC)
: Colors.black12),
borderRadius: BorderRadius.circular(7),
Text(
'Choose topup amount',
style: greyTextStyle.copyWith(
fontSize: 15,
fontStyle: FontStyle.italic,
fontWeight: light,
),
child: Center(
child: Text("100,000",
style: blackTextStyle.copyWith(
fontSize: 25,
fontWeight: bold,
),
SizedBox(
height: 20,
),
Row(
children: [
Expanded(
child: GestureDetector(
onTap: () {
if (timer != null) timer?.cancel();
tapIdle();
if (mounted) {
setState(() {
amountController!.text = cTopUp1;
});
}
},
child: Container(
padding:
EdgeInsets.symmetric(vertical: 15),
decoration: BoxDecoration(
border: Border.all(
color: amountController!.text ==
cTopUp1
? purpleColor
: Colors.black12),
borderRadius: BorderRadius.circular(7),
),
child: Center(
child: Text("50,000",
style: blackTextStyle.copyWith(
fontSize: 25,
fontWeight: bold,
)),
),
),
)),
),
SizedBox(
width: 10,
),
Expanded(
child: GestureDetector(
onTap: () {
if (timer != null) timer?.cancel();
tapIdle();
if (mounted) {
setState(() {
amountController!.text = cTopUp2;
});
}
},
child: Container(
padding:
EdgeInsets.symmetric(vertical: 15),
decoration: BoxDecoration(
border: Border.all(
color: (amountController!.text ==
cTopUp2)
? Color(0xff005DAC)
: Colors.black12),
borderRadius: BorderRadius.circular(7),
),
child: Center(
child: Text("150,000",
style: blackTextStyle.copyWith(
fontSize: 25,
fontWeight: bold,
)),
),
),
))
],
),
)),
SizedBox(
width: 10,
),
Expanded(
child: GestureDetector(
onTap: () {
if (timer != null) timer?.cancel();
tapIdle();
if (mounted) {
setState(() {
amountController!.text = cTopUp4;
});
}
},
child: Container(
padding:
EdgeInsets.symmetric(vertical: 15),
decoration: BoxDecoration(
border: Border.all(
color: (amountController!.text ==
cTopUp4)
? Color(0xff005DAC)
: Colors.black12),
borderRadius:
BorderRadius.circular(7),
SizedBox(
height: 10,
),
Row(
children: [
Expanded(
child: GestureDetector(
onTap: () {
if (timer != null) timer?.cancel();
tapIdle();
if (mounted) {
setState(() {
amountController!.text = cTopUp3;
});
}
},
child: Container(
padding:
EdgeInsets.symmetric(vertical: 15),
decoration: BoxDecoration(
border: Border.all(
color: (amountController!.text ==
cTopUp3)
? Color(0xff005DAC)
: Colors.black12),
borderRadius: BorderRadius.circular(7),
),
child: Center(
child: Text("100,000",
style: blackTextStyle.copyWith(
fontSize: 25,
fontWeight: bold,
)),
),
),
)),
SizedBox(
width: 10,
),
child: Center(
child: Text("200,000",
style: blackTextStyle.copyWith(
fontSize: 25,
fontWeight: bold,
)),
Expanded(
child: GestureDetector(
onTap: () {
if (timer != null) timer?.cancel();
tapIdle();
if (mounted) {
setState(() {
amountController!.text = cTopUp4;
});
}
},
child: Container(
padding:
EdgeInsets.symmetric(vertical: 15),
decoration: BoxDecoration(
border: Border.all(
color: (amountController!.text ==
cTopUp4)
? Color(0xff005DAC)
: Colors.black12),
borderRadius:
BorderRadius.circular(7),
),
child: Center(
child: Text("200,000",
style: blackTextStyle.copyWith(
fontSize: 25,
fontWeight: bold,
)),
),
),
),
),
),
],
),
),
],
),
],
),
),
Container(
margin: EdgeInsets.only(top: 30),
padding: EdgeInsets.symmetric(horizontal: 17),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Atau masukkan nominal isi ulang disini',
style: blackTextStyle.copyWith(
fontSize: 20,
fontWeight: bold,
),
),
Text(
'or enter topup amount here',
style: greyTextStyle.copyWith(
fontSize: 15,
fontStyle: FontStyle.italic,
fontWeight: light,
],
),
),
SizedBox(
height: 20,
),
Container(
height: 50,
padding: EdgeInsets.symmetric(horizontal: 16),
decoration: BoxDecoration(
border: Border.all(color: Colors.black12),
color: Colors.white,
borderRadius: BorderRadius.circular(12)),
child: Center(
child: Row(
children: <Widget>[
Expanded(
child: TextFormField(
style: blackTextStyle.copyWith(
fontSize: 20,
fontWeight: bold,
color: purpleColor,
),
keyboardType:
TextInputType.numberWithOptions(
signed: true,
decimal: true),
controller: amountController,
inputFormatters: [
FilteringTextInputFormatter
.digitsOnly,
CurrencyInputFormatter()
],
textInputAction:
TextInputAction.done,
decoration:
InputDecoration.collapsed(
hintText: '50,000',
hintStyle:
blackTextStyle.copyWith(
fontSize: 20,
fontWeight: bold,
color: greyColor,
),
)),
margin: EdgeInsets.only(top: 30),
padding: EdgeInsets.symmetric(horizontal: 17),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Atau masukkan nominal isi ulang disini',
style: blackTextStyle.copyWith(
fontSize: 20,
fontWeight: bold,
),
],
),
),
),
SizedBox(height: 30),
Column(
children: [
Row(
children: [
Expanded(
child: CustomFilledButton(
title: 'lanjut',
subtitle: 'proceed',
onPressed: () {
setState(() {
if (timer != null)
timer?.cancel();
// tapIdle();
if (mounted) {
denomLimits(
outletName,
info,
int.parse(amountController!
.text
.replaceAll(",", "")));
}
});
// _showQris(context);
/*buildGetQr();*/
/*_getQris();*/
// Navigator.pop(context);
},
),
Text(
'or enter topup amount here',
style: greyTextStyle.copyWith(
fontSize: 15,
fontStyle: FontStyle.italic,
fontWeight: light,
),
),
SizedBox(
height: 20,
),
Container(
height: 50,
padding: EdgeInsets.symmetric(horizontal: 16),
decoration: BoxDecoration(
border: Border.all(color: Colors.black12),
color: Colors.white,
borderRadius: BorderRadius.circular(12)),
child: Center(
child: Row(
children: <Widget>[
Expanded(
child: TextFormField(
style: blackTextStyle.copyWith(
fontSize: 20,
fontWeight: bold,
color: purpleColor,
),
keyboardType:
TextInputType.numberWithOptions(
signed: true,
decimal: true),
controller: amountController,
inputFormatters: [
FilteringTextInputFormatter
.digitsOnly,
CurrencyInputFormatter()
],
textInputAction:
TextInputAction.done,
decoration:
InputDecoration.collapsed(
hintText: '50,000',
hintStyle:
blackTextStyle.copyWith(
fontSize: 20,
fontWeight: bold,
color: greyColor,
),
)),
),
],
),
),
],
),
],
),
SizedBox(height: 30),
Column(
children: [
Row(
children: [
Expanded(
child: CustomFilledButton(
title: 'lanjut',
subtitle: 'proceed',
onPressed: () {
setState(() {
if (timer != null)
timer?.cancel();
// tapIdle();
if (mounted) {
denomLimits(
outletName,
info,
int.parse(amountController!
.text
.replaceAll(",", "")));
}
});
// _showQris(context);
/*buildGetQr();*/
/*_getQris();*/
// Navigator.pop(context);
},
),
),
],
),
],
),
],
),
),
],
),
),
],
),
),
),
),
),
);
});
});
......
......@@ -38,7 +38,6 @@ class _TapCardAktivasiState extends State<TapCardAktivasi>
void initState() {
super.initState();
aktivasi();
initLib();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment