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

Issue # 142 fix #377

Merged
merged 4 commits into from
Nov 12, 2023
Merged

Issue # 142 fix #377

merged 4 commits into from
Nov 12, 2023

Conversation

mark-jia
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • [x ] Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #142

What is the new behavior?

In the webhook of stripe payment, the amount saved is dependent on if the currency charged is a "zero decimal currency", according to stripe.

Does this PR introduce a breaking change?

  • Yes
  • [x ] No

Other information

stripe web hook returned amount data is integer of how many cents, we store in dollars with 4 decimal points in postgres database
use zero-decimal-currencies to fix stripe web hook amount inconsistency.
For non zero-decimal-currencies, amount is divided by 100 before insert into database,
otherwise, original paymentIntent.amount is saved
@mark-jia
Copy link
Contributor Author

this fix uses 'zero-decimal-currencies' package display function to convert web hook call back amount to be the correct amount before insert into databases. (It ignores three decimal currencies, can be fixed by patch to that package)

@treoden treoden merged commit 534b3aa into evershopcommerce:dev Nov 12, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants