Giter VIP home page Giter VIP logo

addonpayments-hpp-php-sdk's Introduction

Realex Payments HPP PHP SDK

You can sign up for a free Realex Payments sandbox account at https://www.realexpayments.co.uk/developers

Requirements

Instructions

  1. Add the following to your 'composer.json' file

    {
        "require": {
            "realexpayments/rxp-hpp-php": "1.0.0"
        }    
    }
    
  2. Inside the application directory run composer:

    composer update
    

    OR (depending on your server configuration)

    php composer.phar update
    
  3. Add a reference to the autoloader class anywhere you need to use the sdk

    require_once ( 'vendor/autoload.php' );
  4. Use the sdk

    $hppRequest = ( new HppRequest() )
    	->addMerchantId( "myMerchantId" )
    	->addAccount( "mySubAccount" )
        ....

##SDK Example##

Creating Request JSON for Realex JS SDK

require_once ( 'vendor/autoload.php' );

use com\realexpayments\hpp\sdk\domain\HppRequest;
use com\realexpayments\hpp\sdk\RealexHpp;

$hppRequest = ( new HppRequest() )
	->addMerchantId( "myMerchantId" )
	->addAccount( "mySubAccount" )
	->addAmount( "1001" )
	->addCurrency( "EUR" )
	->addAutoSettleFlag( "1" );

$supplementaryData = array();
$supplementaryData['key1'] = 'value1';
$supplementaryData['key2'] = 'value2';

$hppRequest->addSupplementaryData( $supplementaryData );	
	
$realexHpp = new RealexHpp( "mySecret" );
$requestJson = $realexHpp->requestToJson( $hppRequest );

Consuming Response JSON from Realex Payments JS SDK

require_once ( 'vendor/autoload.php' );

use com\realexpayments\hpp\sdk\domain\HppResponse;
use com\realexpayments\hpp\sdk\RealexHpp;

$realexHpp = new RealexHpp( "mySecret" );
$hppResponse = $realexHpp->responseFromJson( responseJson );

License

See the LICENSE file.

addonpayments-hpp-php-sdk's People

Contributors

realexitso avatar seanmacdomhnall avatar vicpada avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.