Code Monkey home page Code Monkey logo

rocketgate-php-sdk's Introduction

rocketgate-php-sdk

Rocketgate Gateway PHP SDK

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).

Installation using composer

Install with composer (available on packagist.org):

composer require --update-no-dev rocketgate/sdk

Usage

Integration examples with Rocketgate Gateway are placed under /tests folder.

Run full test suite (without RG docker container)

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.

Run full test suite (with RG docker container)

To run tests PHP >=7.0 is required.

We recommend using both Docker and Docker Compose in order to run full test suite.

  1. 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.

  1. Run startup.sh script.
docker exec -it $(docker-compose ps -q --filter name=cli_php) bash startup.sh

Important notes

  • 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

rocketgate-php-sdk's People

Contributors

rgflight avatar marcelo-rocketgate avatar ckdarby 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.