pinax-stripe-light icon indicating copy to clipboard operation
pinax-stripe-light copied to clipboard

add metadata to subscription

Open turly221 opened this issue 7 years ago • 5 comments

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)?

turly221 avatar Jan 23 '18 09:01 turly221

Codecov Report

Merging #536 into master will increase coverage by <.01%. The diff coverage is 100%.

Impacted file tree graph

@@            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 data Powered by Codecov. Last update fafa715...4f6e4e2. Read the comment docs.

codecov[bot] avatar Jan 23 '18 10:01 codecov[bot]

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

blueyed avatar Jan 23 '18 12:01 blueyed

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

turly221 avatar Jan 23 '18 14:01 turly221

+1 for this

sfdye avatar Jan 24 '18 03:01 sfdye

Charges also have metadata (not handled currently by pinax-stripe).

blueyed avatar May 08 '18 15:05 blueyed