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

[💳] Unavailable cards in pledge screen #579

Merged
merged 4 commits into from Aug 7, 2019
Merged

Conversation

eoji
Copy link
Contributor

@eoji eoji commented Aug 5, 2019

📲 What

Disabling ineligible cards (based on project currency) in pledge screen.

🤔 Why

So users can't pledge with cards that aren't accepted.

🛠 How

  • Added ProjectUtils.acceptedCardType to determine whether a card is accepted for a project's currency.
  • Added StoredCard.usdCardTypes and nonUsdCardTypes but will be replaced by API.
  • RewardCardAdapter now also takes in a project so the cards can be disabled if they're not accepted.
  • Added button_select.xml for a disablable soft black button.
  • Updated card expiration copy.
  • Manually added Not available string because I am impatient.
  • Tests.

👀 See

USD Project 💲 CAD Project 🇨🇦
screenshot-2019-08-05_114828 screenshot-2019-08-05_113355

📋 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

…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.
@eoji
Copy link
Contributor Author

eoji commented Aug 5, 2019

Copy link
Contributor

@Scollaco Scollaco left a 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).

}

@Test
fun testButtonCTA_whenCardNotAccepted() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here testButtonCTATitle_when...

}

@Test
fun testNotAvailableCopyIsVisible_whenCardIsNotAccepted() {
Copy link
Contributor

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
@eoji eoji merged commit e793454 into master Aug 7, 2019
@eoji eoji deleted the disabled-stored-cards branch August 7, 2019 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants