ReceiveMoney
class ReceiveMoney extends Transaction (View source)
Class ReceiveMoney
This class encapsulates and implements an expressive API using a set of methods to implement the required properties to place a call to the Hubtel Server in order to receive money from a customer.
Traits
Properties
| protected ConfigInterface | $config | The Config repository instance. | from Api |
| protected string | $baseUrl | The Default Hubtel Base url for merchant payment | from Api |
| protected Response | $response | This is the response received from the hubtel server if no exception was thrown. | from Api |
| protected string | $customerName | The name of the customer. | from Transaction |
| protected string | $customerEmail | The customer email address | from Transaction |
| protected string | $customerMsisdn | The customer mobile money number. | from Transaction |
| protected string | $channel | The mobile money provider channel | from Transaction |
| protected string | $amount | The mobile money transaction amount | from Transaction |
| protected string | $primaryCallbackURL | A callback URL to receive the transaction status from Hubtel to your API request. | from Transaction |
| protected string | $secondaryCallbackURL | The second URL for callback response in the event of failure of primary callback URL. | from Transaction |
| protected string | $clientReference | The reference number that is provided by you to reference a transaction from your end. | from Transaction |
| protected string | $description | The short description of the transaction. | from Transaction |
| protected | $parametersRequired | {@inheritdoc} | |
| protected | $parametersOptional | {@inheritdoc} | |
| protected string | $token | The 6 digit unique token required to debit a Vodafone Cash customer. This token has to be generated and provided by the Vodafone customer. The customer dials *110# and selects menu item 6 to create the voucher. It expires after 5 minutes if unused | |
| protected boolean | $feesOnCustomer | This allows the fees of the transaction to be charged on the customer. If set to true the AmountCharged = Amount + Charges. |
Methods
Construct for creating a new instance of the ReceiveMoney Api class
Executes the HTTP request.
sets the customer's email address.
Sets the customer's phone number to be billed or funded.
sets the transaction channel (Mobile Network)
sets the money value (Amount) to be sent or received
Returns the primary callback URL that has been set on the instance.
set the callback url to callback if the transaction was successful.
Sets the URL to call back if he transaction is unsuccesful.
Set's a reference on the transaction for easy identification and transaction tracking.
sets a description for the transaction.
This function sets the customer data (name, email and msisdn|number|phone)
This method sests a single callback for both the success and Error
This method sets the callbacks for the Hubtel Payments
Sets the URL to call when the payment fails or is unsuccessfull
Set the URL to call when the payment is been confirmed successful (requred by the Hubtel ReceiveMoney Api)
This method exposes the mass assignment method.
This method is used to mass assign the properties required by the Hubtel ReceiveMoney and SendMoney Api
This method serves as an entry to a transaction class instane. It creates a new transaction class by first starting with the required amount value of the transaction to be created.
Sets the channel (Mobile Network) (requred by the Hubtel ReceiveMoney|SendMoney Api)
Dynamically handle missing Static Api Call to Amount.
Dynamically handle missing public method call on Amount.
This method checks that all properties marked as required have been assigned a value.
This method picks up all the defined properties the $parameterRequired|$parameterOptional property array list from the class object and returns an array containing each list item name as a key and the matching property value from the class
This method calls the accessors for keys passed in and returns back the value it receives from the class instance
The phone number of the customer you want to bill (Send Pompt) (requred by the Hubtel ReceiveMoney Api)
Set the description of the transaction (requred by the Hubtel ReceiveMoney Api)
Sets a reference to reference a transaction from your end.
Sets the customer name as required by the Hubtel Receive Api (requred by the Hubtel ReceiveMoney Api)
Sets the customer email (Optional)
Sets the 6 digit unique token required to debit a Vodafone Cash
Sets if the hubtel and mobile money fees is charged on the customer or client
No description
No description
No description
No description
No description
The method runs the transaction
Details
at line 78
void
__construct(array $data = [])
Construct for creating a new instance of the ReceiveMoney Api class
array
_options(string $url = null, array $parameters = [])
Send an OPTIONS request.
array
execute(string $httpMethod, string $url, array $parameters = [])
Executes the HTTP request.
ConfigInterface
getConfig()
Api
setConfig(ConfigInterface $config)
in Transaction at line 115
string
getCustomerName()
returnes the name of the give customer
in Transaction at line 127
Transaction
setCustomerName(string $customerName)
Sets the name of the customer.
in Transaction at line 139
string
getCustomerEmail()
get the customer's email address.
in Transaction at line 151
Transaction
setCustomerEmail(string $customerEmail)
sets the customer's email address.
in Transaction at line 163
string
getCustomerMsisdn()
gets the msisdn (Customer's phone number)
in Transaction at line 175
Transaction
setCustomerMsisdn(string $customerMsisdn)
Sets the customer's phone number to be billed or funded.
in Transaction at line 187
string
getChannel()
returns the transaction channel (Mobile Network)
in MassAssignable at line 68
abstract MassAssignable
setChannel(string $channel)
sets the transaction channel (Mobile Network)
in Transaction at line 211
string
getAmount()
Gets the money value for the transaction.
in MassAssignable at line 43
abstract MassAssignable
setAmount(string $amount)
sets the money value (Amount) to be sent or received
in Transaction at line 235
string
getPrimaryCallbackURL()
Returns the primary callback URL that has been set on the instance.
in Transaction at line 247
Transaction
setPrimaryCallbackURL(string $primaryCallbackURL)
set the callback url to callback if the transaction was successful.
in Transaction at line 259
string
getSecondaryCallbackURL()
Returns the callback url on the transaction
in Transaction at line 271
Transaction
setSecondaryCallbackURL(string $secondaryCallbackURL)
Sets the URL to call back if he transaction is unsuccesful.
in Transaction at line 283
string
getClientReference()
get the transaction reference.
in MassAssignable at line 60
abstract MassAssignable
setClientReference(string $clientReference)
Set's a reference on the transaction for easy identification and transaction tracking.
in Transaction at line 308
string
getDescription()
gets the description of the transaction.
in MassAssignable at line 51
abstract MassAssignable
setDescription(string $description)
sets a description for the transaction.
in MassAssignable at line 35
abstract MassAssignable
setCustomer(array $data = [])
This function sets the customer data (name, email and msisdn|number|phone)
in Transaction at line 364
Transaction
callback(string $primaryCallbackURL)
This method sests a single callback for both the success and Error
in MassAssignable at line 75
abstract MassAssignable
setCallback(array|string $data = [])
This method sets the callbacks for the Hubtel Payments
in Transaction at line 413
Transaction
callbackOnFail(string $secondaryCallbackURL)
Sets the URL to call when the payment fails or is unsuccessfull
in Transaction at line 424
Transaction
callbackOnSuccess(string $primaryCallbackURL)
Set the URL to call when the payment is been confirmed successful (requred by the Hubtel ReceiveMoney Api)
in MassAssignable at line 82
MassAssignable
make(array $data = [])
This method exposes the mass assignment method.
in MassAssignable at line 93
protected MassAssignable
massAssign(array $data = [])
This method is used to mass assign the properties required by the Hubtel ReceiveMoney and SendMoney Api
in MassAssignable at line 164
protected
assignOnSendMoneyInstance($data = [])
in MassAssignable at line 171
protected
assignOnReceiveMoneyInstance($data = [])
in Transactable at line 33
protected Transactable
amount(float|number $amount)
This method serves as an entry to a transaction class instane. It creates a new transaction class by first starting with the required amount value of the transaction to be created.
(required by the Hubtel ReceiveMoney Api)
in Transactable at line 45
Transactable
channel(string $channel)
Sets the channel (Mobile Network) (requred by the Hubtel ReceiveMoney|SendMoney Api)
in Transactable at line 58
static Transactable
__callStatic(string $method, array $parameters)
Dynamically handle missing Static Api Call to Amount.
in Transactable at line 71
Transactable
__call(string $method, array $parameters)
Dynamically handle missing public method call on Amount.
in CanCleanParameters at line 35
protected bool
propertiesPassRequired()
This method checks that all properties marked as required have been assigned a value.
A protected $parametersRequired property must contain the names of the required parameters on the class that will use this trait method. and all parameters must each have a defined get accessor on the class object instance
in CanCleanParameters at line 60
protected array
propertiesToArray()
This method picks up all the defined properties the $parameterRequired|$parameterOptional property array list from the class object and returns an array containing each list item name as a key and the matching property value from the class
in CanCleanParameters at line 93
protected mixed
accessPropertyByKey(string $key)
This method calls the accessors for keys passed in and returns back the value it receives from the class instance
throws an error if a defined parameter in the $parameterRequired|$parameterOptional does not have a reachable get[PropertyName] accessor defined on the class instance.
at line 89
protected ReceiveMoney
from(string $customerMsisdn)
The phone number of the customer you want to bill (Send Pompt) (requred by the Hubtel ReceiveMoney Api)
at line 100
ReceiveMoney
description(string $description)
Set the description of the transaction (requred by the Hubtel ReceiveMoney Api)
at line 110
ReceiveMoney
reference(string|number $reference)
Sets a reference to reference a transaction from your end.
at line 121
ReceiveMoney
customerName(string $customerName)
Sets the customer name as required by the Hubtel Receive Api (requred by the Hubtel ReceiveMoney Api)
at line 131
ReceiveMoney
customerEmail(string $customerEmail)
Sets the customer email (Optional)
at line 141
ReceiveMoney
token(string $token)
Sets the 6 digit unique token required to debit a Vodafone Cash
at line 151
ReceiveMoney
feesOnCustomer(boolean $feesOnCustomer)
Sets if the hubtel and mobile money fees is charged on the customer or client
at line 159
string
getToken()
at line 169
ReceiveMoney
setToken(string $token)
at line 179
boolean
isFeesOnCustomer()
at line 187
boolean
getFeesOnCustomer()
at line 197
ReceiveMoney
setFeesOnCustomer(boolean $feesOnCustomer)
at line 208
Object
run()
The method runs the transaction