Support trialing subscriptions#139
Open
adrianlungu wants to merge 18 commits into
Open
Conversation
Author
|
Hmm, I'm not sure what's failing 🤔 |
Log of the CI before this commit: ``` $ if [[ $TRAVIS_PYTHON_VERSION != nightly ]]; then flake8 .; fi ./localstripe/resources.py:594:47: E741 ambiguous variable name 'l' The command "if [[ $TRAVIS_PYTHON_VERSION != nightly ]]; then flake8 .; fi" exited with 1. ```
adrienverge
reviewed
Jun 2, 2020
Owner
adrienverge
left a comment
There was a problem hiding this comment.
Hmm, I'm not sure what's failing
You can see what's wrong by clicking on the Travis build. I recommend rebasing on latest master.
| self.currency = 'eur' # arbitrary default | ||
|
|
||
| if subscription is not None and subscription_obj.status == "trialing": | ||
| self.lines = List() |
Owner
There was a problem hiding this comment.
- It's hard to understand these lines. Are you just resetting
self.lines? In this case, it would be better to avoid adding items in it directly? - Using a
List()without arguments will drop the'/v1/invoices/' + self.id + '/lines'.
Made from Stripe documentation: https://stripe.com/docs/api/charges/list#list_charges-customer
Since commit 4810d4b _coupon: use float value for percent_off_ the following unit test is failing: ``` ... + curl -sSf -u sk_test_12345: http://localhost:8420/v1/coupons -d id=PARRAIN -d percent_off=30 -d duration=once curl: (22) The requested URL returned error: 400 Bad Request ``` It's because, in the code just after 4810d4b change, the expected type for `percent_off` is still `int`.
In Stripe [documentation of the Charges list API], all parameters are optional. Since commit 54831f9 _Charge: Add `customer` and `created` to the list API_, localstripe support parameters `customer` and `created` but both were made mandatory. Let's fix them. [documentation of the Charges list API]: https://stripe.com/docs/api/charges/list
Let's add the property `billing_reason` that was missing. For the moment, it's not implemented so it's always `null`. https://stripe.com/docs/api/invoices/object#invoice_object-billing_reason
Problem: very recently, Travis started to fail on commit that were
previously fine. Probably a change on their side?
It appears that on some Python version (e.g. 3.7 but not 3.8) they
double-escape `%5B` and `%5D` caracters, so they are passed as `%255B`
and `%255D`.
To avoid that, I propose to use `[` and `]` directly, and enable curl's
`-g` option (`--globoff`) so that it doesn't interpret them.
In summary now the commands are a bit clearer:
curl -sSfg -u $SK: $HOST/v1/plans?expand[]=data.product
And drop support on Python 3.5 and 3.6.
The current implementation supports the Balance resource as described in https://stripe.com/docs/api/balance
`None` is already the implicit default when using `get()` on a dict.
Collaborator
|
Plop, just passing by to say that I think you re-pushed your branch after a merge with the master branch. |
Author
|
Yeah, I'm gonna redo this at some point as it's a bit jumbled up at some points and it's still not working properly. Thanks for the heads up! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix for #131
trialingstatus for subscriptiontrialingsubscription with 0 value