helios-api / helios-hpp-sdk
Helios HPP payment system PHP SDK
0.2.2
2016-11-30 13:52 UTC
Requires
- php: ^5.6|^7.0
- doctrine/common: ^2.6
- guzzlehttp/guzzle: ~6.0
- jms/serializer: ^1.4
Requires (Dev)
- mockery/mockery: ~0.8
- phpunit/php-code-coverage: ^4.0
- phpunit/phpunit: ^5.5
- squizlabs/php_codesniffer: *
This package is not auto-updated.
Last update: 2025-02-15 22:01:36 UTC
README
NOTICE: This branch is under active development.
This repository contains the open source PHP SDK that allows you to access the Helios HPP from your PHP app. Documentation fo Helios API documentation.dp.ag.
Installation
The Helios HPP PHP SDK can be installed with Composer. Run this command:
composer require helios/helios-hpp-sdk
Usage
Note: This version of the Helios HPP SDK for PHP requires PHP 5.6 or greater.
Simple transaction registration example.
$heliosApp = new \HeliosHpp\HeliosHpp(['accountId' => '{account-id}', 'url' => '{helios-hpp-url}']); $payment = new \HeliosHpp\Model\Payment('{account-id}', 'USD', 1000); try { $createdPayment = $heliosApp->createPayment($payment); } catch(\HeliosHpp\Exception\HeliosHppException $exception) { // When Helios HPP returns an error echo 'Helios HPP returned an error: ' . $exception->getMessage(); exit; } catch(\HeliosHpp\Exception\PaymentBodyException $exception) { // When Helios HPP returns invalid response echo 'Helios HPP returned invalid response: ' . $exception->getMessage(); exit; } echo 'Payment Token ' . $createdPayment->getToken()
WebHook registration.
$heliosApp = new \HeliosHpp\HeliosHpp(['accountId' => '{account-id}', 'url' => '{helios-hpp-url}']); try { $paymentStatusChange = $heliosApp->registerWebHook(); } catch(\HeliosHpp\Exception\WebHookRequestException $exception) { // When Helios HPP call or payload is invalid echo 'Helios HPP called with invalid request: ' . $exception->getMessage(); exit; } echo 'Payment Status event type' . $paymentStatusChange->getEventType();
Tests
- Composer is a prerequisite for running the tests. Install composer globally, then run
composer install
to install required files. - The tests can be executed by running this command from the root directory:
$ ./vendor/bin/phpunit
By default the tests will send live HTTP requests to the Helios HPP server. If you are without an internet connection you can skip these tests by excluding the internet
group.
$ ./vendor/bin/phpunit --exclude-group internet
License
Please see the license file for more information.