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

KeyErrors while creating an account: Conflicting fields in the API response body and actions/accounts.py #571

Open
georgy95 opened this issue Jun 23, 2018 · 0 comments

Comments

@georgy95
Copy link

georgy95 commented Jun 23, 2018

Issue Summary

In actions/accounts.py it's impossible to create the account from stripe data.

In particular, the following pieces are conflicting:

    # transfer schedule to external account
    ps = data["payout_schedule"]
    obj.payout_schedule_interval = ps["interval"]
    obj.payout_schedule_delay_days = ps.get("delay_days")
    obj.payout_schedule_weekly_anchor = ps.get("weekly_anchor")
    obj.payout_schedule_monthly_anchor = ps.get("monthly_anchor")

    obj.legal_entity_personal_id_number_provided = le["personal_id_number_provided"]

It could be more conflicts, but these are the ones I found.

If we are using pre (Transfer/Payout) API version, we get KeyError because payout_schedule is not there (it's called transfer_schedule instead)

Otherwise, if we are using the newest API version, we get the key error on
le["personal_id_number_provided"] because this is now not returned by the API in response.


Steps to Reproduce

Try to create a custom account using out-of-box library.

What were you expecting to happen?

To create an account

What actually happened?

Key errors as explained above. Let me know if you wish me to submit a PR

@georgy95 georgy95 changed the title Conflict of APIs KeyErrors while creating an account: Conflicting fields in the API response body and actions/accounts.py Jun 23, 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

1 participant