hyperwallet / sdk
A library to manage users, transfer methods and payments through the Hyperwallet API
Installs: 392 229
Dependents: 2
Suggesters: 0
Security: 0
Stars: 10
Watchers: 14
Forks: 31
Open Issues: 13
Requires
- php: >=5.6.0
- ext-json: *
- gree/jose: ^2.2.1
- guzzlehttp/guzzle: ^6.2.1 || ^7.0.1
- phpseclib/phpseclib: ^2.0.11
Requires (Dev)
- phake/phake: ^2.3 || ^4.2
- php-coveralls/php-coveralls: ^2.5
- phpunit/phpunit: ^5.7 || ^7.0.0 || ^9.0
- dev-master
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.1
- 2.1.0
- 2.0.0
- 1.7.4
- 1.7.3
- 1.7.2
- 1.7.1
- 1.7.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-feature/support-phpesclib
- dev-support/SDK-V3
- dev-feature/DTPAYWONE-588-V3-php-adding-taxVerificationStatus
- dev-feature/DTPAYHWBM-2-V3-php-adding-reject-reasons-adjustments
- dev-feature/DTPAYHWBM-2-V3-php-adding-reject-reasons
- dev-feature/DTPAYHWBM-2-V4-php-adding-reject-reasons
- dev-feature/DTRUNEONE-1593-V4-php-Updating-request-query-parameters-of-list-methods
- dev-feature/DTRUNEONE-1587-V3-php-Updating-request-query-parameters-of-list-methods
- dev-V3-unable-to-list-webhooks
- dev-feature/V4-PHP-DTRUNONE-1612-system-error-doc-upload
- 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-18 00:11:15 UTC
README
Hyperwallet REST SDK
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