Git Product home page Git Product logo

react-native-nigeria-community / react-native-rave-webview Goto Github PK

View Code? Open in Web Editor NEW
13.0 3.0 11.0 29 KB

โ›”๏ธ DEPRECATED ๐Ÿ’ธ๐Ÿ’ณThe package allows you accept payment using Rave by Flutterwave and guess what , it doesn't require any form of linking, just install and begin to use .

Home Page: https://react-native-nigeria.github.io/react-native-rave-webview/

License: MIT License

JavaScript 100.00%
rave ravepay reactnative payment payment-gateway absolute deprecated

react-native-rave-webview's Introduction

No Maintenance Intended

DEPRECATED

This will no longer be maintained or updated, please consider using react-native-ortho instead.

All Contributors

This is the react native SDK for Rave By Flutterwave.

๐Ÿ’ธ๐Ÿ’ณThe package allows you accept payment using Rave by Flutterwave and guess what , it doesn't require any form of linking, just install and begin to use .

Compatibility

Our release cycle is independent of react-native. We follow semver and here is the compatibility table:

@react-native-community/cli react-native
^1.0.0 ^0.59.0

Table Of Content

Getting Started

Prerequisites

Installations

To use react native rave webview in your application, you need to have Node and npm downloaded and installed on your machine.

  • Click Here to download and install Node to your machine, npm is always automatically installed when you install Node.

  • To ensure you have Node and npm installed, enter the following command into your terminal/command prompt node -v and npm -v respectively.

  • To run react native on your machine you can use npm install -g expo-cli to install Expo CLI a command line utility to get you started quickly or use this command npm install -g react-native-cli to install the react native CLI.

Deployment

To Implement Rave By Flutterwave easily with React Native

  • You can get your Public, Secret and your Encryption Keys on your account by clicking this link >>> Flutterwave Rave Live.

  • To get your TEST public, secret and encryption keys click on the Live Mode Toggle button to switch to Test account and Test Mode Toggle button to switch to live.

  • This is shown in the screenshots displayed below.

enter image description here

enter image description here

How It Works

This is a simple demonstration of how to set up a simple react native app and integrate rave react native SDK into it.

Using the Expo CLI command line utility, Enter the following command to get started:

  • expo init AwesomeProject

  • cd AwesomeProject

  • npm start

  • You should get this from your terminal: enter image description here

  • Install the Expo client or mobile application from Apple Store or Playstore

  • Open the Expo client app you installed on your mobile phone, then scan the barcode displaying on the terminal on your PC.

  • If successfully scanned and built, your app should load up on your mobile phone with the result in the image below; enter image description here

Integrating Rave React Native

You can pull in react-native-rave-webview into app with the steps below;

  • Change directory into your current project directory from your terminal and enter this command:

    npm install react-native-rave-webview --save

    OR

    yarn add react-native-rave-webview

    and that's it, you're all good to go!

Note: To use Yarn on your machine Click Here

Usage

Payments

1. import Rave Component

    import Rave from 'react-native-rave-webview';

2. Set your success, failure and close methods

   constructor (props) {
   super(props)
 }

 onSuccess (data) {
   console.log('success', data)
   // You can get the transaction reference from successful transaction charge response returned and handle your transaction verification here
 }

 onCancel () {
   console.log('error', 'Transaction was Cancelled!')
 }

 onError () {
   // an error occoured
 }

3. Use component (ensure to set currency for the desired payment method to display)

render () {
    return (
      <View style={styles.container}>
        <Rave
          buttonText='Pay Now'
          raveKey='<your-api-key-here>'
          amount={20000}
          billingEmail='[email protected]'
          billingMobile='08101274387'
          billingName='Oluwatobi Shokunbi'
          ActivityIndicatorColor='green'
          onCancel={() => this.onCancel()}
          onSuccess={transactionRef => this.onSuccess(transactionRef)}
          btnStyles={{
            backgroundColor: 'green',
            width: 100,
            alignContent: 'center'
          }}
          textStyles={{ color: 'white', alignSelf: 'center' }}
          onError={() => {
            alert('something went wrong')
          }}
          txref='1234'
        />
      </View>
    )
  }

API's

all React-Native-rave-WebView API

Name use/description extra
buttonText Defines text on the button default: Pay Now
textStyles Defines styles for text in button nill
btnStyles Defines style for button nill
raveKey Public or Private paystack key(visit https://rave.flutterwave.com to get yours) nill
amount Amount to be paid nill
txref set TransactionRef of transaction nill
ActivityIndicatorColor color of loader default: green
billingEmail Billers email default: nill
billingMobile Billers mobile default: nill
billingName Billers Name default: nill
onCancel callback function if user cancels default: nill
onSuccess callback function if transaction was successful (it will also return the transactionRef number in the callback ) default: nill
onError callback function if an error occured during transaction default: nill

Contributions

What to help make this package even more awesome? Read how to contribute

Licensing

This project is licensed under MIT license.

Related Projects

Don't forget to star, like and share :)

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


Oluwatobi Shokunbi

๐Ÿ’ป ๐Ÿ“–

Akinyemi Mosolasi

๐Ÿ“–

This project follows the all-contributors specification. Contributions of any kind welcome!

react-native-rave-webview's People

Contributors

allcontributors[bot] avatar just1and0 avatar mosoakinyemi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-native-rave-webview's Issues

The Flutterwave Payment Appears Tinny

The Flutterwave form Appears tinny when it loads, I want it to fit to the modal instead of Appearing Tinny Like it does

I have tried tweaking the HTML in the package code but still no result, is there anyway I can go about it

thanks

white screen

Shows white screen after successfully processing payment , how do i capture the data from flutterwave in the onsuccess/onfail and navigate to another screen, thanks in advance

Webview Issue with react-native-rave-webview

Hy!

For some reason, i get this error message when trying to use react-native-rave-webview in my expo project.

Invariant Violation: WebView has been removed from React Native. It can now be installed and imported from 'react-native-webview' instead of 'react-native'. See https://github.com/react-native-community/react-native-webview

I even installed webview expo install react-native-webview . But it will still giving me the same error above.

I see the error in your code.

import {WebView, Modal, Text, View, TouchableOpacity, ActivityIndicator} from 'react-native';

Webview has been removed from react native into its own repo.

Please update your code to import { WebView } from 'react-native-webview';

Why is this Library Deprecated?

Hello guys,
I'm quite curious, why is this Project Deprecated?

Is there a replacement in the cooking, or is it been abandoned for maintainer time???

This is a really helpful Library and we'll be happy to find ways to support it's maintenance if they're no Legal implications related to the deprecation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.