library rxp-remote-php
SDK to send requests and parse responses from Realex Payments using Remote
gbksoft/rxp-remote-php
SDK to send requests and parse responses from Realex Payments using Remote
- Monday, December 5, 2016
- by gbksoft
- Repository
- 2 Watchers
- 1 Stars
- 36 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 15 Forks
- 0 Open issues
- 4 Versions
- 9 % Grown
Realex Payments Remote PHP SDK
You can sign up for a free Realex Payments sandbox account at https://www.realexpayments.co.uk/developers, (*1)
Requirements
- PHP >= 5.3.9
- Composer (https://getcomposer.org/)
Instructions
-
Add the following to your 'composer.json' file, (*2)
{
"require": {
"gbksoft/rxp-remote-php": "1.0.0"
}
}
-
Inside the application directory run composer:, (*3)
composer update
OR (depending on your server configuration), (*4)
php composer.phar update
-
Add a reference to the autoloader class anywhere you need to use the sdk, (*5)
require_once ( 'vendor/autoload.php' );
-
Use the sdk br/, (*6)
$card = ( new Card() )
->addType( CardType::VISA )
->addNumber( "4263971921001307" )
....
SDK Example
require_once ( 'vendor/autoload.php' );
use com\realexpayments\remote\sdk\domain\Card;
use com\realexpayments\remote\sdk\domain\CardType;
use com\realexpayments\remote\sdk\domain\PresenceIndicator;
use com\realexpayments\remote\sdk\domain\payment\AutoSettle;
use com\realexpayments\remote\sdk\domain\payment\AutoSettleFlag;
use com\realexpayments\remote\sdk\domain\payment\PaymentRequest;
use com\realexpayments\remote\sdk\domain\payment\PaymentResponse;
use com\realexpayments\remote\sdk\domain\payment\PaymentType;
use com\realexpayments\remote\sdk\RealexClient;
// test payment
$card = ( new Card() )
->addType( CardType::VISA )
->addNumber( "4263971921001307" )
->addExpiryDate( "1220" )
->addCvn( "123" )
->addCvnPresenceIndicator( PresenceIndicator::CVN_PRESENT )
->addCardHolderName( "James Mason" );
$request = ( new PaymentRequest() )
->addType( PaymentType::AUTH )
->addCard( $card )
->addMerchantId( "myMerchantId" )
->addAccount( "mySubAccount" )
->addAmount( 1001 )
->addCurrency( "EUR" )
->addAutoSettle( ( new AutoSettle() )->addFlag( AutoSettleFlag::TRUE ) );
$client = new RealexClient( "mySecret" );
$response = $client->send( $request );
// do something with the response
echo $response->toXML();
$resultCode = $response->getResult();
$message = $response->getMessage();
License
See the LICENSE file., (*7)
dev-master
9999999-dev
SDK to send requests and parse responses from Realex Payments using Remote
Sources
Download
MIT
The Requires
payments
remote
realex
v1.2
1.2.0.0
SDK to send requests and parse responses from Realex Payments using Remote
Sources
Download
MIT
The Requires
payments
remote
realex
v1.1
1.1.0.0
SDK to send requests and parse responses from Realex Payments using Remote
Sources
Download
MIT
The Requires
payments
remote
realex
v1.0
1.0.0.0
SDK to send requests and parse responses from Realex Payments using Remote
Sources
Download
MIT
The Requires
payments
remote
realex