In the last tutorial we got keys from Paynow, in this one we will go through installation of Paynow SDK or library in your project
Select your project type from below
Project Type
PHP Installation
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';
Java Installation
You need Java SDK 7 or high for it to work and you can either use
Gradle:
repositories {
mavenCentral()
}
dependencies {
compile 'zw.co.paynow:java-sdk:1.1.1'
}
Or Maven:
<dependency>
<groupId>zw.co.paynow</groupId>
<artifactId>java-sdk</artifactId>
<version>1.1.1</version>
</dependency>
Javascript Installation
npm install --save paynow
or
yarn add paynow
Python Installation
pip install paynow
And BAM you have access to Paynow!!!
Congratulations we have finished the boring stages now we move to the interesting stuff