update
This commit is contained in:
@@ -114,13 +114,22 @@ export class BunqAccount {
|
||||
throw new Error('Creating sandbox users only works in sandbox environment');
|
||||
}
|
||||
|
||||
const response = await this.apiContext.getHttpClient().post(
|
||||
'/v1/sandbox-user-person',
|
||||
{}
|
||||
// Sandbox user creation doesn't require authentication
|
||||
const response = await plugins.smartrequest.request(
|
||||
'https://public-api.sandbox.bunq.com/v1/sandbox-user-person',
|
||||
{
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'User-Agent': 'bunq-api-client/1.0.0',
|
||||
'Cache-Control': 'no-cache'
|
||||
},
|
||||
requestBody: '{}'
|
||||
}
|
||||
);
|
||||
|
||||
if (response.Response && response.Response[0] && response.Response[0].ApiKey) {
|
||||
return response.Response[0].ApiKey.api_key;
|
||||
if (response.body.Response && response.body.Response[0] && response.body.Response[0].ApiKey) {
|
||||
return response.body.Response[0].ApiKey.api_key;
|
||||
}
|
||||
|
||||
throw new Error('Failed to create sandbox user');
|
||||
|
Reference in New Issue
Block a user