-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Failed to update session
when making a payment in Live mode. But in test mode, it successfully process the payment.
@override
void initState() {
super.initState();
MFSDK.init(myFatoorahLiveToken, MFCountry.QATAR, MFEnvironment.LIVE);
initiateSession();
}
void initiateSession() {
MFSDK.initiateSession(null, (MFResult<MFInitiateSessionResponse> result) {
if (result.isSuccess()) {
// This for embedded payment view
return mfPaymentCardView.load(result.response!);
} else {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text("Failed session: ${result.error!.message}")),
// result.error!.message = failed to update session
);
}
});
}
void payWithEmbeddedPayment() {
var request = MFExecutePaymentRequest.constructor(
double.parse(widget.amount.toString()),
);
mfPaymentCardView.pay(request, MFAPILanguage.EN,
(String invoiceId, MFResult<MFPaymentStatusResponse> result) {
if (result.isSuccess()) {
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
content:
Text('Success!: The payment was confirmed successfully!')));
setState(() {
...
});
} else {
.....
}
});
}
Metadata
Metadata
Assignees
Labels
No labels