kayode-suc/flutterwave 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kayode-suc/flutterwave

Composer 安装命令:

composer require kayode-suc/flutterwave

包简介

A simple Object Oriented PHP Client for Flutterwave API

README 文档

README

A simple Object Oriented PHP Client for Flutterwave.

Uses Flutterwave API.

Requirements

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

Installation

Via Composer.

composer require kayode-suc/flutterwave

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);

Transfer

Create transfer

https://developer.flutterwave.com/reference#create-a-transfer

/**
 * Create bank transfer
 * 
 * @since 1.0
 * 
 * @param array $details
 * 
 * $client->transfer->create(array $details);
 * 
 * @return array
 */

$transfer = $client->transfer->create(
    [
        'account_bank' => '035',
        'account_number' => '7823810197',
        'amount' => '100',
        'narration' => 'Akhlm Pstmn Trnsfr xx0090',
        'currency' => 'NGN',
        'reference' => '23tdfuyt79_6rytfhtrr645',
        'callback_url' => 'https://webhook.site/b3e505b0-fe02-430e-a538-22bbbce8ce0d',
        'debit_currency' => 'NGN',
    ]
));

print_r($transfer);

Transfer retry

https://developer.flutterwave.com/reference#transfer-retry

/**
 * Retry bank transfer
 * 
 * @since 1.0
 * 
 * @param Int $id
 * @return array
 */

$retry = $client->transfer->retry(191272);
print_r($retry);

Create Bulk transfer

https://developer.flutterwave.com/reference#create-bulk-transfer

/**
 * create bulk transfer
 * 
 * @since 1.0
 * 
 * @param array $details
 * @return array
 */
$transfers = $client->transfer->retry(array());
print($transfers);

Get Transfer Fee

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

/**
 * Get transfer fee
 * 
 * @since 1.0
 *
 * @param array $details
 * @return array
 */

$fees = $client->transfer->fee([]);
print($fees);

Get all transfers

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

/**
 * Get all transfers
 * 
 * @since 1.0
 *
 * @return array
 */
$transfers = $client->transfer->all();
print_r($transfers);

Get a transfers

https://developer.flutterwave.com/reference#get-a-transfer

/**
 * Get a transfer
 * 
 * @since 1.0
 *
 * @param int $id
 *
 * @return array
 */
$transfer = $client->transfer->single(191112);
print_r($transfer);

Get a transfer retry

https://developer.flutterwave.com/reference#get-a-transfer-retry

/**
 * Fetch transfer retry attempts for a single transfer on your account
 * 
 * @since 1.0
 *
 * @param int $id
 *
 * @return array
 */
$retry = $client->transfer->retry_attempt(191112);
print_r($retry);

Get bulk transfer

https://developer.flutterwave.com/reference#get-a-bulk-transfer

/**
 * Get the status of a bulk transfer on your account
 * 
 * @since 1.0
 *
 * @param int $id
 *
 * @return array
 */
$bulk = $client->transfer->get_bulk(191112);
print_r($bulk);

Check transfer rate

https://developer.flutterwave.com/reference#check-transfer-rates

/**
 * Transfer rates when making international transfers
 * 
 * @since 1.0
 *
 * @param int $amount
 * @param string $destination_currency
 * @param string $source_currency
 *
 * @return array
 */
$rate = $client->transfer->rate(1000, 'USD', 'NGN');
print_r($rate);

kayode-suc/flutterwave 适用场景与选型建议

kayode-suc/flutterwave 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 3, 最近一次更新时间为 2021 年 12 月 12 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 kayode-suc/flutterwave 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 kayode-suc/flutterwave 我们能提供哪些服务?
定制开发 / 二次开发

基于 kayode-suc/flutterwave 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 10
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-12-12