coliving / hyperwallet-sdk
A library to manage users, transfer methods and payments through the Hyperwallet API. This is fork from hyperwallet/sdk to upgrade the guzzlehttp package
Requires
- php: >=5.5.9
- gree/jose: ^2.2.1
- guzzlehttp/guzzle: ^7.2
- phpseclib/phpseclib: ^2.0.11
Requires (Dev)
- phake/phake: ^2.3
- phpunit/phpunit: ^4.8
- satooshi/php-coveralls: ^1.0
- dev-master
- 4.x-dev
- 3.x-dev
- 2.1.1
- 2.1.0
- 2.0.0
- 1.6.9
- 1.6.8
- 1.6.7
- 1.6.6
- 1.6.5
- 1.6.4
- 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-fix_api_v3
- dev-upgrade_packages
- dev-DEV-v3
- dev-add_filter_webhook_dev_v3
- dev-fix_list_webhook_filter
- dev-upgrade_guzzlehttp
- dev-support/SDK-V3
- dev-feature-v3/set-custom-headers-php-sdk
- dev-DEV-v4
- dev-feature-v4/set-custom-headers-php-sdk
- dev-feature-v4/Business-Stake-Holder-PHP-v4
- dev-feature-v4/Transfer-Status-Transition-v4
- dev-feature-v3/Transfer-Status-Transition-v3
- dev-fix/listTransferMethod_V3_php
- dev-feature/V3Filters-Changes
- dev-feature/HW-66709-V4-PHP-Prepaid-Cards
- dev-feature/HW-67136-V4-Transfer-Methods
- dev-feature/HW-66742-V4-Balances-PHP
- dev-feature/HW-66718-V4-PHP-transfers
- dev-feature/V4-User-endpoint-PHP-Update-List-multipart-statustransition
- 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-66713-V4-PHP-SDK-for-Paper-Checks
- dev-feature/HW-66745-V4-Receipts
- dev-feature/HW-66700-V4BankCardsPHP
- dev-feature/HW-67900-PHP-SDK-User-Status-Transitions
- dev-feature/HW-58098-PHP-SDK-Transfer-Refunds
- dev-feature/Bankcards-TestBranch
- dev-feature/HW-66550-User-MultipartUpload
- dev-feature/HW-66357-V3PHP-SDK-VenmoAccount
- 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 not auto-updated.
Last update: 2024-11-04 04:14:31 UTC
README
Hyperwallet REST SDK (Beta)
A library to manage users, transfer methods and payments through the Hyperwallet Rest V4 API To access V3 Rest APIs, please use SDK v1.5
Prerequisites
Hyperwallet's PHP server SDK requires at minimum PHP 5.6 and above.
Installation
- Install from hyperwallet/sdk
$ composer require hyperwallet/sdk
- Install from Coliving
$ composer require coliving/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