flutter_ravepay 0.2.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new72

Flutter Ravepay

pub package

Flutter_Ravepay provides a wrapper that incorporate payments using Ravepay within your flutter applications. The integration is achieved using Ravepay's Android/iOS SDK libraries. It currently has full support for only Android. Getting it to work on iOS comes with a few more steps and configurations (soon to come).

Installing

dependencies:
  flutter_ravepay: "^0.2.0"

Import

import 'package:flutter_ravepay/flutter_ravepay.dart';

Instantiate

Ravepay ravePay = Ravepay.of(context);

Charging a Card

RavepayResult result = await ravePay.chargeCard(
    const RavepayConfig(
        amount: 4500.0,
        country: "NG",
        currency: "NGN",
        email: "testemail@gmail.com",
        firstname: "Jeremiah",
        lastname: "Ogbomo",
        narration: "Test Payment",
        publicKey: "****",
        secretKey: "****",
        txRef: "ravePay-1234345",
        useAccounts: false,
        useCards: true,
        isStaging: true,
        useSave: true,
        metadata: [
          const RavepayMeta("email", "jeremiahogbomo@gmail.com"),
          const RavepayMeta("id", "1994"),
        ]
    ),
);

Bugs/Requests

If you encounter any problems feel free to open an issue. If you feel the library is missing a feature, please raise a ticket on Github and I'll look into it. Pull request are also welcome.

Note

For help getting started with Flutter, view our online documentation.

For help on editing plugin code, view the documentation.

License

MIT License

[0.2.0] - 11/07/2018.

  • Initial Pub release

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_ravepay/flutter_ravepay.dart';

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {
  Ravepay ravePay;
  RavepayResult _result;

  void chargeCard() async {
    final RavepayResult result = await ravePay.chargeCard(
      const RavepayConfig(
        amount: 4500.0,
        country: "NG",
        currency: "NGN",
        email: "jeremiahogbomo@gmail.com",
        firstname: "Jeremiah",
        lastname: "Ogbomo",
        narration: "Test Payment",
        publicKey: "FLWPUBK-cd3500135be97b13a29c70e3ee233cbf-X",
        secretKey: "FLWSECK-6257675603889ba57c880eda2a936b46-X",
        txRef: "ravePay-1234345",
        useAccounts: false,
        useCards: true,
        isStaging: true,
        useSave: true,
        metadata: [
          const RavepayMeta("email", "jeremiahogbomo@gmail.com"),
          const RavepayMeta("id", "1994"),
        ],
      ),
    );

    setState(() {
      _result = result;
    });
  }

  @override
  Widget build(BuildContext context) {
    ravePay = Ravepay.of(context);

    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text('Flutter Ravepay'),
        ),
        body: new Center(
          child: SingleChildScrollView(
            child: new Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                new RaisedButton(
                  color: Colors.green,
                  onPressed: () => chargeCard(),
                  child: new Text("TEST"),
                ),
                SizedBox(
                  height: 16.0,
                ),
                new Text('Working?: ${_result?.toMap()}\n'),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_ravepay: ^0.2.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_ravepay/flutter_ravepay.dart';
  
Version Uploaded Documentation Archive
0.2.1 Aug 11, 2018 Go to the documentation of flutter_ravepay 0.2.1 Download flutter_ravepay 0.2.1 archive
0.2.0 Aug 11, 2018 Go to the documentation of flutter_ravepay 0.2.0 Download flutter_ravepay 0.2.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
44
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
72
Learn more about scoring.

We analyzed this package on Aug 11, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.11.8
  • Flutter: 0.5.7

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Suggestions

Package is pre-v1 release.

While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.58.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.6 1.14.11
meta 1.1.5 1.1.6
sky_engine 0.0.99
typed_data 1.1.5 1.1.6
vector_math 2.0.6 2.0.8