This library is compatible with PHP 5.6, although we highly recommend to migrate your project to PHP 7.2 or greater to avoid security breaches (refer to PHP Supported Versions here).
Install with composer (available on packagist.org):
composer require --update-no-dev rocketgate/sdk
Integration examples with Rocketgate Gateway are placed under /tests
folder.
To run tests PHP >=7.0 is required.
$ sh vendor/rocketgate/sdk/startup.sh
Startup script startup.sh
installs composer PHP dependencies and run complete test suite.
To run tests PHP >=7.0 is required.
We recommend using both Docker and Docker Compose in order to run full test suite.
- Start docker container.
$ docker-compose up -d
The command above might take longer at first execution because all PHP Docker container dependencies will be downloaded and installed.
- Run
startup.sh
script.
docker exec -it $(docker-compose ps -q --filter name=cli_php) bash startup.sh
- Startup script
startup.sh
installs composer PHP dependencies and run complete test suite. - Output should look like this:
Do not run Composer as root/super user! See https://getcomposer.org/root for details Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Nothing to install or update Generating autoload files PHPUnit 6.5.14 by Sebastian Bergmann and contributors. Runtime: PHP 7.2.14 with Xdebug 2.6.1 Configuration: /var/client/phpunit.xml .......................... 26 / 26 (100%) Time: 14.12 seconds, Memory: 6.00MB OK (26 tests, 46 assertions)
- Successful test represent a dot (".").
- Failed test prints Rocketgate request data along with "F" character. Example:
//////////////////////////////////////////////////////////////////////
// ACHTest HAS FAILED
// GUID: 100016C8BAE1717
// Response Code: 0
// Reason Code: 0
// Exception:
// Auth No: 247218
// AVS:
// Cancel Date:
// Card Hash: m77xlHZiPKVsF9p1/VdzTb+CUwaGBDpuSRxtcb7+j24=
// Card Issuer: JPMORGAN CHASE BANK, N.A.
// CVV2:
// Rebill Date:
// Scrub: NEGDB=0,PROFILE=0,ACTIVITY=0
//////////////////////////////////////////////////////////////////////F
- Any non-compliant Rocketgate modification made on source code SDK will make
::testComplianceModifications
fail, as shown below:
1) RocketGate\Sdk\Tests\GatewayChecksumTest::testComplianceModifications
Modified version. Current checksum 0646c7f28688c3f2ad0c37499e7113d6 does not match base 4b086e326a9d6cb310079994896792c1.
Failed asserting that 'P7.1m' does not contain "m".
/var/client/tests/GatewayChecksumTest.php:17