Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To get access to the wallet’s funds (to be able to make a deposit, transfer or withdraw) wallet should contain authenticated user’s or Management API Client ID in the holderIds list.
For updating/deleting the wallet, wallet should contain access control object’s ID in the accessControlIds list that contains ID of the client in the write access section. (See examples for more info)

...

Expand
titleGrant access to modify/delete wallet to Management API Client
Code Block
languagepy
from trivoreid.client import TrivoreID
from trivoreid.models.wallet import Wallet
from trivoreid.models.accesscontrol import AccessControl

# using Management API client
api = TrivoreID()

ac = AccessControl()
ac.title = 'Example'

# adding ID of the targer Management API client
ac.apiClientIdRead.append(api.mgmt_client_id)
ac.apiClientIdWrite.append(api.mgmt_client_id)

ac = api.accesscontrol_service.create(ac)

# getting the owner
user = api.user_service.get('userId')

wallet = Wallet()
wallet.ownerId = user.id # required field
wallet.accessControlIds.append(ac.id)
wallet.holderIds.append(api.mgmt_client_id)
wallet.name = 'Example Name'
wallet.currency = 'EUR' # required field

wallet = api.wallet_service.create(wallet)

# now this Management API has access to modify/delete the wallet
wallet = api.wallet_service.update(wallet)
api.wallet_service.delete(wallet.id)Uhh

Wallet Service Models

/wiki/spaces/TISpubdoc/pages/88277458

...