0.0.2 • Published 5 years ago

adonisjs-flutterwave-rave v0.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

adonis-flutterwave-rave

An addon/plugin package to provide Flutterwave (Rave) payment services in AdonisJS 4.0+

NPM Version Build Status Coveralls

Getting Started

Install from the NPM Registry

    $ adonis install adonisjs-flutterwave-rave

Import and use

  'use strict'
  
  const Rave = use('FlutterwaveRave')
  
  class PaymentsController {
  
      constructor(BillsHistory){
          this.bills_history = BillsHistory
      }
      
      static get inject(){
          return [
              'App/Models/BillsHistory'
          ]
      }
      
      async chargeCard({ request, session, response }){
      
          let response = await Rave.Card.charge({
              cardno: "5273938738903039399"
          })
          
          console.log("RESULT: ", response.body.data)
          
          return response.status(200).json({
             data:response.body.data
          })
      }
  }
  
  module.exports = PaymentsController

License

MIT

Running Tests

    npm i
    npm run lint
    
    npm run test

Credits

Contributing

See the CONTRIBUTING.md file for info