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

[BUG] Fix IDR Formatting #3747

Closed
doganaltinbas opened this issue Jul 3, 2024 · 5 comments
Closed

[BUG] Fix IDR Formatting #3747

doganaltinbas opened this issue Jul 3, 2024 · 5 comments
Labels
fixed in master Fixed in master, awaiting next update kind:bug triaged Issue has been reviewed by Stripe and is being tracked internally

Comments

@doganaltinbas
Copy link

Summary

When processing payments in Indonesian Rupiah (IDR), the SDK adds two extra zeros to the displayed amount. For example, an amount of 186,332 IDR is shown as 18,633,200 IDR at the checkout button as it can be seen below.

checkout_button

iOS version

iOS 17.5

Installation method

SPM

SDK version

23.27.5

@yuki-stripe
Copy link
Collaborator

Hi @doganaltinbas, thank you for the report. Can you provide a PaymentIntent id with 186,332 IDR as the amount and currency?

@yuki-stripe yuki-stripe added the triaged Issue has been reviewed by Stripe and is being tracked internally label Jul 3, 2024
@yuki-stripe
Copy link
Collaborator

I believe you're actually providing an amount of 186,332,200 IDR on the PaymentIntent. If so, based on my research we should indeed show "IDR 186,332" in that case.

@doganaltinbas
Copy link
Author

doganaltinbas commented Jul 4, 2024

Hi @yuki-stripe,
In test environment, you can check this PaymentIntent id: pi_3PYivxHrTWtWHJGF0u48xwRu

yuki-stripe added a commit that referenced this issue Jul 8, 2024
## Summary
Stripe Intents w/ IDR currency have amounts with 'decimals' e.g. 1 IDR
is considered 1.00 IDR, which is represented as amount = 100.

We should divide the amount by 100 before displaying e.g. Stripe
amount=100 should display as 1 IDR

## Motivation
#3747
https://jira.corp.stripe.com/browse/RUN_MOBILESDK-3360

## Testing
See unit test

PaymentSheet w/ 1000 IDR Stripe amount:
![CleanShot 2024-07-08 at 11 38
49@2x](https://github.com/stripe/stripe-ios/assets/47796191/34ebff4b-4c8e-471d-8007-e93944d26efc)

Apple Pay:
![CleanShot 2024-07-08 at 11 39
18@2x](https://github.com/stripe/stripe-ios/assets/47796191/fb2e6603-7e49-4e80-8b8f-97992a01385a)


## Changelog
See CHANGELOG
@yuki-stripe yuki-stripe added the fixed in master Fixed in master, awaiting next update label Jul 8, 2024
@yuki-stripe
Copy link
Collaborator

@doganaltinbas This is fixed in 23.28.0!

@doganaltinbas
Copy link
Author

Thanks! @yuki-stripe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in master Fixed in master, awaiting next update kind:bug triaged Issue has been reviewed by Stripe and is being tracked internally
Projects
None yet
Development

No branches or pull requests

2 participants