This commit is contained in:
Hamza-Ayed
2024-09-17 00:31:50 +03:00
parent c24eee9e1d
commit 1b50de9a7c
12 changed files with 199 additions and 157 deletions

View File

@@ -31,6 +31,7 @@ class PaymentController extends GetxController {
bool isPromoSheetDialogue = false;
final formKey = GlobalKey<FormState>();
final promo = TextEditingController();
final walletphoneController = TextEditingController();
double totalPassenger = Get.find<MapPassengerController>().totalPassenger;
int? selectedAmount = 0;
List<dynamic> totalPassengerWalletDetails = [];
@@ -762,44 +763,45 @@ class PaymentController extends GetxController {
billingData: PaymobBillingData(),
onPayment: (PaymobResponse response) {},
);
if (response!.responseCode == 'APPROVED') {
Get.defaultDialog(
barrierDismissible: false,
title: 'Payment Successful'.tr,
titleStyle: AppStyle.title,
// backgroundColor: AppColor.greenColor,
content: Text(
'The payment was approved.'.tr,
style: AppStyle.title,
),
confirm: MyElevatedButton(
kolor: AppColor.greenColor,
title: 'OK'.tr,
onPressed: () async {
Get.back();
method();
},
),
);
} else {
Get.defaultDialog(
barrierDismissible: false,
// backgroundColor: AppColor.redColor,
title: 'Payment Failed'.tr,
content: Text(
'The payment was not approved. Please try again.'.tr,
textAlign: TextAlign.center,
style: AppStyle.title,
),
confirm: MyElevatedButton(
title: 'OK'.tr,
kolor: AppColor.redColor,
onPressed: () async {
Get.back();
},
),
);
if (response!.success == true && response.responseCode == '200') {
if (response!.responseCode == 'APPROVED') {
Get.defaultDialog(
barrierDismissible: false,
title: 'Payment Successful'.tr,
titleStyle: AppStyle.title,
// backgroundColor: AppColor.greenColor,
content: Text(
'The payment was approved.'.tr,
style: AppStyle.title,
),
confirm: MyElevatedButton(
kolor: AppColor.greenColor,
title: 'OK'.tr,
onPressed: () async {
Get.back();
method();
},
),
);
} else {
Get.defaultDialog(
barrierDismissible: false,
// backgroundColor: AppColor.redColor,
title: 'Payment Failed'.tr,
content: Text(
'The payment was not approved. Please try again.'.tr,
textAlign: TextAlign.center,
style: AppStyle.title,
),
confirm: MyElevatedButton(
title: 'OK'.tr,
kolor: AppColor.redColor,
onPressed: () async {
Get.back();
},
),
);
}
}
}
} catch (e) {