Skip to content
Ariama Victor (A.K.A. OVAC) edited this page Aug 19, 2017 · 1 revision

Config

Config is the configuration class used by the Api and holds the developer authentication data. It is required by the client handler to authenticate the http calls to the Hubtel Api.

Creating a Config.

The Config class only accepts three arguments :

  • The Hubtel Account Number
  • The Hubtel ClientID
  • The Hubtel ClientSecret

The arguments must be passed in accordingly to the Hubtel Config as follows:

new Config(AccountNumber, ClientId, ClientSecret);

The data on this Client ID and ClientSecret above can be obtained from any existing or new Hubtel account by creating a developer api application as follows:

First navigate to the Hubtel Accounts Api page at https://unity.hubtel.com/account/api-accounts

Click on the add application button.

Select Http Rest Api as the Api type and provide a description of the application and then hit save.

After hitting the save button, The ClientID and ClientSecret will be revealed as shown below.

The Account Number can also be found at https://unity.hubtel.com/merchantaccount/dashboard

Example #1 using the data from the Hubtel account shown above.

use OVAC\HubtelPayment\Config;

$config = new Config('HM2707170067', 'ukoqgisb', 'tfbfugam');

The config can now be injected into a call to any of the Transaction class as shown [here][Wiki/ReceiveMoney]

From existing data

With Arrays::from($data) or new Arrays($data) – note this will convert the existing data to make it match the type of the class, so objects passed to Arrays::from will become arrays.

properties

The config object has setters and getters that allow you to manipulate the properties of the instance subject.