Code Monkey home page Code Monkey logo

flutterwave-php's Introduction

Flutterwave-PHP

A PHP client for the Flutterwave payment processing system. This is intended for cases where the payment process is initiated from an API server but carried-out by a web application or SPA.

Installation

As expected:

composer require chrisidakwo/flutterwave-php

Usage

use ChrisIdakwo\Flutterwave\Rave;
$secretKey = 'FLW-SECRET-KEY';
$baseUrl = 'https://baseurl.com/v3';
$rave = new Rave($secretKey, $baseUrl);

// To generate a payment link
$requestData = []; // See https://developer.flutterwave.com/docs/flutterwave-standard
$paymentLink = $rave->standardPayment($requestData)['data']['link'];

// To verify a transaction
$transactionID = '123456';
$transaction = $rave->verifyTransaction($transactionID);

$amount = 34000;
$customerEmail = '[email protected]';

$isVerified = $transaction->amount === $amount && $transaction->currency === 'NGN' 
                && $transaction->customer->email === $customerEmail;

// Refund a transaction
$transactionID = '9408294';
$amount = 300;
$refund = $rave->refundTransaction($transactionID, $amount);

Contribution

Feel free to make contributions following the existing patterns. If you do, please format your code before creating a PR. This will format all files as specified in .php_cs:

vendor/bin/php-cs-fixer fix

Please write tests and make use of micro commits, that is, you should commit even the slightest change you make. Do not wait till you've written a lot of intertwined implementations before making one commit. Use the rule of one commit to one action. It makes reverting a whole lot easier, and allows one to easily follow through your implementation. Not clear? You can go through the present commit history to understand.

flutterwave-php's People

Contributors

chrisidakwo avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.