Skip to content

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

@webdeveloper143

Description

@webdeveloper143

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";
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions