pull/379/head
haroon amjad 2 weeks ago
parent 5a5282eff4
commit eb67f39ee2

@ -133,21 +133,27 @@ class MyFatoorahViewModel extends ChangeNotifier {
});
}
initApplePayPayment(num invoiceValue, MFApplePayButton mfApplePayButton) async {
executeApplePayPayment() {
MFApplepay.executeApplePayPayment(onInvoiceCreated: (invoiceID) {
log(
invoiceID.toString(),
);
}).then((value) {
log(
value.toString(),
);
}).catchError((error) {
log(error.message);
});
}
initApplePayPayment(num invoiceValue) async {
await MFSDK.init(MyFatoorahConfig.configAPIKey, ApiConsts.myFatoorahCountry, ApiConsts.myFatoorahEnvironmentType);
await MFSDK.initSession(MFInitiateSessionRequest(), MFLanguage.ENGLISH).then((value) async {
var executePaymentRequest = MFExecutePaymentRequest(invoiceValue: 121, displayCurrencyIso: MFCurrencyISO.KUWAIT_KWD);
await mfApplePayButton.executeApplePayButton(
executePaymentRequest,
(String invoiceId) {
print("Payment Success! Invoice ID: $invoiceId");
},
).catchError((error) {
// If initialized properly, this error won't occur
print("Apple Pay Error: ${error.message}");
});
var executePaymentRequest = MFExecutePaymentRequest(invoiceValue: invoiceValue, sessionId: value.sessionId, displayCurrencyIso: MFCurrencyISO.SAUDIARABIA_SAR);
MFApplepay.setupApplePay(value, executePaymentRequest, MFLanguage.ENGLISH, merchantName: "Dr Sulaiman Al Habib");
}).catchError((error) {
log(error.message);
});

@ -71,6 +71,11 @@ class _ImmediateLiveCarePaymentPageState extends State<ImmediateLiveCarePaymentP
Clarity.setCurrentScreenName('LiveCare Payment Page');
scheduleMicrotask(() {
payfortViewModel.initPayfortViewModel();
if (appState.isMyFatoorahEnabled) {
myFatoorahViewModel.initApplePayPayment(num.parse((immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.total ?? "0.0")));
}
myAppointmentsViewModel.getTamaraInstallmentsDetails().then((val) {
if (myAppointmentsViewModel.getTamaraInstallmentsDetailsResponseModel != null) {
if (num.parse(immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.total!) >= myAppointmentsViewModel.getTamaraInstallmentsDetailsResponseModel!.minLimit!.amount! &&
@ -755,7 +760,7 @@ class _ImmediateLiveCarePaymentPageState extends State<ImmediateLiveCarePaymentP
// payfortVM.setIsApplePayConfigurationLoading(true);
if (Utils.havePrivilege(103)) {
// startApplePay();
myFatoorahViewModel.initApplePayPayment(121.5, mfApplePayButton);
myFatoorahViewModel.executeApplePayPayment();
} else {
openPaymentURL("ApplePay");
}

@ -92,7 +92,7 @@ class HabibWalletCard extends StatelessWidget {
),
SizedBox(width: 8.h),
(habibWalletVM.isWalletAmountHidden
? "••••"
? "****"
: NumberFormat.decimalPattern().format(habibWalletVM.habibWalletAmount).toString())
.toText32(isBold: true, isEnglishOnly: true)
.toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.h, width: 80.h, height: 40.h),

@ -92,7 +92,7 @@ class LakumWalletCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
(habibWalletVM.isLakumPointsHidden
? "••••"
? "****"
: NumberFormat.decimalPattern()
.format(habibWalletVM.isLakumAccountInfoLoading
? 123

Loading…
Cancel
Save