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
[💳] Unavailable cards in pledge screen #579
Conversation
…cepted for a project's currency. Added StoredCard.usdCardTypes and nonUsdCardTypes but will be replaced by API. RewardCardAdapter now takes in a project so the cards can be disabled if they're not accepted. Disabling non accepted cards in PledgeFragment. Added button_select for a disablable soft black button. Updated card expiration copy. Manually added Not available string because I am impatient. Tests.
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.
Good job, @eoji. It looks awesome 😄 I left some suggestions for better naming (IMO), but will approve the PR since they are suggestions (except the extra line comment).
app/src/main/java/com/kickstarter/viewmodels/RewardCardViewHolderViewModel.kt
Show resolved
Hide resolved
app/src/test/java/com/kickstarter/viewmodels/RewardCardViewHolderViewModelTest.kt
Outdated
Show resolved
Hide resolved
} | ||
|
||
@Test | ||
fun testButtonCTA_whenCardNotAccepted() { |
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.
Same here testButtonCTATitle_when...
app/src/test/java/com/kickstarter/viewmodels/RewardCardViewHolderViewModelTest.kt
Outdated
Show resolved
Hide resolved
} | ||
|
||
@Test | ||
fun testNotAvailableCopyIsVisible_whenCardIsNotAccepted() { |
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.
And here testNotAvailableCopyIsVisible_isTrue_when...
# Conflicts: # app/src/main/java/com/kickstarter/viewmodels/PledgeFragmentViewModel.kt # app/src/test/java/com/kickstarter/viewmodels/PledgeFragmentViewModelTest.kt
📲 What
Disabling ineligible cards (based on project currency) in pledge screen.
🤔 Why
So users can't pledge with cards that aren't accepted.
🛠How
ProjectUtils.acceptedCardType
to determine whether a card is accepted for a project's currency.StoredCard.usdCardTypes
andnonUsdCardTypes
but will be replaced by API.RewardCardAdapter
now also takes in a project so the cards can be disabled if they're not accepted.button_select.xml
for a disablable soft black button.Not available
string because I am impatient.👀 See
📋 QA
Note: The v1 API does not return a project's localized country name so I'm just using
project.location.displayableName
because I can only work with what I have.🇺🇸 All cards should be available for projects that are in USD.
🚫🇺🇸 Non USD projects only allow AMEX™, Mastercard™, and Visa™
Story 📖
Trello Story