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

Fix creating refund with amount in foreign format #4344

Merged

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Apr 20, 2022

Description

The numericality validation in rails cannot handle prices in non-float based amounts (Ie. 100,00 EUR).

Using Spree::LocalizedNumber to convert the amount before validation.

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

@tvdeyen tvdeyen requested a review from a team April 20, 2022 07:58
Copy link
Contributor

@waiting-for-dev waiting-for-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@tvdeyen tvdeyen force-pushed the fix-refund-form-input-format branch from 6b21644 to ef961d9 Compare April 21, 2022 17:48
@tvdeyen
Copy link
Member Author

tvdeyen commented Apr 21, 2022

Will re-open the PR because circle ci didn't picked it up

@tvdeyen tvdeyen closed this Apr 21, 2022
@tvdeyen tvdeyen reopened this Apr 21, 2022
The numericality validation in rails cannot handle prices
in non-float based amounts (Ie. 100,00 EUR).

Using `Spree::LocalizedNumber` to convert the amount before validation.
@tvdeyen tvdeyen force-pushed the fix-refund-form-input-format branch from ef961d9 to 0a32a6e Compare April 21, 2022 19:58
@waiting-for-dev waiting-for-dev merged commit 6e8c190 into solidusio:master Apr 22, 2022
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.

5 participants