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

furusystems/payex-php

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

THIS PACKAGE IS DEPRECATED

Please use payex-sdk-php instead, a supported and maintained package from Payex.

PAYEX PHP CLASS

A php5 module for simple transaction(s) with PayEx.

This module is a rewrite of cobrax/payex and intended for usage with php5 only and as composer compatible module.

Dependencies

PHP >= 5.3

Installation

If you're using Composer to manage libraries, include this package in your composer.json

"require" : {
    "furusystems/payex-php" : "0.1.*"
}

Or just load this library in your PHP project by including PayEx.php

require_once('../your/project/directory/here/lib/PayEx/PayEx.php');

Usage Example

// Start transaction

use PayEx\PayEx;
...

$parameters = array(
	'accountNumber' => '<accountNumber>',
	'encryptionKey' => '<encryptionKey>',
	'purchaseOperation' => PayEx::TRANSACTION_AUTHORIZATION,
	'view'           => 'CREDITCARD',
	'currency'       => 'NOK',
	'vat'            => '0',
	'orderID'        => $orderID,
	'productNumber'  => $productNumber,
	'price'          => '100',
	'description'    => 'blah',
	'returnUrl'       => 'http://example.com/return-url',
	# 'cancelUrl'       => 'http://example.com/cancel-url',
);
# PayEx::setDefaultOption('testMode', true);
	
$client = PayEx::transaction($parameters);
if ($client->transactionIsOk()) {
	$session->set('payex', $payex);
	$client->transactionRedirect();
}

// Transaction return

use PayEx\PayEx;
...

$payex = $session->get('payex');

// 1. Explisit way
// $orderRef = $_REQUEST['orderRef'];
// $status   = $payex->transactionComplete($orderRef);

// 2. Implicit
$payex->transactionComplete(); // orderRef stored in this payex transaction instance

Licence

The project is released under GNU-license. The class are provided as is. And the class are in no way an offical class by PayEx. The initial creators are however a sertified partner with PayEx.

Packages

No packages published

Languages

  • PHP 100.0%