flutterwave-flutter
flutterwave-flutter copied to clipboard
type 'String' is not a subtype of type 'int' - Also unable to fetch banks
I integrated flutterwave in my flutter app. when in debug mode everything was working fine but after i decided to go live i keep getting errors Am using the following payment methods
Pay with Account: In this one am not able to get the list of banks instead it throws the error
[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: Flutterwave Error: Flutterwave Error: Unable to fetch banks. Please contact support
Pay with Card
when i try to pay with card it says Merchant is not enabled for Rave v3
Pay with Bank Transfer
When i click pay on this i get type 'String' is not a subtype of type 'int'
Pay with USSD Here they are only seven available banks and i can't verify transaction
My Dependencies
flutterwave: ^1.0.1
tripledes: ^2.1.0
webview_flutter: ^2.0.10
My Code
beginPayment(BuildContext context, Map<String, dynamic> data) async {
final Flutterwave flutterwave = Flutterwave.forUIPayment(
context: context,
encryptionKey: data['encKey'],
publicKey: data['pKey'],
currency: data['currency'],
amount: data['amount'],
email: data['mail'],
fullName: data['name'],
txRef: data['txref'],
isDebugMode: false,
phoneNumber: data['number'],
acceptCardPayment: true,
acceptUSSDPayment: true,
acceptAccountPayment: true,
acceptFrancophoneMobileMoney: false,
acceptGhanaPayment: false,
acceptMpesaPayment: false,
acceptRwandaMoneyPayment: false,
acceptBankTransfer: true,
acceptUgandaPayment: false,
acceptZambiaPayment: false);
try {
final ChargeResponse response = await flutterwave.initializeForUiPayments();
if (response == null) {
fToast("Payment not completed", errorRed);
} else {
final isSuccessful = checkPaymentIsSuccessful(response, data);
if (isSuccessful) {
fToast("Payment Successful", pop);
} else {
fToast("Error processing payment", errorRed);
}
}
} catch (error, stacktrace) {
snackBar(context, "Error", error, errorRed);
}
}
Flutter doctor -v
[√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [Version 6.3.9600], locale en-US)
• Flutter version 2.2.3 at D:\flutter\Sdk\flutter
• Framework revision f4abaa0735 (4 months ago), 2021-07-01 12:46:11 -0700
• Engine revision 241c87ad80
• Dart version 2.13.4
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Users\bright\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.
[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio1
• Flutter plugin version 44.0.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[√] VS Code (version 1.61.2)
• VS Code at C:\Users\bright\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.27.0
[√] Connected device (2 available)
• Infinix X652A (mobile) • 0494625032002068 • android-arm64 • Android 9 (API 28)
• Edge (web) • edge • web-javascript • Microsoft Edge 92.0.902.84
! Doctor found issues in 1 category.
Please how can i solve this. Is there any thing am missing