genioforge/pulseflow_consumer

Wrapper for PulseFlow v1 API

dev-main 2025-01-23 21:33 UTC

This package is auto-updated.

Last update: 2025-06-23 22:16:47 UTC


README

This is an unofficial SDK for the PulseFlow v1 API. It provides a convenient wrapper for interacting with the PulseFlow API.

Installation

To install the SDK, use Composer:

composer require genioforge/pulseflow_consumer dev-main

Configuration

Add the following configuration to your Laravel application's config/services.php file:

return [
    'pulse' => [
        'key' => env('PULSE_API_KEY'),
        'domain' => env('PULSE_VENDOR_DOMAIN'),
        'pin' => env('PULSE_API_PIN'),
        'secret_key' => env('PULSE_SECRET_KEY'),
    ],
];

Usage

Service Provider

Register the service provider in your config/app.php file:

'providers' => [
    // Other Service Providers

    GenioForge\Consumer\ConsumerServiceProvider::class,
],

Facade

Add the facade to your config/app.php file:

'aliases' => [
    // Other Facades

    'Consumer' => GenioForge\Consumer\ConsumerFacade::class,
],

Example

Here is an example of how to use the SDK:

use GenioForge\Consumer\Repository\RepositoryProvider;

$consumer = RepositoryProvider::getProvider();

// Ensure the provider is initialized
$consumer->ensure_initialised();


// Buy airtime
$reference = 'unique_reference';
$planId = 1;
$networkId = 1;
$phoneNumber = '08012345678';
$amount = 1000;
$airtimePurchaseResponse = $consumer->buy_airtime($reference, $planId, $networkId, $phoneNumber, $amount);
echo $airtimePurchaseResponse->message;

Testing

To run the tests, use PHPUnit:

phpunit

License

This SDK is licensed under the MIT License. See the LICENSE file for more information.