Skip to content

Update attributes for Account and LegalEntity #580

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

Merged
merged 1 commit into from
Aug 29, 2018

Conversation

ob-stripe
Copy link
Contributor

r? @brandur-stripe @remi-stripe
cc @stripe/api-libraries @scherr-stripe

Updates attributes for the Account and LegalEntity classes. A lot of attributes were missing, particularly the Japan-specific ones.

Copy link
Contributor

@remi-stripe remi-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments but other LGTM

@@ -17,6 +17,10 @@
public class Account extends ApiResource implements HasId, MetadataStore<Account> {
@Getter(onMethod = @__({@Override})) String id;
String object;
String applicationIcon;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not in the docs for me. None of the application* are and it's not something we surface in the other bindings. We should remove

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The application_* attributes are in the OpenAPI spec. I can remove them as they don't seem all that useful today, but on the other hand it doesn't cost us anything to keep them and they'll be available if someone ever needs to use them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in favour of removing. I have never heard of those properties before. They seem more for the dashboard than for the API to be honest. If we added them here we'd have to add them to all the other ones and keep maintaining them.

Copy link
Contributor Author

@ob-stripe ob-stripe Aug 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, these attributes can be useful for Connect platforms that use destination charges and their users. Retrieving the py_ charge object on the destination account returns these attributes in the source attribute:

  "id": "py_123",
  "object": "charge",
  ...
  "source": {
    "id": "acct_123",
    "object": "account",
    "application_name": "Planet Express",
    "application_url": "http://localhost:3000"
  },
  ...

Unlike most other attributes, they're only returned if they have non-null values, which is why application_icon and application_logo are missing in the example above.

Are you still in favor of removing them?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh why did we do something like this, that does not make sense. The charge already has application as a hash for that. This information should live there in that case. I still think we should at least discuss this internally and do this in a separate PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

String document;
String documentBack;
String status;
public static class JapanAddress extends StripeObject {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not extend Address and just defined town as extra?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Internally and in the OpenAPI spec, they're defined as two different schemas.

Also, at the moment there is no concrete resource class that derives from another concrete class, and I'd rather keep that invariant in place. If we had JapanAddress extends Address, and ever needed to add a field to Address, chances are whoever makes the change will not notice that the field would also be added to JapanAddress.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, I'm fine with that in that case.

@ob-stripe ob-stripe force-pushed the ob-update-account-attrs branch from 1bc2b3b to 4db16e9 Compare August 29, 2018 12:54
@ob-stripe
Copy link
Contributor Author

ptal @remi-stripe

@ob-stripe ob-stripe merged commit b377380 into master Aug 29, 2018
@ob-stripe ob-stripe deleted the ob-update-account-attrs branch August 29, 2018 13:15
@ob-stripe
Copy link
Contributor Author

Released as 6.9.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants