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

Sample for reading/using shared accounts #90

Closed
2 tasks
CharlPels opened this issue Apr 11, 2018 · 4 comments
Closed
2 tasks

Sample for reading/using shared accounts #90

CharlPels opened this issue Apr 11, 2018 · 4 comments

Comments

@CharlPels
Copy link

Steps to reproduce:

  1. None

What should happen:

  1. Add some examples for shared accounts

What happens:

  1. Make customer happy

Traceback

SDK version and environment

  • Tested on 0.12.4
  • Sandbox
  • Production

Response id

  • Response id:

Extra info:

@OGKevin
Copy link
Contributor

OGKevin commented Apr 13, 2018

@CharlPels I dont quite understand what you want to do. Define shared accounts. Are you talking about connects or joint ? Eitherway, both will be in the result of

@classmethod
def list(cls, params=None, custom_headers=None):
"""
Get a collection of all your MonetaryAccounts.
:type user_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseMonetaryAccountList
"""
if params is None:
params = {}
if custom_headers is None:
custom_headers = {}
api_client = client.ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(
cls._determine_user_id())
response_raw = api_client.get(endpoint_url, params, custom_headers)
return BunqResponseMonetaryAccountList.cast_from_bunq_response(
cls._from_json_list(response_raw)
)

@CharlPels
Copy link
Author

Hello,

Sorry with shared accounts I mean joint accounts :-)
did an update of the bunq SDK, that seems to break my solution :-(
bunq.sdk.exception.BunqException: ApiContext has not been loaded. Please load ApiContext in BunqContext

no clue why :-(

@OGKevin
Copy link
Contributor

OGKevin commented Apr 13, 2018

You can use this as example:

https://github.com/bunq/tinker_python/blob/3898543198df8c5a496fdb35dd70c994c556b102/tinker/libs/bunq_lib.py#L69-L73

For monetary account joint you can use:

class MonetaryAccountJoint(core.BunqModel):

@OGKevin
Copy link
Contributor

OGKevin commented Apr 14, 2018

Please create issue in bunq/tinker_python to add script to retrieve joint accounts. Tinker will be used as example.

You must load your ApiContext in bunqContext and then preform a call to the joint account class. Please see the documented code and/or method signature on how to use the methods.

@OGKevin OGKevin closed this as completed Apr 14, 2018
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

2 participants