Rave flutter - A Flutter plugin for Flutterwaves's rave.

Overview

Rave Flutter

build status Coverage Status pub package

A robust Flutter plugin for accepting payment on Rave with

  • Card
  • Nigerian Bank Account
  • ACH Payments
  • Mobile money Francophone Africa
  • Mpesa
  • Ghana Mobile Money
  • Uganda Mobile Money

Keys

Installation

To use this plugin, add rave_flutter as a dependency in your pubspec.yaml file.

Webview is required so enable PlatformView on iOS by adding:

<key>io.flutter.embedded_views_preview</key>
<true/

to Info.plist file

Making Payment

Instantiate RavePayInitializer and pass it to RavePayManager.prompt along with the BuildContext. The result of the transaction is the Future returned by RavePayManager.initialize

processTransaction() async {
    // Get a reference to RavePayInitializer
    var initializer = RavePayInitializer(
        amount: 500, publicKey: publicKey, encryptionKey: encryptionKey)
      ..country = "NG"
      ..currency = "NGN"
      ..email = "[email protected]"
      ..fName = "Ciroma"
      ..lName = "Adekunle"
      ..narration = narration ?? ''
      ..txRef = txRef
      ..subAccounts = subAccounts
      ..acceptMpesaPayments = acceptMpesaPayment
      ..acceptAccountPayments = acceptAccountPayment
      ..acceptCardPayments = acceptCardPayment
      ..acceptAchPayments = acceptAchPayments
      ..acceptGHMobileMoneyPayments = acceptGhMMPayments
      ..acceptUgMobileMoneyPayments = acceptUgMMPayments
      ..staging = true
      ..isPreAuth = preAuthCharge
      ..displayFee = shouldDisplayFee;

    // Initialize and get the transaction result
    RaveResult response = await RavePayManager()
        .prompt(context: context, initializer: initializer);
  }

Documentation

Documentation can be found here.

Contributing, Issues and Bug Reports

The project is open to public contribution. Please feel very free to contribute. Experienced an issue or want to report a bug? Please, report it here. Remember to be as descriptive as possible.

Comments
  • Please update packages to latest version

    Please update packages to latest version

    Package not working with my project, causing build errors because of an outdated package

    ../../../../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:26: Error: Type 'DiagnosticableMixin' not found. class PictureStream with DiagnosticableMixin {

    opened by mashegoindustries 14
  • card payment failed

    card payment failed " An error occured while attempting to decrypt some parameters"

    when i tried to do card payment or mpesa it is giving error and console i m getting this *** DioError ***: I/flutter (26380): uri: https://ravesandboxapi.flutterwave.com/flwv3-pug/getpaidx/api/charge I/flutter (26380): DioError [DioErrorType.RESPONSE]: Http status error [400] I/flutter (26380): uri: https://ravesandboxapi.flutterwave.com/flwv3-pug/getpaidx/api/charge I/flutter (26380): statusCode: 400 I/flutter (26380): headers: I/flutter (26380): connection: keep-alive I/flutter (26380): x-powered-by: Express I/flutter (26380): access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, Authorization, v3-xapp-id, flw-auth-token, mra-auth-token, alt_mode_auth, mid I/flutter (26380): date: Mon, 01 Feb 2021 07:28:47 GMT I/flutter (26380): x-moesif-transaction-id: 1b223e84-06c8-4a4c-ba13-feac39de9c40 I/flutter (26380): access-control-allow-origin: * I/flutter (26380): access-control-allow-methods: PUT, POST, GET, DELETE, OPTIONS I/flutter (26380): content-length: 103 I/flutter (26380): etag: W/"67-zshR+cq5UdFzzywHJM9Wlg" I/flutter (26380): via: 1.1 vegur I/flutter (26380): content-type: application/json; charset=utf-8 I/flutter (26380): server: Cowboy I/flutter (26380): Response Text: I/flutter (26380): {"status":"error","message":"An error occured while attempting to decrypt some parameters","data":null} I/flutter (26380): RaveResult{status: RaveStatus.error, rawResponse: null, message: An error occured while attempting to decrypt some parameters}

    opened by HetalGohil 13
  • flutter_svg-0.18.1 problem in flutter 2.0.0

    flutter_svg-0.18.1 problem in flutter 2.0.0

    I have just updated my flutter SDK version to 2.0.0 and I run my project I got this error please Fix this issue asap

    Error

    ../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.18.1/lib/src/picture_provider.dart:50:59: Error: No named parameter with the name 'nullOk'.
            context != null ? Localizations.localeOf(context, nullOk: true) : null,
                                                              ^^^^^^        
    ../../../Development/flutter/packages/flutter/lib/src/widgets/localizations.dart:413:17: Context: Found this candidate, but the arguments don't match.
      static Locale localeOf(BuildContext context) {                        
                    ^^^^^^^^                                                
    FAILURE: Build failed with an exception.                                
    * Where:                                                                
    Script '/Users/helpmac/Development/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 991
    * What went wrong:                                                      
    Execution failed for task ':app:compileFlutterBuildDebug'.              
    > Process 'command '/Users/helpmac/Development/flutter/bin/flutter'' finished with non-zero exit value 1
    * Try:                                                                  
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    * Get more help at https://help.gradle.org                              
    BUILD FAILED in 50s                                                     
    Running Gradle task 'assembleDebug'...                                  
    Running Gradle task 'assembleDebug'... Done                        50.9s
    Exception: Gradle task assembleDebug failed with exit code 1
    

    Flutter doctor

    [✓] Flutter (Channel stable, 2.0.0, on Mac OS X 10.15 19A583 darwin-x64, locale en-GB)
        • Flutter version 2.0.0 at /Users/helpmac/Development/flutter
        • Framework revision 60bd88df91 (9 days ago), 2021-03-03 09:13:17 -0800
        • Engine revision 40441def69
        • Dart version 2.12.0
    [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
        • Android SDK at /Users/helpmac/Library/Android/sdk
        • Platform android-30, build-tools 30.0.2
        • ANDROID_HOME = /Users/helpmac/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
        • All Android licenses accepted.
    [!] Xcode - develop for iOS and macOS
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 11.0, Build version 11A420a
        ! Xcode 11.0.0 out of date (12.0.1 is recommended).
          Download the latest version or update via the Mac App Store.
        • CocoaPods version 1.10.1
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    [✓] Android Studio (version 4.1)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    [✓] VS Code (version 1.54.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.20.0
    [✓] Connected device (3 available)
        • IN Note1 (mobile) • BS7746M4KN1120012228                 • android-arm64  • Android 10 (API 29)
        • iPhone X (mobile) • 3EF95060-4336-4017-9BE0-73CB5C3CE227 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-12-2 (simulator)
        • Chrome (web)      • chrome                               • web-javascript • Google Chrome 89.0.4389.82
    ! Doctor found issues in 1 category.
    
    opened by AdnanKazi 8
  • How to redirect to another page after successful payment

    How to redirect to another page after successful payment

    Please i need help regard the above topic, i want users to only have access to a page in my mobile app after making payment with this plugin, like to redirect the successful payment to another page within my app. Thanks

    help wanted 
    opened by yomibrain 8
  • Wrong public Key error

    Wrong public Key error

    We am getting this error while using Francophone Mobile Money from Ivory coast

    {"status":"error","message":"Invalid public key passed","data":{"code":"INV_PUBK","message":"Invalid public key passed"}}
    

    I have checked the keys on Flutterwave dashboard and it's correct. I have even tried to use the secret key instead but I keep getting this error. I have also tried to generate a new public key, but still

    as a side note i am getting this error on sandbox mode:

    flutter: Response Text:
    flutter: {"status":"success","message":"Charged fee","data":{"charge_amount":"200.00","fee":2.8,"merchantfee":"0","ravefee":"2.8","stampdutyfee":0,"currency":"XOF"}}
    [VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: NoSuchMethodError: The method '[]=' was called on null.
    Receiver: null
    Tried calling: []=("orderRef", "531ce346-d40f-4313-ab36-ba368a3a07e4")
    #0      Object.noSuchMethod  (dart:core-patch/object_patch.dart:53:5)
    #1      Payload.toJson 
    package:rave_flutter/…/dto/payload.dart:142
    #2      new ChargeRequestBody.fromPayload 
    package:rave_flutter/…/dto/charge_request_body.dart:23
    #3      MMFrancophoneTransactionManager.charge 
    package:rave_flutter/…/manager/mm_francoophone_transaction_manager.dart:24
    #4      BaseTransactionManager.displayFeeDialog.charge 
    package:rave_flutter/…/manager/base_transaction_manager.dart:125
    #5      GestureRecognizer.invokeCallback 
    package:flutter/…/gestures/recognizer.dart:182
    #6      TapGestureRecognizer.handleTapUp 
    package:flutter/…/gestures/tap.dart:504
    #7      BaseTapGestureRecognizer._checkUp 
    package:flutter/…/gestures/tap.dart:282
    #8      BaseTapGestureRecognizer.acceptGestu<…>
    

    I don't know if it is wanted or not but it cause the loader to keep rolling until i manually close the box so I can't continue on the next API implementation my app.

    opened by drosarl 6
  • Uganda Mobile Money Support

    Uganda Mobile Money Support

    Hey awesome package, any sort of time scale as to when we could expect support for the 2 remaining unsupported mobile money variants; Uganda and Ghana? It is a great package but hinders a few of us trying to produce apps that have a market not in the other countries you already support.

    enhancement 
    opened by TJMusiitwa 5
  • You can only charge US Accounts in Dollars

    You can only charge US Accounts in Dollars

    Now i'm trying to payment getting this error.

    {"status":"error","message":"You can only charge US Accounts in Dollars","data":{"code":"ERR","message":"You can only charge US Accounts in Dollars"}}

    help wanted 
    opened by saprahits 4
  • Failed assertion: boolean expression must not be null

    Failed assertion: boolean expression must not be null

    Hi @wilburt After the latest changes, the pay modal is not showing, this is the error when I run the .prompt() method

    ════════ Exception caught by widgets ════════════════════════════════
    The following assertion was thrown building IconTheme(color: Color(0xdd000000)):
    Failed assertion: boolean expression must not be null
    
    
    Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
    In either case, please report this assertion by filing a bug on GitHub:
      https://github.com/flutter/flutter/issues/new?template=BUG.md
    
    The relevant error-causing widget was: 
      MaterialApp
    
    bug 
    opened by thukuwanjiku 4
  • The method 'processTransaction' was called on null.

    The method 'processTransaction' was called on null.

    I get this error whenever i try using Ghana Mobile Money Feature. The method 'processTransaction' was called on null. Receiver: null Tried calling: processTransaction(Instance of 'Payload')

    bug gmm 
    opened by snavebaby 4
  • Unable to build app with Flutter 2.0. Update flutter_svg

    Unable to build app with Flutter 2.0. Update flutter_svg

    When I run my app with the new flutter version , I get this error ./../../../.pub-cache/hosted/pub.dartlang.org/rave_flutter-0.0.9-alpha+2/lib/src/ui/payment/rave_pay_widget.dart:2:8: Error: Error when reading '../../../../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.18.1/lib/flutter_svg.dart': No such file or directory This is because I updated my flutter svg package to the new one which is flutter_svg: ^0.19.3 The previous version of flutter svg is not compatible with Flutter 2.0 Fix is to upgrade flutter svg in your pubspec

    opened by Yonkokilasi 3
  • Unhandled Exception: NoSuchMethodError:

    Unhandled Exception: NoSuchMethodError:

    ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: NoSuchMethodError: The method '[]=' was called on null. Receiver: null Tried calling: []=("orderRef", "1591159969334") #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5) #1 Payload.toJson (package:rave_flutter/src/dto/payload.dart:142:11) #2 new ChargeRequestBody.fromPayload (package:rave_flutter/src/dto/charge_request_body.dart:23:60) #3 CardTransactionManager.charge (package:rave_flutter/src/manager/card_transaction_manager.dart:24:50) #4 BaseTransactionManager.displayFeeDialog.charge (package:rave_flutter/src/manager/base_transaction_manager.dart:125:12)

    opened by saprahits 2
  • Bug fixes

    Bug fixes

    Updated pub.yaml with latest dependencies

    Replaced deprecated "autovalidate" to "autovalidateMode: AutovalidateMode.always"

    Replaced deprecated "WhitelistingTextInputFormatter" with "FilteringTextInputFormatter.digitsOnly"

    opened by johnebere58 0
  • MPESA - Transaction successful with pending validation

    MPESA - Transaction successful with pending validation

    Hello, quick silly question! In test all tests on MPESA worked fine but for prod we get the above error message .

    Are we supposed to implement this our selves , or is it some misconfig in the plugin made by me?

    opened by kaliguy17 0
  • Dialog  buttons in the payment flow

    Dialog buttons in the payment flow

    Hi,

    I have been testing out the package but it seems that the confirm buttons when using the mpesa payment flow are not visible (screenshot). Could it be that I am using production keys or what am I missing?

    The logs do not show any error at all.

    opened by LinusMuema 0
Releases(v0.0.9-alpha+1)
Owner
Wilberforce Uwadiegwu
I make computers do things.
Wilberforce Uwadiegwu
This is just the simplyfied Flutter Plugin use for one of the popular flutter plugin for social media login.

social_media_logins Flutter Plugin to login via Social Media Accounts. Available Social Media Logins: Facebook Google Apple Getting Started To use thi

Reymark Esponilla 3 Aug 24, 2022
Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.

Flutter permission_handler plugin The Flutter permission_handler plugin is build following the federated plugin architecture. A detailed explanation o

Baseflow 1.7k Dec 31, 2022
Unloc customizations of the Permission plugin for Flutter. This plugin provides an API to request and check permissions.

Flutter Permission handler Plugin A permissions plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check perm

Unloc 1 Nov 26, 2020
Klutter plugin makes it possible to write a Flutter plugin for both Android and iOS using Kotlin only.

The Klutter Framework makes it possible to write a Flutter plugin for both Android and iOS using Kotlin Multiplatform. Instead of writing platform spe

Gillian 33 Dec 18, 2022
A Flutter step_tracker plugin is collect information from user and display progress through a sequence of steps. this plugin also have privilege for fully customization from user side. like flipkart, amazon, myntra, meesho.

step_tracker plugin A Flutter step_tracker plugin is collect information from user and display progress through a sequence of steps. this plugin also

Roshan nahak 5 Oct 21, 2022
Boris Gautier 1 Jan 31, 2022
A Side Menu plugin for flutter and compatible with liquid ui for flutter

Liquid Shrink Side Menu A Side Menu plugin for flutter and compatible with liquid ui Side Menu Types There are 8 configuration of Liquid shrink side m

Raj Singh 18 Nov 24, 2022
FlutterBoost is a Flutter plugin which enables hybrid integration of Flutter for your existing native apps with minimum efforts

中文文档 中文介绍 Release Note v3.0-preview.17 PS: Before updating the beta version, please read the CHANGELOG to see if there are any BREAKING CHANGE Flutter

Alibaba 6.3k Dec 30, 2022
Flutter Counter is a plugin written in dart for flutter which is really simple and customizeable.

Flutter Counter (iOS & Android) Description Flutter Counter is a plugin written in dart for flutter which is really simple and customizeable. Create i

Salmaan Ahmed 15 Sep 18, 2022
Flutter simple image crop - A simple and easy to use flutter plugin to crop image on iOS and Android

Image Zoom and Cropping plugin for Flutter A simple and easy used flutter plugin to crop image on iOS and Android. Installation Add simple_image_crop

null 97 Dec 14, 2021
Flutter-ffmpeg - FFmpeg plugin for Flutter. Not maintained anymore. Superseded by FFmpegKit.

flutter_ffmpeg FFmpeg plugin for Flutter. Supports iOS and Android. Not maintained anymore, superseded by FFmpegKit. See FlutterFFmpeg to FFmpegKit Mi

Taner Şener 635 Dec 22, 2022
A flutter plugin to add login with facebook in your flutter app

Features Login on iOS, Android and Web. Express login on Android. Granted and declined permissions. User information, picture profile and more. Provid

Darwin Morocho 157 Jan 6, 2023
Flutter blue plus - Flutter plugin for connecting and communicationg with Bluetooth Low Energy devices, on Android and iOS

Introduction FlutterBluePlus is a bluetooth plugin for Flutter, a new app SDK to

null 141 Dec 22, 2022
This is a Flutter plugin that takes a JSON string and converts it onto a customizable Flutter Widget.

Colored JSON Convert JSON string into customizable widget. Getting Started ColoredJson is a stateless widget that produces a structured view of JSON s

null 4 May 20, 2022
Flutter plugin to manage home screen widget within flutter app.

Flutter App Widget App Widget / Home Screen widget plugin for flutter app Usage Please see app_widget subdirectory for the usage documentation. Plafor

Alexander Dischberg 6 Dec 16, 2022
Flutter plugin for creating static & dynamic app shortcuts on the home screen.

Flutter Shortcuts Show some ❤️ and ⭐ the repo Why use Flutter Shortcuts? Flutter Shortcuts Plugin is known for : Flutter Shortcuts Fast, performant &

Divyanshu Shekhar 39 Sep 26, 2022
Flutter plugin for selecting images from the Android and iOS image library, taking new pictures with the camera, and edit them before using such as rotation, cropping, adding sticker/text/filters.

advance_image_picker Flutter plugin for selecting multiple images from the Android and iOS image library, taking new pictures with the camera, and edi

Weta Vietnam 91 Dec 19, 2022
Flutter plugin to simply integrate Agora Video Calling or Live Video Streaming to your app with just a few lines of code.

Agora UI Kit for Flutter Instantly integrate Agora video calling or video streaming into your Flutter application. Getting started Requirements An Ago

Agora.io Community 106 Dec 16, 2022
Flutter plugin for creating static & dynamic app shortcuts on the home screen.

Flutter Shortcuts Compatibility ✅ Android ❌ iOS (active issue: iOS support for quick actions) Show some ❤️ and ⭐ the repo Why use Flutter Shortcuts? F

Devs On Flutter 39 Sep 26, 2022