|
|
|
|
@ -7,7 +7,6 @@ import 'package:clarity_flutter/clarity_flutter.dart';
|
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
|
import 'package:flutter_amazonpaymentservices/flutter_amazonpaymentservices.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/api_consts.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/app_assets.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/app_state.dart';
|
|
|
|
|
@ -830,28 +829,4 @@ class _WalletPaymentConfirmPageState extends State<WalletPaymentConfirmPage> {
|
|
|
|
|
"",
|
|
|
|
|
"3");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> runSafePayment(Map<String, dynamic> requestParam, {String sdkToken = ""}) async {
|
|
|
|
|
dynamic result;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
// Force a 100ms microtask buffer to isolate the UI rendering channel
|
|
|
|
|
await Future.delayed(const Duration(milliseconds: 350));
|
|
|
|
|
|
|
|
|
|
result = await FlutterAmazonpaymentservices.normalPay(requestParam, ApiConsts.payFortEnvironmentType, isShowResponsePage: true);
|
|
|
|
|
|
|
|
|
|
print("Payment Success Data: ${result.toString()}");
|
|
|
|
|
} on PlatformException catch (e) {
|
|
|
|
|
// If the error is the MethodChannel duplicate reply bug, handle it safely
|
|
|
|
|
if (e.message != null && e.message!.contains("Reply already submitted")) {
|
|
|
|
|
print("Swallowed native channel race-condition crash safely.");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Process real payment rejection errors here
|
|
|
|
|
print("Actual Payment Failure: ${e.details.toString()}");
|
|
|
|
|
} catch (error) {
|
|
|
|
|
print("Generic Error: $error");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|