Git Product home page Git Product logo

vue-v3's Introduction

Flutterwave Vue.JS (Vue2) Library

Publish Vue.js Package npm npm NPM

The Vue SDK helps you create seamless payment experiences in your Vue(2.X) mobile/web app. By connecting to our modal, you can start collecting payment in no time.

Available features include:

  • Collections: Card, Account, Mobile money, Bank Transfers, USSD, Barter, NQR.
  • Recurring payments: Tokenization and Subscriptions.
  • Split payments

Table of Contents

  1. Requirements
  2. Installation
  3. Initialization
  4. Usage
  5. Debugging errors
  6. Support
  7. Contribution
  8. License

Requirements

  1. Flutterwave for business V3 API keys
  2. Vue version = 2.x.x

Installation

Install the SDK

$ npm install flutterwave-vue-v3

# OR

$ yarn  add  flutterwave-vue-v3

Initialization

  1. Import the Flutterwave Library in the 'main.js' file.

  2. Add the Flutterwave plugin to your app passing in your Flutterwave Public Key (optional)

Note 💡: For a Typescript project sample, please see the project in the example directory of the project repository.

If Public key is not added you will have to pass in the public_key parameter to the provided payment component button and payment function

//main.js
import Vue from 'vue'
import App from './App.vue'
import Flutterwave from  'flutterwave-vue-v3'


Vue.use(Flutterwave, { publicKey: 'FLWPUBK_TESTXXXXXXXXXX' } )

new Vue({
  render: h => h(App),
}).$mount('#app')

Usage

  1. Collections
  2. Recurring Payments
  3. Split payments

Debugging Errors

We understand that you may run into some errors while integrating our library. You can read more about our error messages here.

For authorization and validation error responses, double-check your API keys and request. If you get a server error, kindly engage the team for support.

Support

For additional assistance using this library, please create an issue on the Github repo or contact the developer experience (DX) team via email or on Slack.

You can also follow us @FlutterwaveEng and let us know what you think 😊.

Contribution

We welcome contributions from the community. Please see the community guide for contributions guidelines.

License

By contributing to this library, you agree that your contributions will be licensed under its MIT license.

Copyright (c) Flutterwave Inc.

vue-v3's People

Contributors

chijiokeflw avatar chijiokeokorji avatar corneliusyaovi avatar dependabot[bot] avatar korneliosyaovi avatar toybz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

vue-v3's Issues

Typescript compatibility issue

Hi team,

I'm having the following issue, using the 'payWithFlutterwave' api with Vue and Typescript.

Property 'payWithFlutterwave' does not exist on type 'ComponentPublicInstance<{} ...>

It seems like the issue started with finding the declaration file

Could not find a declaration file for module 'flutterwave-vue-v3'. '/.../node_modules/flutterwave-vue-v3/dist/flutterwave-vue-v3.ssr.js' implicitly has an 'any' type....

This line is actually breaking the code:
this.payWithFlutterwave(this.paymentData)

I hope this can be looked into, and a solution provided for TS users.

Thank you

Dealing with timeouts and prolonged payment procesing

First of all, I'd like to thank you for putting up this excellent library, it really makes it much easier and faster to integrate flutterwave payments into a vue.js application.

I have noticed situations where, after payment has been initiated, flutterwave takes a long time to finalize the payment. The money would already have been deducted from one's account, but the payment would still be incomplete on the app, and therefore, a redirect or callback function would still be pending.

When a user gets tired of waiting and clicks the modal close button, they are prompted to confirm whether they want to cancel the transaction. Upon confirmation, the modal is closed and the payment processing is cancelled. However, money has already been deducted from one's account (they even receive a receipt and flutterwave records it as a successful transaction), and yet they cannot use the service because payment wasn't "successful" on the app (in the sense that neither redirect_url nor callback were triggered).

I would therefore like to request that such matters are looked into and addressed, so that users have a better user experience. It would be good if people could get a refund automatically if a transaction wasn't successful.

Thanks.

redirect_url returning ‘server not found’

Correct me if I'm wrong but I thought the redirect_url property was for the link to the page on your site that handles success or failure of a transaction depending on the status query param. I set mine to the page on the site waiting to handle the query params but I keep getting a server not found error. What am I doing wrong?

build failure

this dependency was not found:

  • flutterwave-vue-v3 in ./src/main.ts
    To install it, you can run: npm install --save flutterwave-vue-v3

v 1.0.8

On test mode, OTP is not sent to customer's phone

As an example, php/laravel's SDK sends successfully OTP to customer's phone number on a test mode, but not in Vue SDK. Unless if a user or I already know that it's 123456, it wont be possible to know.

Regardless, on a live mode, it works swiftly👌🏽

Customer details not binding to input fields

I keep getting an invalid email error on the modal every time I bind the customer name, email, and phone number fields to the v-model on the input fields to programmatically populate those fields. The same goes for the amount stating that it must not be less than zero. Using console log statements to debug indicates that all fields are returning expected values. Help!
I'm using Vue/Nuxt 2.x
I basically need to not hardcode the customer details.

redirect in callback

Howdy again,

I read from the Flutterwave inline docs that one has two options when a payment is successfully completed, either

  • use redirect_url, or
  • use callback

The docs state that

... If you provide both redirect_url and callback in your request, the callback will be ignored and the customer will be redirected to the provided redirect URL. i.e redirect_url takes precedence over callback function when both are available.

and I have proved this to be true.

However, I have a situation where I need to perform some actions and then redirect to a particular route. I have ommitted the redirect_url option as per docs, and my callback is something like this:

    makePaymentCallback(response) {
      console.log("Pay", response);
      // some other stuff here ...
      this.$router.replace({ path: "/start" });
    },

However, this.$router.replace({ path: "/start" }); has no effect. Is there a way of being able to rediret in a callback?

Thanks

CORS

Howdy,

Thank you so much for this awesome library 🔥

I just encountered the following error while testing out the library in a browser:

Access to fetch at 'https://kgelfdz7mf.execute-api.us-east-1.amazonaws.com/staging/sendevent' 
from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin'
header is present on the requested resource. If an opaque response serves your needs,
set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

I'm using quasar and I intend to target Android.

Would be most grateful for help on resolving this.

Whatsapp number not mobile money number

Hello,
how do I handle a situation where a customer's WhatsApp number is different from the mobile money number? This question is a result of receiving the OTP via WhatsApp during development.

Test mode no longer accepts different currencies

Hello,
Putting my account in test mode no longer allows testing with currencies other than the one for the account. e.g If my account is NGN I cannot test with a USD (or any other currency) transaction which wasn't the case until recently. The simulation of transactions is essential for demos for potential clients.

subaccounts option causes the app to crash

When testing the subaccounts feature, is the key "subaccounts" or "subaccount".
While using subaccounts the application crashes with the error below.

v3.js:1 Uncaught DOMException: Failed to execute 'postMessage' on 'Window': [object Array] could not be cloned. at q.readytorecieve (https://checkout.flutterwave.com/v3.js:1:29543) at t.PBFPubKey.F.<computed> (https://checkout.flutterwave.com/v3.js:1:31481)

When using subaccount it works fine but the split transaction cannot be found in the flutterwave portal.

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.