Git Product home page Git Product logo

flutterwave's Introduction

Flutterwave Client

A simple Object Oriented PHP Client for Flutterwave.

Uses Flutterwave API.

Requirements

  • PHP >= 7.2
  • Guzzlehttp ~6|~7

Installation

Via Composer.

PHP 7.2+:

This project is still in beta version and has not been upload to packagis

##Transactions

Get all transactions

https://developer.flutterwave.com/reference#get-all-transactions

<?php

// This file is generated by Composer
require_once __DIR__ . '/vendor/autoload.php';

use KayodeSuc\Flutterwave\Client;

// Create a new Client instance
$client = new Client('Your Api Key');

// $client->transaction->all();
$transactions = $client->transaction->all();

print_r($transactions);

Get transaction fee

https://developer.flutterwave.com/reference#get-transaction-fee

<?php

// This file is generated by Composer
require_once __DIR__ . '/vendor/autoload.php';

use KayodeSuc\Flutterwave\Client;

// Create a new Client instance
$client = new Client('Your Api Key');
/**
 * Get transaction fee
 * 
 * @since 1.0
 * 
 * @param Int $amount
 * @param string $currency
 * @param string $payment_type
 * @return array
 * 
 * $client->transaction->fee(int $amount, string $currency = 'NGN', string $payment_type = 'card') 
 */

$fee = $client->transaction->fee(10000);

print_r($fee);

Resend transaction webhook

https://developer.flutterwave.com/reference#resend-transaction-webhook

<?php

// This file is generated by Composer
require_once __DIR__ . '/vendor/autoload.php';

use KayodeSuc\Flutterwave\Client;

// Create a new Client instance
$client = new Client('Your Api Key');

/**
 * Resend transaction webhook
 * 
 * @since 1.0
 * 
 * @param Int $id
 * @return array
 *
 * $id - This is the transaction unique identifier.
 *
 * $client->transaction->resend_webhook(int $id)
 *
 */

$transaction = $client->transaction->resend_webhook(1000);

print_r($transaction);

Transaction refund

https://developer.flutterwave.com/reference#transaction-refund

<?php

// This file is generated by Composer
require_once __DIR__ . '/vendor/autoload.php';

use KayodeSuc\Flutterwave\Client;

// Create a new Client instance
$client = new Client('Your Api Key');

/**
 * initiate a transaction refund
 * 
 * @since 1.0
 * 
 * @param Int $id
 * @param Int $amount
 * @return array
 *
 * $client->transaction->refund(int $id, int $amount)
 *
 * $id - This is the transaction unique identifier.
 * $amount - amount.
 *
 */

$transaction = $client->transaction->refund(2069367, 50);

print_r($transaction);

Verify Transaction

https://developer.flutterwave.com/reference#verify-transaction

<?php

// This file is generated by Composer
require_once __DIR__ . '/vendor/autoload.php';

use KayodeSuc\Flutterwave\Client;

// Create a new Client instance
$client = new Client('Your Api Key');

/**
 * Verify transactions using the transaction ID
 * 
 * @since 1.0
 * 
 * @param Int $id
 *
 * @return array
 *
 * $client->transaction->verify(int $id)
 *
 * $id - This is the transaction unique identifier.
 * $amount - amount.
 *
 */

$transaction = $client->transaction->verify(2069367));

print_r($transaction);

View transaction timeline

https://developer.flutterwave.com/reference#get-transaction-events

<?php

// This file is generated by Composer
require_once __DIR__ . '/vendor/autoload.php';

use KayodeSuc\Flutterwave\Client;

// Create a new Client instance
$client = new Client('Your Api Key');

/**
 * View Transaction Timeline
 * 
 * @since 1.0
 * 
 * @param Int $id
 *
 * @return array
 *
 * $client->transaction->timeline(int $id)
 *
 * $id - This is the transaction unique identifier.
 *
 */

$transaction = $client->transaction->timeline(2069367));

print_r($transaction);

flutterwave's People

Contributors

abdulsalamishaq avatar

Watchers

 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.