Commit da73a8b7 authored by Izol's avatar Izol

adjust_validation_to_print_transactions_positive_negative

parent 9ab4a3c6
......@@ -20,6 +20,7 @@
<change beforePath="$PROJECT_DIR$/android/.gradle/7.4/fileHashes/fileHashes.bin" beforeDir="false" afterPath="$PROJECT_DIR$/android/.gradle/7.4/fileHashes/fileHashes.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/.gradle/7.4/fileHashes/fileHashes.lock" beforeDir="false" afterPath="$PROJECT_DIR$/android/.gradle/7.4/fileHashes/fileHashes.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock" beforeDir="false" afterPath="$PROJECT_DIR$/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/.gradle/buildOutputCleanup/outputFiles.bin" beforeDir="false" afterPath="$PROJECT_DIR$/android/.gradle/buildOutputCleanup/outputFiles.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/android/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/daemon/7.4/registry.bin" beforeDir="false" afterPath="$PROJECT_DIR$/daemon/7.4/registry.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/daemon/7.4/registry.bin.lock" beforeDir="false" afterPath="$PROJECT_DIR$/daemon/7.4/registry.bin.lock" afterDir="false" />
......
......@@ -20,6 +20,7 @@
<change beforePath="$PROJECT_DIR$/.gradle/7.4/fileHashes/fileHashes.bin" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/7.4/fileHashes/fileHashes.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/7.4/fileHashes/fileHashes.lock" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/7.4/fileHashes/fileHashes.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/buildOutputCleanup/buildOutputCleanup.lock" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/buildOutputCleanup/buildOutputCleanup.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/buildOutputCleanup/outputFiles.bin" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/buildOutputCleanup/outputFiles.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../daemon/7.4/registry.bin" beforeDir="false" afterPath="$PROJECT_DIR$/../daemon/7.4/registry.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../daemon/7.4/registry.bin.lock" beforeDir="false" afterPath="$PROJECT_DIR$/../daemon/7.4/registry.bin.lock" afterDir="false" />
......
No preview for this file type
......@@ -344,37 +344,6 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
print('topup gagal');
isShowingDialog = true;
// String companyName, companyPhone, denom;
// companyName = PreferencesHelper.getString('outletname');
// companyPhone = PreferencesHelper.getString('companyphone');
// denom = amountController!.text.replaceAll(",", "");
// infoM = await StartService.print(
// info,
// companyName.split("-")[0],
// companyAddress,
// companyPhone,
// approvalCode,
// prevBalance!,
// "1",
// (int.parse("10")+int.parse("1")+int.parse("0")).toString(),
// denom.replaceAll(",", ""));
// AwesomeDialog(
// context: context,
// dialogType: DialogType.error,
// animType: AnimType.rightSlide,
// headerAnimationLoop: true,
// title: 'Saldo Anda Tidak Bertambah $balance',
// titleTextStyle: blackTextStyle.copyWith(
// fontSize: 20,
// fontWeight: bold,
// ),
// desc: "Periksa Kembali Struk Anda !",
// descTextStyle: blackTextStyle.copyWith(
// fontSize: 18,
// fontWeight: medium,
// ),
// )
// .show();
}
return "";
}
......@@ -438,7 +407,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
if (info.toString().toLowerCase().contains('failed')) {
print('ini pesan salah');
message = "Silakan Tempel Wristband Anda Di Reader";
tapDial();
tapBalance();
} else {
infoCard = info;
var infoMap = jsonDecode(info);
......@@ -457,6 +426,7 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
title: 'Kartu tidak sama ! tempelkan kartu sebelumnya',
desc: "Cards are not the same! please put the previous card ${countMax}",
btnOkOnPress: () async {
if (timer != null) timer?.cancel();
if (countMax < 3) {
var isTap = await StartService.getCard();
_getInfoBeforeTopup(isTap);
......@@ -469,11 +439,31 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
headerAnimationLoop: true,
title: 'Transaksi anda gagal ! dikarenakan tidak menempelkan kartu sebelumnya',
desc: "Your transaction failed ! because didn't attach the previous card!",
btnOkOnPress: () {
Navigator.pop(context);
btnOkOnPress: (){
setState(() {
countMax = 0;
});
countMax = 0 ;
}); /*disini juga ga bisa*/
if (timer != null) timer?.cancel();
// Navigator.pop(context);
String companyName, companyPhone, denom;
companyName = 'Rockefeller';
companyPhone = 'TOPUP - GAGAL';
companyAddress = 'st.indonesia, jakarta raya';
denom = amountController!.text.replaceAll(",", "");
String sca =
PreferencesHelper.getString("multioutletservicechargeamount");
String sc = PreferencesHelper.getString("multioutletservicecharge");
StartService.print(
info,
companyName.split("-")[0],
companyAddress,
companyPhone,
approvalCode,
prevBalance!,
"1",
(int.parse("10") + int.parse("1") + int.parse("0")).toString(),
denom.replaceAll(",", ""));
Navigator.pop(context);
},
btnOkIcon: Icons.cancel,
btnOkColor: Colors.red)
......@@ -483,16 +473,24 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
btnOkIcon: Icons.cancel,
btnOkColor: Colors.red)
.show();
// setState((){
// dataQris = null;
// isShowingDialog = false;
// });
// if (timer != null) timer?.cancel();
// tapIdle();
// setState(() {
// countMax = 0 ;
// }); kalo ditaro disini bisa manggil kalo berhasil
Future.delayed(Duration(seconds: int.parse(idle)), () {
if (timer != null) timer?.cancel();
isShowingDialog = false;
tapIdle();
// if(mounted){
// setState(() {
// countMax= 0;
// });
// }
});
}
// ini udah tpi dia muncul notif
}
// setState(() {
// countMax= 0;
// });
});
}
......@@ -558,10 +556,9 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
).show();
Future.delayed(Duration(seconds: int.parse(idle)), () {
Navigator.pop(context);
timer?.cancel();
isShowingDialog = true;
_showTap();
tapDial();
if (timer != null) timer?.cancel();
isShowingDialog = false;
tapIdle();
});
// timer = Timer.periodic(Duration(seconds: int.parse(idle)),(timer){
// print("ini pesan waktu idle : $idle");
......@@ -603,7 +600,6 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
cardType = "Tidak Terdaftar";
break;
}
balance = CurrencyFormat.convertToIdr(
infoMap["balance"],
2,
......@@ -667,6 +663,14 @@ class _HomePageState extends State<HomePage> implements AlertDialogCallback {
});
}
void tapBalance() async {
Future.delayed(const Duration(milliseconds: 200), () async {
var isTap = await StartService.getCard();
_getInfoBalance(isTap);
// timer?.cancel();
});
}
Future<void> _showTap() {
return showDialog<void>(
context: context,
......
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