balanced / balanced
Client for Balanced API
Installs: 355 728
Dependents: 2
Suggesters: 0
Security: 0
Stars: 70
Watchers: 11
Forks: 37
Open Issues: 9
Requires
- matthewfl/restful: 1.0.3
- nategood/httpful: 0.2.3
Requires (Dev)
- phpunit/phpunit: 4.4.*
- twig/twig: 1.*
- dev-master
- 1.3.0
- 1.2.0
- 1.1.2
- 1.1.0
- 1.0.1
- 1.0
- 0.7.x-dev
- 0.7.5.0
- 0.7.4.1
- 0.7.4
- 0.7.3.1
- 0.7.3
- 0.7.2
- 0.7.1
- 0.7.0
- 0.6.6
- 0.6.5
- 0.6.4
- 0.6.2
- 0.6
- 0.5
- 0.4
- 0.3
- 0.2
- 0.1
- dev-dependabot/composer/twig/twig-1.44.7
- dev-dependabot/composer/phpunit/phpunit-4.8.28
- dev-fix_scenarios
- dev-orders-all-the-things
- dev-snippets
- dev-rev1
- dev-rev0
This package is not auto-updated.
Last update: 2024-04-13 11:51:08 UTC
README
Online Marketplace Payments
The design of this library was heavily influenced by Httpful.
v1.x requires Balanced API 1.1. Use v0.x for Balanced API 1.0.
v0.x requires Balanced API 1.0.
ATTN COMPOSER USERS
In the past this README incorrectly communicated specifying *
for the version of balanced. master, 1.x, requires Balanced API v1.1 and will require updates to your application. Applications using * to specify the balanced version obtained via Composer will automatically pick up the latest version and will cause issues for applications that have not been updated to use balanced-php 1.x. If your application is configured in the manner, we advise you to pin your balanced version at 0.*
, or something more specific such as 0.7.5.0
, to ensure your application continues to function normally using Balanced API v1.0 until you're able to upgrade to the latest version.
Requirements
Issues
Please use appropriately tagged github issues to request features or report bugs.
Installation
You can install using composer or from source. Note that Balanced is PSR-0 compliant:
Composer
If you don't have Composer install it:
$ curl -s https://getcomposer.org/installer | php
Require balanced in your composer.json
:
{ "require": { "balanced/balanced": "1.*" } }
NOTE: You may also define a more specific version if desired, e.g. 1.0.1
Refresh your dependencies:
$ php composer.phar update
Then make sure to require
the autoloader and initialize all:
<?php require(__DIR__ . '/vendor/autoload.php'); \Httpful\Bootstrap::init(); \RESTful\Bootstrap::init(); \Balanced\Bootstrap::init(); ...
Source
Download Httpful source:
$ curl -s -L -o httpful.zip https://github.com/nategood/httpful/zipball/v0.2.3; $ unzip httpful.zip; mv nategood-httpful* httpful; rm httpful.zip
Download RESTful source:
$ curl -s -L -o restful.zip https://github.com/matthewfl/restful/zipball/master; $ unzip restful.zip; mv matthewfl-restful* restful; rm restful.zip
Download the Balanced source:
$ curl -s -L -o balanced.zip https://github.com/balanced/balanced-php/zipball/master $ unzip balanced.zip; mv balanced-balanced-php-* balanced; rm balanced.zip
And then require
all bootstrap files:
<?php require(__DIR__ . "/httpful/bootstrap.php") require(__DIR__ . "/restful/bootstrap.php") require(__DIR__ . "/balanced/bootstrap.php") \Httpful\Bootstrap::init(); \RESTful\Bootstrap::init(); \Balanced\Bootstrap::init(); ...
Quickstart
Refer to the Quickstart guide in the Balanced Documentation.
Usage
See https://docs.balancedpayments.com/overview?language=php for guides and documentation.
Testing
$ phpunit --bootstrap vendor/autoload.php tests/
Or if you'd like to skip network calls:
$ phpunit --exclude-group suite --bootstrap vendor/autoload.php tests/
Publishing
- Ensure that all tests pass
- Increment minor
VERSION
insrc/Balanced/Settings
andcomposer.json
(git commit -am 'v{VERSION} release'
) - Tag it (
git tag -a v{VERSION} -m 'v{VERSION} release'
) - Push the tag (
git push --tag
) - Packagist will see the new tag and take it from there
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Write your code and tests
- Ensure all tests still pass (
phpunit --bootstrap vendor/autoload.php tests/
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new pull request
Documentation scenarios
Each scenario lives in the scenarios directory and is comprised of the following:
- definition.php - Method definition
- request.php - Scenario code
- executable.php - Processed request.php. Can be executed directly in PHP. Generated by render_scenarios.php.
- php.mako - Documentation template to be consumed by balanced-docs. Generated by - render_scenarios.php.
Scenarios can be validated by running validate_scenarios.php from within the scenarios folder.