In the last tutorial we got keys from PayNow, in this one we will go through installation of Paynow SDK in PHP based projects.
I will touch on these scenarios:
- Composer
- Manual Installation
Also make sure curl extension is enabled in your PHP
1. Composer
Type the following command to install paynow php sdk
$ composer require paynow/php-sdk
Then include it in you project like this
<?php
require_once 'path/to/vendor/autoload.php';
// your code here
If you are using Laravel include it like this
<?php
use \Paynow\Payments\Paynow;
// your code here
Thats it!
2. Manual Installation
If you don't have composer installed then Download Paynow Here
Extract it into your project directory then type this into your code
<?php
require_once 'path/to/library/autoloader.php';
// Do stuff
Example: Manual Installation
If your your folder structure is like this
- Paynow
- checkout.php
- success.php
- cart.php
Then you include Paynow like this(inside checkout.php)
<?php
require_once './Paynow/autoloader.php';
And BAM you have access to PayNow!!!
Congratulations we have finished the boring stages now we move to the interesting stuff
Top comments (0)