pinax-stripe-light
pinax-stripe-light copied to clipboard
add metadata to subscription
What's this PR do?
add metadata to subscription
Any background context you want to provide?
In my system, the billing is for the business entity, not the user. I want to track the business subscription usage.
What ticket or issue # does this fix?
Closes #[issue number]
Definition of Done (check if considered and/or addressed):
- [ ] Are all backwards incompatible changes documented in this PR?
- [ ] Have all new dependencies been documented in this PR?
- [ ] Has the appropriate documentation been updated (if applicable)?
- [ ] Have you written tests to prove this change works (if applicable)?
Codecov Report
Merging #536 into master will increase coverage by
<.01%. The diff coverage is100%.
@@ Coverage Diff @@
## master #536 +/- ##
=========================================
+ Coverage 99.4% 99.4% +<.01%
=========================================
Files 33 33
Lines 1838 1842 +4
Branches 168 169 +1
=========================================
+ Hits 1827 1831 +4
Misses 5 5
Partials 6 6
| Flag | Coverage Δ | |
|---|---|---|
| #py27dj110 | 99.07% <100%> (ø) |
:arrow_up: |
| #py27dj111 | 99.07% <100%> (ø) |
:arrow_up: |
| #py27dj18 | 99.34% <100%> (ø) |
:arrow_up: |
| #py34dj110 | 99.07% <100%> (ø) |
:arrow_up: |
| #py34dj111 | 99.07% <100%> (ø) |
:arrow_up: |
| #py34dj18 | 99.34% <100%> (ø) |
:arrow_up: |
| #py34dj20 | 99.07% <100%> (ø) |
:arrow_up: |
| #py35dj110 | 99.07% <100%> (ø) |
:arrow_up: |
| #py35dj111 | 99.07% <100%> (ø) |
:arrow_up: |
| #py35dj18 | 99.34% <100%> (ø) |
:arrow_up: |
| #py35dj20 | 99.07% <100%> (ø) |
:arrow_up: |
| #py36dj111 | 99.07% <100%> (ø) |
:arrow_up: |
| #py36dj20 | 99.07% <100%> (ø) |
:arrow_up: |
| #py36dj20psql | 99.07% <100%> (ø) |
:arrow_up: |
| Impacted Files | Coverage Δ | |
|---|---|---|
| pinax/stripe/models.py | 100% <100%> (ø) |
:arrow_up: |
| pinax/stripe/actions/subscriptions.py | 100% <100%> (ø) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update fafa715...4f6e4e2. Read the comment docs.
LGTM, although I would prefer to have it in a more generic way, since it is supported with all (updatable) models - but this is an existing problem already. Ref: https://stripe.com/docs/api#metadata
Just did a quick check for below sections
CORE RESOURCES, PAYMENT METHODS and SUBSCRIPTIONS:
- source, payout, refund, token, BankAccount, plan, Card, Coupon, Discount, Invoice, lines, invoiceitem, subscription, subscription_item have metadata
- events, file_upload don't have it
To implement a generic way of this, we need to define what are the Updatable Stripe objects
+1 for this
Charges also have metadata (not handled currently by pinax-stripe).