2017 © Pedro Peláez
 

library laravel-hubtel-payment

A Laravel package for consuming the Hubtel Payment Api

image

ovac/laravel-hubtel-payment

A Laravel package for consuming the Hubtel Payment Api

  • Thursday, July 26, 2018
  • by ovac
  • Repository
  • 4 Watchers
  • 4 Stars
  • 125 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 11 Versions
  • 87 % Grown

The README.md


, (*1)


Laravel Hubtel Payment

A Laravel 5.5 integration for the OVAC Hubtel Payment package., (*2)

Build Status Scrutinizer Code Quality Coverage Status Latest Stable Version Packagist Packagist Dependency Status, (*3)

SensioLabsInsight, (*4)

 Follow me anywhere @ovac4u                         | GitHub
 _________                          _________       | Twitter
|   ___   |.-----.--.--.---.-.----.|  |  |.--.--.   | Facboook
|  |  _   ||  _  |  |  |  _  |  __||__    |  |  |   | Instagram
|  |______||_____|\___/|___._|____|   |__||_____|   | Github + @ovac
|_________|                        www.ovac4u.com   | Facebook + @ovacposts

Introduction.

Laravel Hubtel Payment is a Laravel 5.5 seamless integration of the OVAC Hubtel Payment php client for consuming the Hubtel Payment API and processing mobile-money transactions in a Laravel application., (*5)

With this package, it is easy to process mobile money transactions and automate Mobile Money payment from and to any mobile money subscriber in Ghana from any laravel controller., (*6)

Installation

This packages utilize Composer, for more information on how to install Composer please read the Composer Documentation., (*7)

Install via composer, (*8)

composer require ovac/laravel-hubtel-payment

Register Service Provider

Note! This and next step are optional if you use laravel>=5.5 with package auto discovery feature., (*9)

Add service provider to config/app.php in providers section, (*10)

OVAC\LaravelHubtelPayment\ServiceProvider::class,

Register Facade

Register package facade in config/app.php in aliases section, (*11)

'HubtelPayment' => OVAC\LaravelHubtelPayment\Facades\LaravelHubtelPayment::class,

Publish Configuration File

php artisan vendor:publish --provider="OVAC\LaravelHubtelPayment\ServiceProvider" --tag="config"

Edit .env

Add these lines in the application .env and use your Hubtel Merchant Account Number, ClentID, ClientSecret and callback as shown below., (*12)

Don't know what this is? checkout this documentation, (*13)

``` sh HUBTEL_ACCOUNT_NUMBER=HM00000 #Your Hubtel Merchant Account Number HUBTEL_CLIENT_ID=XXXXXXXX #Your Hubtel Merchant Client ID HUBTEL_CLIENT_SECRET=XXXXXXXX #Your Hubtel Merchant Client Secret. HUBTEL_CALLBACK_URL=https://example.com/payment_success #Default Callback URL HUBTEL_SECONDARY_CALLBACK_URL=https://example.com/error, (*14)


## Basic Usage This library exposes a handfull of facade that seamlessly interfaces with the hubtel-payment php client main classes for basic usage in order to make local configuration optional. ### Note: For advance usage, please refer to the OVAC Hubtel Payment documentation, located [here](https://www.ovac4u.com/hubtel-payment). Just use the Laravel facade alias `HubtelPayment::` instead of the native calls. **Enjoy :)** #### The ReceiveMoney facade may be used to send a prompt to the customer's phone to receive money like a mobile-money agent as follows: ``` php <?php use OVAC\LaravelHubtelPayment\Facades\HubtelPayment; // NOTE: The phone number must be of type string as Laravel considers all numbers with a leading 0 to be a hex number. $payment = HubtelPayment::ReceiveMoney() ->from('0553577261') //- The phone number to send the prompt to. ->amount(100.00) //- The exact amount value of the transaction ->description('Online Purchase') //- Description of the transaction. ->customerName('Ariama Victor') //- Name of the person making the payment.callback after payment. ->channel('mtn-gh') //- The mobile network Channel.configuration ->run(); //- Run the transaction after required data.

The SendMoney facade may also be used to send money to any mobile money customer as follows:

<?php

use OVAC\LaravelHubtelPayment\Facades\HubtelPayment;

// NOTE: The phone number must be of type string as Laravel considers all numbers with a leading 0 to be a hex number.
$payment = HubtelPayment::SendMoney()
                ->to('0553577261')                  //- The phone number to send the prompt to.
                ->amount(100.00)                    //- The exact amount value of the transaction
                ->description('Online Purchase')    //- Description of the transaction.
                ->customerEmail('admin@ovac4u.com') //- Name of the person making the payment.
                ->channel('mtn-gh')                 //- The mobile network Channel.
                ->run();                            //- Run the transaction after required data.

The Refund Facade may also refund money a customer paid in a previous transaction:

<?php

use OVAC\LaravelHubtelPayment\Facades\HubtelPayment;

$payment = HubtelPayment::Refund()
                ->transactionId(1234)               //- The ID of the transaction to refund.
                ->amount(100.00)                    //- The exact amount value of the transaction
                ->clientReference('#11212')         //- A refeerence on your end.
                ->description('Useless Purchase')   //- Description of the transaction.
                ->reason('No longer needs a pen')   //- Name of the person making the payment.
                ->full()                            //- Full or partial refund.
                ->run();                            //- Run the transaction after required data.

Contributing

Thank you for considering contributing to Laravel Hackathon Starter. The contribution guide can be found in the Contribution File, (*15)

Security

If you discover any security related issues, please email instead of using the issue tracker., (*16)

Credits

Reference

How can I thank you?

Why not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or HackerNews? Spread the word!, (*17)

Don't forget to follow me on instagram and twitter, (*18)

Thanks! Ariama Victor (ovac4u)., (*19)

The Versions

26/07 2018
19/02 2018
29/09 2017

dev-analysis-qyMPZ5

dev-analysis-qyMPZ5

A Laravel package for consuming the Hubtel Payment Api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ariama Victor (A.K.A. OVAC BOYA)

laravel payment hubtel

29/09 2017

dev-scrutinizer-patch-2

dev-scrutinizer-patch-2

A Laravel package for consuming the Hubtel Payment Api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ariama Victor (A.K.A. OVAC BOYA)

laravel payment hubtel

29/09 2017

dev-analysis-XNxK1v

dev-analysis-XNxK1v

A Laravel package for consuming the Hubtel Payment Api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ariama Victor (A.K.A. OVAC BOYA)

laravel payment hubtel

29/09 2017

dev-scrutinizer-patch-1

dev-scrutinizer-patch-1

A Laravel package for consuming the Hubtel Payment Api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ariama Victor (A.K.A. OVAC BOYA)

laravel payment hubtel

29/09 2017

dev-analysis-8jy2QL

dev-analysis-8jy2QL

A Laravel package for consuming the Hubtel Payment Api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ariama Victor (A.K.A. OVAC BOYA)

laravel payment hubtel

29/09 2017

dev-analysis-8jy2RL

dev-analysis-8jy2RL

A Laravel package for consuming the Hubtel Payment Api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ariama Victor (A.K.A. OVAC BOYA)

laravel payment hubtel

29/09 2017

v1.0

1.0.0.0

A Laravel package for consuming the Hubtel Payment Api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ariama Victor (A.K.A. OVAC BOYA)

laravel payment hubtel

29/09 2017

dev-revert-1-analysis-XkyPYa

dev-revert-1-analysis-XkyPYa

A Laravel package for consuming the Hubtel Payment Api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ariama Victor (A.K.A. OVAC BOYA)

laravel payment hubtel

29/09 2017

dev-analysis-XkyPYa

dev-analysis-XkyPYa

A Laravel package for consuming the Hubtel Payment Api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ariama Victor (A.K.A. OVAC BOYA)

laravel payment hubtel