Hypercharge API JSON Schema

Installs: 346

Dependents: 1

Watchers: 10

Forks: 1

Open Issues: 1

Language: Ruby

1.25.3 2015-02-03 12:11 UTC


json-schema for hypercharge payment request data.

Matches hypercharge-API-doc version 2.24 2014/09/16

Build Status Gem Version


There is a rather complete set of hypercharge API xml requests, respsonses and notifications provided as fixtures in /test/fixtures/

A fixture loader is provided for php, ruby and javascript.


// requests to hypercharge
$xmlString = Hypercharge\JsonSchemaFixture::request('sale.xml');

// or as json string
$jsonString = Hypercharge\JsonSchemaFixture::request('sale.json');

// response from hypercharge
$xmlString = Hypercharge\JsonSchemaFixture::response('sale.xml');

// notification from hypercharge
$postData = json_decode(Hypercharge\JsonSchemaFixture::notification('transaction_notification.json'), true);


# request to hypercharge
xmlString = Hypercharge::Schema::Fixture.xml 'requests/sale'

# or as parsed json
jsonData = Hypercharge::Schema::Fixture.json 'requests/sale'

# response from hypercharge
xmlString = Hypercharge::Schema::Fixture.xml 'responses/sale'

# notification from hypercharge
jsonData = Hypercharge::Schema::Fixture.json 'notifications/transaction_notification'

javascript (sync, no async atm.):

var Schema = require('hypercharge-schema').Schema;

// request to hypercharge
var xmlString = Schema.Fixture.xml('requests/sale');

// or as parsed json
var jsonData = Schema.Fixture.json('requests/sale');

// response from hypercharge
var xmlString = Schema.Fixture.xml('responses/sale');

// notification from hypercharge
var postData = Schema.Fixture.json('notifications/transaction_notification');


Assuming you have all dependencies installed (see below) you can run all tests (ruby, php, javascript) at once.


Or one by one:


ruby >= 1.9.3

Install dependencies


Run tests



php >= 5.3

Install Composer and dependencies

curl -o composer.phar http://getcomposer.org/composer.phar
php composer.phar install
php composer.phar update --dev

run test

php test/php/all.php


Install node.js

Install dependencies

npm install

run test

npm test

Btw: nvm is a handy tool for installing and handling multiple node.js versions on one mashine.


This software is provided "as is" and without any express or implied warranties, including, without limitation, the implied warranties of merchantibility and fitness for a particular purpose.