Download the PHP package hosannahighertech/gateway-php without Composer
On this page you can find all versions of the php package hosannahighertech/gateway-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hosannahighertech/gateway-php
More information about hosannahighertech/gateway-php
Files in hosannahighertech/gateway-php
Package gateway-php
Short Description Hosanna e-Payment Gateway API PHP library
License MIT
Informations about the package gateway-php
Hosanna e-Payment Gateway PHP library
Requirements
PHP 5.4.0 and later.
Composer
You can install the library via Composer. Run the following command:
To use the library, use Composer's autoload:
Dependencies
The library depends on Requests Http Library
. The Library is included so you dont have to install anything.
Getting Started
1. Creating gateway Object.
To create the Gateway object you need to first define your configurations. Your configurations Object must implement hosannahighertech\gateway\interfaces\ConfigurationInterface
. This gives you flexibility to use file, session or database to store your configurations. It also does not limit on how to get such a thing as access token though you can use the bundled library for that. See src/samples
for an exmple. Assuming your configuration class is SampleConfiguration
then you can create gateway object as simple as
The Gateway object can then be used for creating Payment requests and Confirming for Receipts.
2. Sending Payment Request
To create Payment request, just create an object of PaymentRequest
class and then use gateway sendRequest
method to send that. The method returns object of RequestReceipt
containing, upon success or a null
upon failure. Use Gateway object's getError
method to get the actual error message.
3. Confirming Payment
Confirming Payment will do the actual deducting/transfer of the money.
To do that, just pass payment ID from RequestReceipt
object you got from previous request, using getReceipt()
method to confirmPayment
method of the Gateway object. The result will be null
in case of failure and an object of PaymentReceipt
class in case of success. Use Gateway object's getError
method to get the actual error message.
Please refer to documentation for more details.
Documentation
Coming soon!
4. Loging
TBD
5. Testing
TBD