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

Chance to elaborate currencies with not just precision 2 #12

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Rixamos
Copy link

@Rixamos Rixamos commented Nov 1, 2020

Tried to adapt the code to manage also currencies that doesn t have digits or that have different dthan 2 digits after the decimal point (unfortunately I cannot test the non 2 or 0 because stripe at the moment is not supporting them if I am in right)

… I am not mainly a developer

Can be a way to fix the currencies that doesn't have the 2 decimals.
Please check at tests too in case i modified em wrongly
In add I suppose will have other implications I didn t discover yet
@Rixamos
Copy link
Author

Rixamos commented Nov 1, 2020

I found also that some case class has some problem on reading the output form the api when now is handling more currencies, I added an awful patch on Charge class that are these 2 val inside

val fixAmount=Money(amount.pennies,Currency.getInstance(currency.toUpperCase()).getDefaultFractionDigits)
 val fixAmountRefunded=Money(amountRefunded.pennies,Currency.getInstance(currency.toUpperCase()).getDefaultFractionDigits)

It is a completely wrong approach but I don t know circe enough to handle this with the Decoder/Encoder handling
I hope this upper code can help on developing a proper solution

- Parameter chargeId is mandatory.

- Refund model has some missing fields.
@darkfrog26
Copy link
Contributor

You need to resolve conflicts with master.

@Rixamos
Copy link
Author

Rixamos commented Dec 5, 2020

Hello, I will take a view to it eheh at the moment I ve other priorities, has been a crazy period, I will review them as soon as i can.
Thanks

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.

3 participants