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

Add support for /v1/topups endpoints #396

Merged
merged 1 commit into from
Feb 21, 2018
Merged

Conversation

jkakar-stripe
Copy link
Contributor

This add standard retrieve, create and update client support for the new /v1/topups endpoint.

r? @apakulov-stripe @ccontinanza-stripe @chellman-stripe @kenneth-stripe @miguel-stripe
r? @stripe/api-libraries

@jkakar-stripe
Copy link
Contributor Author

This branch is stacked on #395. I'll do the rebase when that lands, but want to get these changes out for reviews.

Copy link

@miguel-stripe miguel-stripe left a comment

Choose a reason for hiding this comment

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

A few nits, otherwise, looks good!

from stripe.api_resources.abstract import UpdateableAPIResource
from stripe.api_resources.abstract import ListableAPIResource


Choose a reason for hiding this comment

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

Nit: Extra line here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the style used in other files, so I copied. I'll leave it as is to maintain consistency.

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems a little weird coming from other languages, but believe it or not, this is conformant with the most universally accepted style for Python, PEP 8. From the spec:

Surround top-level function and class definitions with two blank lines.

There's a check that will fail the test suite if the style is off, so you're safe from pulling something in that's wrong, but I'd suggest as a general guideline just doing what Jamu did and copying the style seen elsewhere.

@@ -0,0 +1,9 @@
from __future__ import absolute_import, division, print_function

Choose a reason for hiding this comment

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

Are these imports used anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apparently not. I removed them.

@@ -0,0 +1,60 @@
from __future__ import absolute_import, division, print_function

Choose a reason for hiding this comment

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

Are these imports needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apparently not. I removed them.


TEST_RESOURCE_ID = 'tu_123'


Choose a reason for hiding this comment

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

Nit: Unnecessary extra lines?

Copy link
Contributor

Choose a reason for hiding this comment

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

(Similarly to the comment above, I believe PEP 8 will require this doubled up blank line too.)

'post',
'/v1/topups/%s' % TEST_RESOURCE_ID
)
self.assertIsInstance(resource, stripe.Topup)

Choose a reason for hiding this comment

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

Worth checking the resource has its metadata set to {'key': 'value'}?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried this, but it looks like stripe-mock doesn't actually mutate received data correctly. I believe it just validates what it received and returns stock data.

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes that's correct Jamu. We want to fix this at some point, but for now it's not working checking any of the data that you get back.

@brandur-stripe
Copy link
Contributor

Maybe just ack that we're good to go here as well, and we'll pull it in. Thanks!

@apakulov-stripe
Copy link

lgtm

@apakulov-stripe
Copy link

r? @stripe/api-libraries

@brandur-stripe
Copy link
Contributor

LGTM.

@brandur-stripe brandur-stripe merged commit dd8aa65 into master Feb 21, 2018
@brandur-stripe brandur-stripe deleted the jkakar/topup-client branch February 21, 2018 19:44
@brandur-stripe
Copy link
Contributor

Released as 1.78.0.

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

Successfully merging this pull request may close these issues.

None yet

5 participants