No commit activity in last 3 years
No release in over 3 years
hypercharge API requests json schema
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
>= 4.7.5
>= 0

Runtime

~> 2.1.3
 Project Readme

hypercharge-schema

json-schema for hypercharge payment request data.

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

Build Status Gem Version

Fixtures

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.

php:

// 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);

ruby:

# 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');

Tests

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

./test/all.sh

Or one by one:

Ruby

ruby >= 1.9.3

Install dependencies

bundle

Run tests

rake

PHP

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

JavaScript

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.

Warranty

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.