hyperwallet / php-sdk Goto Github PK
View Code? Open in Web Editor NEWAn SDK implementation in PHP for the v4 REST APIs.
Home Page: http://hyperwallet.github.io/php-sdk
License: MIT License
An SDK implementation in PHP for the v4 REST APIs.
Home Page: http://hyperwallet.github.io/php-sdk
License: MIT License
According to the documentation https://portal.hyperwallet.com/docs/api/v3/resources/users/create the entity user
should have a parameter named businessOperatingName
, which is actually missing (https://hyperwallet.github.io/php-sdk/master/Hyperwallet/Model/User.html). Could you please add it to your sdk?
Thank you!
There is no getStatus method for Payment.
Is it in the process of being built?
If it would accelerate the process my team would be happy to contribute, instead of us building a version and you guys building a version of the gem.
I am doing some tests in a project using PHP 8.1.1 (Symfony 5.4 based project) and this is the error I get
..PHP Fatal error: During inheritance of Countable: Uncaught Return type of Hyperwallet\Response\ErrorResponse::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
The weird thing is that ErrorResponse
implements \Countable
and count()
returns an integer
Method for deleting a registered user and/or their existing bank accounts?
I'm using version 1.6.3 of the SDK
The constructor of WebhookNotification.php appears to parse the object payload incorrectly for a number of webhooks.
It assumes that any webhook type starting with 'USER' will have an object of type User. This appears to be incorrect for webhooks for different payment method events.
For example, for a webhook of type USERS.VENMO_ACCOUNTS.CREATED, I get an object with the following structure:
print_r($properties['object'], true);
Array
(
[token] => trm-REDACTED
[type] => VENMO_ACCOUNT
[status] => ACTIVATED
[createdOn] => 2021-05-28T15:36:53
[transferMethodCountry] => US
[transferMethodCurrency] => USD
[accountId] => REDACTED
[userToken] => usr-REDACTED
)
I've tried to create an user using the sample input but getting error as WALLET_CREATION_EXCEPTION
An error has occurred and the account(s) was not created.||invalidIssuerForWalletCreation
require_once ('./vendor/autoload.php');
$client = new \Hyperwallet\Hyperwallet("restapiuser@xxxxx", "xxxxxx", null, "https://api.sandbox.hyperwallet.com");
$user = new \Hyperwallet\Model\User();
$user
->setProgramToken("prg-xxxxx")
->setClientUserId('test-client-id-1')
->setProfileType(\Hyperwallet\Model\User::PROFILE_TYPE_INDIVIDUAL)
->setFirstName('Daffyd')
->setLastName('y Goliath')
->setEmail('[email protected]')
->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
// 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";
}
}
I'm using the Hyperwallet SDK V3, it works so far, and just got a sudden error as:
Could not communicate with https://api.paylution.com/rest/v3/users/
Do you have any idea about this error?
In the Payment model there is a field "description" that runs to an error because the field is not supported at Hyperwallet.
Instead that should be correctly the field "notes".
https://docs.hyperwallet.com/content/api/v3/resources/payments/create
https://docs.hyperwallet.com/content/api/v4/resources/payments/create
PHP versions 5.6 and 7.0 haven't had security support - let alone feature support for many years, and contain serious security vulnerabilities. HHVM is not an official build of php, and the entire php ecosystem moved on from it a decade ago.
I propose these versions of PHP be removed from the unit testing, and meanwhile newer versions which are supported added. Furthermore, you should begin on working on PHP 8 support. These items are extremely necessary for us at Cover Genius.
If some clients wish to use those PHP versions they would still be able to do so using current tags, so there should be zero issues with that for legacy installations.
However as the PHP ecosystem has long moved forward, you need to be moving with it, otherwise you are creating a blocker for other clients like us, who are unable to use your SDK with an up to date stack.
This is currently a blocker for #73
I got an issue when tried to install with Laravel 8.
- Can only install one of: guzzlehttp/guzzle[7.2.0, 6.5.x-dev]. - Can only install one of: guzzlehttp/guzzle[6.5.x-dev, 7.2.0]. - Can only install one of: guzzlehttp/guzzle[6.5.x-dev, 7.2.0]. - hyperwallet/sdk 2.1.0 requires guzzlehttp/guzzle ^6.2.1 -> satisfiable by guzzlehttp/guzzle[6.5.x-dev]. - Installation request for hyperwallet/sdk ^2.1 -> satisfiable by hyperwallet/sdk[2.1.0]. - Installation request for guzzlehttp/guzzle (locked at 7.2.0, required as ^7.0.1) -> satisfiable by guzzlehttp/guzzle[7.2.0].
Please help to check and upgrade the guzzlehttp/guzzle to version 7.x
Cant commit my .gitignore file
Hello
PHP 7.x is no longer supported, we really need to move to PHP 8, and this SDK is blocking us
https://packagist.org/packages/hyperwallet/sdk
Documentation is available at http://hyperwallet.github.io/php-sdk - this link dont works!
Running the same code under the following package combination works without error or issue on PHP 8.1.
"php": "^8.0",
"guzzlehttp/guzzle": "^6.0",
"hyperwallet/sdk": "^1.3",
"laravel/framework": "^8.0"
However, the following package combination produces an almost instant error response of Error: The information entered does not match our records. Please try again.
"php": "^8.1",
"guzzlehttp/guzzle": "7.4.5",
"hyperwallet/sdk": "^2.2.2",
"laravel/framework": "^8.0"
The stack trace points to at vendor/hyperwallet/sdk/src/Hyperwallet/Util/ApiClient.php:198
I've tried different combinations of Guzzle, PHP, and the HyperWallet SDK without any luck.
Any ideas?
Hi,
Found an issue with the error reporting, on this line in particular:
php-sdk/src/Hyperwallet/Util/ApiClient.php
Line 178 in 225462e
We've got some errors returned in plain HTML, which (obviously) failed to be json_decode
d
This might be a server issue more than the SDK, however that would be good to be able to handle a non-json error as well, as for not it just throws a PHP error, and I had to manually edit the package on prod to be able to see what was happening
Cheers,
We are using your SDK and at the mentioned line, a null pointer exception occurred.
$errorResponse[0]
is null, so calling a method on it fails.
here is the stack trace:
Uncaught Error: Call to a member function getMessage() on null in ***/vendor/hyperwallet/sdk/src/Hyperwallet/Exception/HyperwalletApiException.php:26
Stack trace:
#0 ***/vendor/hyperwallet/sdk/src/Hyperwallet/Util/ApiClient.php(145): Hyperwallet\Exception\HyperwalletApiException->__construct(Object(Hyperwallet\Response\ErrorResponse), Object(GuzzleHttp\Exception\ServerException))
#1 ***/vendor/hyperwallet/sdk/src/Hyperwallet/Util/ApiClient.php(107): Hyperwallet\Util\ApiClient->doRequest('GET', '/rest/v3/transf...', Array, Array)
#2 ***/vendor/hyperwallet/sdk/src/Hyperwallet/Hyperwallet.php(1347): Hyperwallet\Util\ApiClient->doGet('/rest/v3/transf...', Array, Array)
#3
Hello 🙂
while I was trying to implement a matching algorithm between Hyperwallet businessType
values and organization types in German Law, I found that the User
model is missing some businessType
constants.
According to the API v4 documentation here: https://docs.hyperwallet.com/content/api/v4/resources/users/retrieve
A User
of profileType = BUSINESS
can have the following businessTypes
:
CORPORATION
PRIVATE_COMPANY
PARTNERSHIP
NOT_FOR_PROFIT_ORGANIZATION
GOVERNMENT_ENTITY
PUBLIC_COMPANY
However, inside the User.php
file, the only available constants are:
https://github.com/hyperwallet/php-sdk/blob/master/src/Hyperwallet/Model/User.php#L80
const BUSINESS_TYPE_CORPORATION = 'CORPORATION';
const BUSINESS_TYPE_PARTNERSHIP = 'PARTNERSHIP';
Am I missing something or shouldn't there be constants for the other businessTypes
as well?
As another reference to a typed implementation of the sdk:
The java-sdk does have more constants:
https://github.com/hyperwallet/java-sdk/blob/master/src/main/java/com/hyperwallet/clientsdk/model/HyperwalletUser.java#L21However, I am not sure if it is the best reference, because it also contains the value:
CANADIAN_REGISTERED_CHARITY
which isn't part of the API documentation anymore.
It appears that the 'offset' parameter was added, and then inadvertently removed with this update.
I believe 'offset' is valid for v3 and should be allowed in 1.x. We continue to have to use a forked repo to pass that to the API.
I can't use this library in 2.* version with the sandbox. Sandbox seems to be restricted to v3 APIs. When will it be supported ?
Weired to test the solution with an outdated library
I'm trying to get v4 SDK to work with Laravel 8. However, anytime I try to do an API call I am getting an exception "FORBIDDEN_REST_VERSION". I've tried calling listUsers and getProgram. Both give me the same exception.
I'm using the branch that adds support for guzzle 7.
Any help would be greatly appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.