wallee-payment / typescript-sdk

The wallee TypeScript library wraps around the wallee API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Double declaration of spaceId

amer8 opened this issue · comments

The question is whether spaceId can be omitted from the config object.
It seems that it's being sent later, when using the service methods transactionService.create(spaceId, transaction).

In this case api_secret belongs to user_id and the SDK could send requests to different spaces the user belongs to, by choosing the spaceId on every method.

Hello @amer8

You are correct in assuming that a user with a given secret can have multiple spaces.

You can omit the space_id from the config if you like.

// config
let space_id: number = 321
let config: {user_id: number, api_secret: string } = {
    user_id: 123,
    api_secret: 'abc'
};

Victor