kladislav / hyperwallet-php-sdk
A library to manage users, transfer methods and payments through the Hyperwallet API
Requires
- php: >=5.5.9
- gree/jose: ^2.2.1
- guzzlehttp/guzzle: ^6.2.1 || ^7.0.1
- guzzlehttp/uri-template: ^1.0
- phpseclib/phpseclib: ^2.0.11
Requires (Dev)
- phake/phake: ^2.3
- phpunit/phpunit: ^4.8
- satooshi/php-coveralls: ^1.0
- dev-master
- v3.0.5
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0
- v2.1.3
- v2.1.2
- 2.1.1
- 2.1.0
- 2.0.0
- 1.6.3
- 1.6.2
- 1.6.1
- 1.6.0
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.0
- 1.3.0
- 0.3.1
- 0.3.0
- 0.2.0
- 0.1.x-dev
- 0.1.1
- 0.1.0
- dev-support/SDK-V3
- dev-feature/support-guzzle-7
- dev-feature/support-guzzle-7-master
- dev-V3-unable-to-list-webhooks
- dev-feature/HW-58113-V4APIUpdatesPHP-RemoveFilters
- dev-feature/V4-User-endpoint-PHP-Update-List-multipart
- dev-feature/V4-User-endpoint-PHP-List
- dev-feature/HW-66539-V4-StakeHolder-Upload-Multi-Part-Document
- dev-tras
- dev-fix/Missed-fields-payments-bankcards
- dev-feature/V4-User-endpoint-PHP-Create
- dev-feature/HW-66745-V4-Receipts
- dev-feature/Bankcards-TestBranch
- dev-feature/HW-66550-MultipartUpload
- dev-HW-48915-add-cvv-field-to-the-sdk-php
- dev-feature/HW-54847-remove-relationship-field-from-server-sdk
- dev-feature/HW-54135-php-sdk-add-updatePayPalAccount-method
- dev-feature/HW-50653-SDK-TypeError-thrown-when-response-status-is-204-No-Content
- dev-feature/HW-48915-Add-CVV-field-SDK-PHP
- dev-feature/HW-47699-add-verification-status
- dev-feature-hw-46003-test-access
- dev-changelog-031-release-update
- dev-feature/user-status-transition-endpoint
This package is auto-updated.
Last update: 2024-11-13 15:25:05 UTC
README
Hyperwallet REST SDK (with Guzzle 7 support)
A library to manage users, transfer methods and payments through the Hyperwallet v4 API.
For Hyperwallet v3 API calls, please use the latest SDK version 1.x.x. See [here|https://docs.hyperwallet.com/content/updates/v1/rest-api-v4] to learn about the differences between versions and the update process required to use REST API v4.
Prerequisites
Hyperwallet's PHP server SDK requires at minimum PHP 5.6 and above.
Installation
$ composer require hyperwallet/sdk
Documentation
Documentation is available at http://hyperwallet.github.io/php-sdk.
API Overview
To write an app using the SDK
-
Register for a sandbox account and get your username, password and program token at the Hyperwallet Program Portal.
-
Add dependency
hyperwallet/sdk
to yourcomposer.json
. -
Create a instance of the Hyperwallet Client (with username, password and program token)
$client = new \Hyperwallet\Hyperwallet("restapiuser@4917301618", "mySecurePassword!", "prg-645fc30d-83ed-476c-a412-32c82738a20e");
-
Start making API calls (e.g. create a user)
$user = new \Hyperwallet\Model\User(); $user ->setClientUserId('test-client-id-1') ->setProfileType(\Hyperwallet\Model\User::PROFILE_TYPE_INDIVIDUAL) ->setFirstName('Daffyd') ->setLastName('y Goliath') ->setEmail('testmail-1@hyperwallet.com') ->setAddressLine1('123 Main Street') ->setCity('Austin') ->setStateProvince('TX') ->setCountry('US') ->setPostalCode('78701'); try { $createdUser = $client->createUser($user); } catch (\Hyperwallet\Exception\HyperwalletException $e) { // Add error handling here }
-
Error Handling The
HyperwalletException
has an array of errors withcode
,message
andfielName
properties to represent a error.try { ... } catch (\Hyperwallet\Exception\HyperwalletException $e) { // var_dump($e->getErrorResponse()); // var_dump($e->getErrorResponse()->getErrors()); foreach ($e->getErrorResponse()->getErrors() as $error) { echo "\n------\n"; echo $error->getFieldName()."\n"; echo $error->getCode()."\n"; echo $error->getMessage()."\n"; } }
Development
Run the tests using phpunit
:
$ composer install $ ./vendor/bin/phpunit -v