PR #87 includes the following updates:
Feature Updates: Optionally Convert Amounts to Major Units
Stripe passes amount-based fields, such as amount
, net
, and fee
, in the smallest denomination as raw form. This means, if your currency has minor and major units such as USD, 100 represents 100 cents, the minor unit, or 1 USD, the major unit. Alternatively, if your currency doesn't use minor units such as JPY, 100 represents 100 JPY.
- This PR introduces a variable
stripe__convert_values
(false
by default) which allows users the option to divide all amount-based fields by 100.- For information on how to enable the division, refer to the README on configuring the
stripe__convert_values
variable. - Otherwise, amount-based fields will be brought through in their raw form.
- Examples of currencies using minor units (in which enabling
stripe__convert_values
is relevant) include United States Dollar (USD), Euro (EUR), and the Canadian Dollar (CAD). - Examples of currencies NOT using minor units (in which it makes more sense to keep the amount-based fields in raw form) include Japanese Yen (JPY), Indonesian Rupiah (IDR), and Korean Won (KRW).
- For information on how to enable the division, refer to the README on configuring the
Under the Hood
- Introduces the
convert_values
macro which contains the logic for enabling the division by 100, referenced by all amount-based fields. - Updates the
run_models.sh
script to test for whenstripe__convert_values
is set to True.
Notes
- This update is not providing multiple currency support; however, we're interested in exploring this functionality if there's a need. As such, we have created a feature request to support multiple currencies where you are welcome to provide feedback or contribute to the discussion.
Documentation
- Updates the descriptions for all amount-based fields to specify the grain of the values and add information about the
stripe__convert_values
variable. - Corrected references to connectors and connections in the README. (#88)
Full Changelog: v0.12.1...v0.13.0