定制 mecxer713/bgfi-payment 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

mecxer713/bgfi-payment

Composer 安装命令:

composer require mecxer713/bgfi-payment

包简介

PHP SDK (Laravel & Symfony) for integrating the BGFI RDC payment gateway

README 文档

README

SDK unique pour consommer les APIs BGFI RDC (Omnitech) côté Laravel (provider + facade) et Symfony (bundle auto-wirable) : vérification de compte, dépôt Rakakash, collecte mobile money et suivi de transaction.

Prérequis

  • PHP 8.1+
  • Composer
  • Framework: Laravel 10/11/12 ou Symfony 7.x

Installation Laravel

composer require mecxer713/bgfi-payment
php artisan vendor:publish --tag=bgfi-config

.env minimum :

BGFI_BASE_URL=https://api-uat.bgfi.com
BGFI_LOGIN=mon_login
BGFI_PASSWORD=mon_password
BGFI_CONSUMER_ID=xxxx
BGFI_CONSUMER_SECRET=xxxx
BGFI_CURRENCY=CDF

Installation Symfony

composer require mecxer713/bgfi-payment

Activer le bundle (config/bundles.php) :

return [
    // ...
    Mecxer713\BgfiPayment\Symfony\BgfiPaymentBundle::class => ['all' => true],
];

Configuration (config/packages/bgfi_payment.yaml) :

bgfi_payment:
  base_url: https://api-uat.bgfi.com
  login: mon_login
  password: mon_password
  consumer_id: xxxx
  consumer_secret: xxxx
  currency: CDF

Configuration avancée (commune)

Clé Description
base_url URL API BGFI (UAT ou prod).
login / password Identifiants OAuth.
consumer_id / consumer_secret Couple fourni par BGFI.
currency Devise par défaut (CDF…).
default_description Description par défaut des collectes.
return_url URL de retour client après paiement.
verify_ssl true en prod, false possible en UAT.
ca_path Chemin vers le bundle CA si certif custom.
token_ttl Durée de cache du token en secondes (3500).
Laravel seul callback_path, register_callback_route pour le webhook auto.

Utilisation

Laravel : importer le facade. Symfony : auto-wirer le service.

// Laravel
use Mecxer713\BgfiPayment\Facades\BgfiPayment;

// Symfony
use Mecxer713\BgfiPayment\Services\BgfiService;
// $bgfi = $container->get(BgfiService::class);
  • checkAccount(string $account, string $type = 'RAKAKASH', array $bankDetails = [])
    Vérifie l'existence d'un compte.

    $response = BgfiPayment::checkAccount('243820460800');          // Laravel
    // $response = $bgfi->checkAccount('243820460800');             // Symfony
  • deposit(string $phone, float $amount, ?string $currency = null)
    Dépôt Rakakash.

    $response = BgfiPayment::deposit('243998760311', 10000, 'CDF');
    // $response = $bgfi->deposit('243998760311', 10000, 'CDF');
  • collect(array $data)
    Collecte mobile money (amount, phone, reference, currency, return_url optionnel).

    $response = BgfiPayment::collect([
        'amount'    => 25000,
        'phone'     => '243820460800',
        'reference' => 'ORDER-2026-0001',
        'currency'  => 'CDF',
        'return_url'=> 'https://votre-app.test/paiement/retour',
    ]);
    // $response = $bgfi->collect([...]);
  • getCollectStatus(string $externalRef)
    Statut d'une collecte existante.

    $status = BgfiPayment::getCollectStatus('ORDER-2026-0001');
    // $status = $bgfi->getCollectStatus('ORDER-2026-0001');

Webhook / Callback

  • Laravel : route POST auto /{callback_path} (par défaut api/bgfi/callback). Désactiver via BGFI_REGISTER_CALLBACK_ROUTE=false. L'événement Mecxer713\BgfiPayment\Events\BgfiCallbackReceived est dispatché.
  • Symfony : exposez votre propre contrôleur qui appelle BgfiService ou relaie l'événement selon vos besoins.

Vérification rapide (Laravel)

php artisan bgfi:test

Tests

composer test

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固