|
|
|
|
@ -31,7 +31,6 @@ class CovidPaymentSummary extends StatefulWidget {
|
|
|
|
|
MyInAppBrowser browser;
|
|
|
|
|
AuthenticatedUser authenticatedUser;
|
|
|
|
|
AppSharedPreferences sharedPref = AppSharedPreferences();
|
|
|
|
|
String transID = "";
|
|
|
|
|
|
|
|
|
|
CovidPaymentSummary({@required this.patientShareResponse, this.selectedPaymentMethod});
|
|
|
|
|
|
|
|
|
|
@ -44,6 +43,8 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
|
|
|
|
|
String tamaraPaymentStatus;
|
|
|
|
|
String tamaraOrderID;
|
|
|
|
|
|
|
|
|
|
String transID = "";
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
projectViewModel = Provider.of(context);
|
|
|
|
|
@ -216,7 +217,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
|
|
|
|
|
|
|
|
|
|
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
|
|
|
|
|
widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
|
|
|
|
|
|
|
|
|
|
transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo);
|
|
|
|
|
widget.browser.openPaymentBrowser(
|
|
|
|
|
amount,
|
|
|
|
|
"Covid appointment payment",
|
|
|
|
|
@ -276,7 +277,8 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
|
|
|
|
|
print("onBrowserExit Called!!!!");
|
|
|
|
|
try {
|
|
|
|
|
if (widget.selectedPaymentMethod == "TAMARA") {
|
|
|
|
|
checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), appo);
|
|
|
|
|
// checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), appo);
|
|
|
|
|
checkTamaraPaymentStatus(transID, appo);
|
|
|
|
|
// if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
|
|
|
|
|
// updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(widget.selectedInstallmentPlan), appo);
|
|
|
|
|
// } else {
|
|
|
|
|
@ -299,7 +301,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
|
|
|
|
|
if (res["status"].toString().toLowerCase() == "success") {
|
|
|
|
|
updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID, num.parse(widget.selectedInstallmentPlan), appo);
|
|
|
|
|
} else {
|
|
|
|
|
updateTamaraRequestStatus("Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "",
|
|
|
|
|
updateTamaraRequestStatus("Failed", "00", transID, tamaraOrderID != null ? tamaraOrderID : "",
|
|
|
|
|
num.parse(widget.selectedInstallmentPlan), appo);
|
|
|
|
|
}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
@ -376,7 +378,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
|
|
|
|
|
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), false, context).then((res) {
|
|
|
|
|
service.checkPaymentStatus(transID, false, context).then((res) {
|
|
|
|
|
print("Printing Payment Status Reponse!!!!");
|
|
|
|
|
print(res);
|
|
|
|
|
String paymentInfo = res['Response_Message'];
|
|
|
|
|
|