Skip to content
This repository has been archived by the owner on Sep 15, 2020. It is now read-only.

ozanlimited/ozanpay-php-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ozanpay-php-sdk

Home Image

Welcome to Ozan Pay PHP SDK. This repository contains Ozan Pay's PHP SDK.

Requirements

PHP 5.3 and above.

Contact Us

If you have any questions, please create an issue on Github or contact us at itsupport@ozan.com.

Installation

Composer

You can install the sdk via Composer. Run the following command:

composer require ozanlimited/ozanpay-php-sdk

To use the bindings, use Composer's autoload:

require_once('vendor/autoload.php');

Usage

try {
    $ozan = new Ozan\Ozan([
        'api_key' => 'OZAN-MERCHANT-API-KEY',
        'secret_key' => 'OZAN-MERCHANT-SECRET-KEY',
        'is_live' => false,
    ]);
    
    $request = new PaymentRequest();
    $request->setCheckoutToken('tlqUxDrGeSaCPaC+Dt/+dBZMdwqe8uZOWnqnVcShUCmPL0kOffEYSf5y91ltG8CxCO83wvHAcbBDdYldisyjzCSzjINXHk4fvaPHyAtMx9w=');
    $request->setAmount(123.45);
    $request->setCurrency('GBP');
    $paymentResponse = $ozan->createPayment($request);
    $payment = $paymentResponse->getPayment();
    
    echo 'Payment id: ' . $payment->getPaymentId();
    echo 'Payment status: ' . $payment->getStatus();
} catch (OzanResponseException $e) {
    // When Ozan API returns an error
    echo 'Ozan API returned an error: ' . $e->getErrorDescription();
    echo 'Ozan error code: ' . $e->getErrorCode();
    exit;
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages