PHP library for Paynow (Zimbabwe's leading online payments platform)
## Paynow-Php
A simple Paynow library (implementation using PHP) which provides an expressive and fluent interface to the Paynow payments
gateway. It handles pretty much all of the boilerplate code you dreading writing.
## Installation
Install the package through Composer.
Run the Composer require command from the Terminal:
composer require berzel/paynow-php
If you're using Laravel 5.5 or later, this is all there is to do.
Should you still be on version 5.4 of Laravel, the final steps for you are to add the service provider of the package and
alias the package. To do this open your `config/app.php` file.
Add a new line to the `providers` array:
Berzel\Paynow\PaynowServiceProvider::class
And optionally add a new line to the `aliases` array:
'Paynow' => Berzel\Paynow\Facades\Paynow::class,
Now you're ready to start using the library in your application. Please note that this is not an official liabrary from
Paynow.
## Overview
Look at one of the following topics to learn more about this library
* Usage
* Example
## Usage
This library gives you the following methods to use:
### Paynow::getInstance()
Getting/Creating an instance of the paynow class is really simple, you just use the `getInstance()` method, which accepts
two parameters. In its most basic form you just specify the id and key of your paynow integration. You can retrieve your Paynow
app id and app key from the Paynow control panel.
```php
$paynow = Paynow::getInstance($appId, $appKey);
```
**The `getInstance()` method will return a Berzel\Paynow\Paynow instance.**
### Paynow::initiateTransaction()
Paynow expects you to supply a certain number of values when initiating a transaction. These values are
- returnurl => the url (on your website) that the user will be redirected to after completing a transaction on paynow
- resulturl => the url (on your website) that paynow will post order updates to
- amount => the amount that you wish to charge the user
- reference => the order refe …