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
Update afterpay/clearpay to support FR and ES. #5221
Conversation
…al vs the new one.
payments-ui-core/src/main/java/com/stripe/android/ui/core/elements/AfterpayClearpayElementUI.kt
Outdated
Show resolved
Hide resolved
urlSpanStyle: SpanStyle = SpanStyle(textDecoration = TextDecoration.Underline) | ||
enabled: Boolean = true, | ||
urlSpanStyle: SpanStyle = SpanStyle(textDecoration = TextDecoration.Underline), | ||
imageAlign: PlaceholderVerticalAlign = PlaceholderVerticalAlign.AboveBaseline |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The afterpay image is bottom aligned, whereas the affirm one is "aboveBaseline"
Diffuse output:
APK
DEX
ARSC
|
amount.currencyCode | ||
fun getLabel(resources: Resources): String { | ||
val numInstallments = when (amount.currencyCode.lowercase()) { | ||
"eur" -> 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have enums for currency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, currently we don't. There is a java.util.Currency class that we could use to get strongly typed currencies. Right now I can see it being good to strongly type the currency in the Amount.kt, CurrencyFormatter. Not sure there is a lot of value in adding it for the older classes.
Given the size of this type of change I would recommend pulling it out as a tech debt item.
@@ -13,15 +14,35 @@ import java.util.Locale | |||
class AfterpayClearpayHeaderElementTest { | |||
|
|||
@Test | |||
fun `Verify label is correct`() { | |||
fun `Verify label is correct for USD`() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test for image first? As in one of the images you posted in the PR description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't do this on the main sheet because the order of the LPMs in the selectors is not consistent. As we advance our screenshot testing I think it would be good to add testing for the core UI components like the Html element rather than the payment method specific UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not really following. Can't we change the locale to korean or something that makes the image icon tag first in the string? Not looking for a screenshot test, an assert as you have in this test would suffice
Summary
Update afterpay/clearpay to support new countries. A lot of these updates were to the Html element. This is so that clickable links would work correctly when they appeared after a Placeholder image.
Motivation
Request from platform team.
Testing
Screenshots
All screenshots with two messaging are showing the new messaging view with the original messaging view under it.
Changelog