AttributeError: service_agreement

Open
#1,227 20 comments 0 reactions 1 assignee View on GitHub

@remi-stripe is already working on this.

Since Feb 7, 2024.

Assessment

This issue has not been assessed yet.

Description

bug future
Describe the bug

Account class has tos_acceptance: Optional[TosAcceptance].
TosAcceptance class has service_agreement: Optional[str]

The following code:

if (
            connected_account.tos_acceptance is not None
            and connected_account.tos_acceptance.service_agreement == "recipient"
        ):

Should not rais exceptions, but it does:
AttributeError: service_agreement

To Reproduce
  1. Fetch the account with non-recipient service agreement
  2. Run the above if statementthe
Expected behavior

Exception should not be raised

Code snippets

No response

OS

macOS

Language version

3.11.4

Library version

8.1.0

API version

2019-08-14

Additional context

No response

Dominant language
Python
Stars
2k
Forks
539
Avg merge
2d 7h
Merged PRs (30d)
26

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stripe/stripe-python

All issues in stripe/stripe-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.