Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using v4 to create an user but getting error as WALLET_CREATION_EXCEPTION #109

Open
webdeveloper143 opened this issue May 12, 2022 · 0 comments

Comments

@webdeveloper143
Copy link

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";
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant