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

Migrated StripeDecimalCurrencyAmountField to StripeQuantumCurrencyAmountField #1714

Conversation

arnav13081994
Copy link
Contributor

@arnav13081994 arnav13081994 commented Jun 1, 2022

Description

This PR contains the following changes:

  1. Migrated StripeDecimalCurrencyAmountField to StripeQuantumCurrencyAmountField for the following models:

    • Source
    • SourceTransaction
    • Transfer
    • Coupon
    • BaseInvoice
    • InvoiceItem
    • Plan
    • Payout
    • Charge
  2. Updated Coupon.human_readable_amount to correctly fetch and display (in cents) the Integral amount_off model field.

  3. Updated Plan. human_readable_price to correctly fetch and display (in cents) the Integral unit_amount model field.

  4. Updated Plan. create to correctly fetch and display (in cents) the Integral amount model field.

  5. Updated Price. create to correctly fetch and display (in cents) the Integral unit_amount model field.

  6. Updated Charge._calculate_refund_amount to correctly fetch and display (in cents) the Integral amount_to_refund model field.

  7. Updated Charge.charge to correctly fetch and display (in cents) the Integral amount and application_fee model fields.

  8. Updated Charge.add_invoice_item to correctly fetch and display (in cents) the Integral amount model field.

  9. Removed unnecessary Plan.amount_in_cents model property.

  10. Updated Corresponding Tests.

Checklist:

  • I've updated the tests or confirm that my change doesn't require any updates.
  • I've updated the documentation or confirm that my change doesn't require any updates.
  • I confirm that my change doesn't drop code coverage below the current level.
  • I've updated migrations or confirm that my change doesn't make changes to any model.

Rationale

Fix: #955
Fix: #1941
Brings us one step closer to reducing the usage of the legacy StripeDecimalCurrencyAmountField

@arnav13081994 arnav13081994 added enhancement api change This issue concerns a Stripe API change that dj-stripe needs to be aware of labels Jun 1, 2022
@arnav13081994 arnav13081994 added this to the 3.0.0 milestone Jun 1, 2022
@arnav13081994 arnav13081994 force-pushed the migrate_decimal_field_to_quantum_field branch from 607003a to c63c3ec Compare August 31, 2022 14:45
@jleclanche jleclanche force-pushed the master branch 13 times, most recently from 27c1106 to f6483e8 Compare October 19, 2022 19:55
@arnav13081994 arnav13081994 force-pushed the migrate_decimal_field_to_quantum_field branch from c63c3ec to 4e1e575 Compare May 25, 2023 07:29
…yAmountField to StripeQuantumCurrencyAmountField
@arnav13081994 arnav13081994 force-pushed the migrate_decimal_field_to_quantum_field branch from 4e1e575 to 3215059 Compare May 25, 2023 07:30
@jleclanche
Copy link
Member

I am closing this. Next release will have a different approach.

@jleclanche jleclanche closed this Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api change This issue concerns a Stripe API change that dj-stripe needs to be aware of enhancement
Projects
None yet
2 participants