php class to integrate and handle barclaycard direct link

dev-master 2017-10-15 21:00 UTC


A full-featured Barclaycard Direct link payment API class for PHP

Class Features

  • PSR-4 autoloading compliant structure
  • Unit-Testing with PHPUnit
  • Easy to use to any framework or even a plain php file
  • Open Source
  • Allows processing of optional Fields
  • Support for UTF-8 content and 8bit, base64, binary, and quoted-printable encodings
  • Compatible with PHP 5.5 and later
  • Namespaced to prevent name clashes
  • Simple and minimal

Installation & loading

You can clone the package directly in to your application and run bash composer dump-autoload

git clone

composer dump-autoload   

Use composer to install package in to your application

composer require rebootonline/barclaycard

A Simple Example

use Reboot\Barclaycard;


	Step 1 : Instantiate/create your object


	$payment = new Barclaycard($pspid,$user_name, $password, $pw, $payemntUrl);


	Step 2 : Call the amount, card and orderId methods chaining them together in order 
	Step 3 : Call the customer method for additional parameters 
	Step 4 : Call pay method and your done


$process=$payment->amount($amount, $currency)
		->card($expiry_date, $card_number, $card_name, $cvc)
		->customer($email, $phone, $address_1,  $town, $postcode)

	To retrieve results call the response method

	echo $process->response();


	Method 2: you can just pass parameters to pay method after  instantiate class
	then call response method to retrieve results.

	'address'=>'123 st road',
	'postcode'=>'e23 6sd'

echo $process->response();


This class open-sourced software licensed under the MIT license.