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

[PAY-1816] Payment Sheet Loading States #1713

Merged
merged 14 commits into from Aug 25, 2022

Conversation

msadoon
Copy link
Contributor

@msadoon msadoon commented Aug 22, 2022

📲 What

Before and after the "New Payment Method" button is tapped we have a lag that is time taken during network requests from our end before Stripe's payment sheet is displayed.

Let's inform the user that he/she needs to wait before seeing the new UI/UX, and

🤔 Why

It's good to let the user understand there is a waiting period before we eventually update the UI/UX with the data from Stripe's payment sheet.

🛠 How

PledgePaymentMethodAddCell gets a loading state with an ActivityIndicator.
PledgePaymentMethodsDataSource gets a state to turn on/check loading for the above cell.
PledgeViewController gets a delegate to cancel appearance of payment sheet if the user pledges/clicks TOS/presents other views. User cannot click on "Add new card" until its out of its loading state.
PledgeViewModel gets a shouldCancelPaymentSheetAppearance signal that is triggered whenever the above delegate method is called, also internally when new cards are selected and if there is an error on PledgePaymentMethodsViewController.

👀 See

Before 🐛

Simulator.Screen.Recording.-.iPhone.8.-.2022-08-24.at.10.29.19.mp4

After 🦋

Simulator.Screen.Recording.-.iPhone.8.-.2022-08-24.at.10.21.29.mp4

✅ Acceptance criteria

  • Loading state appears before payment sheet is shown
  • Loading state continues to appear until payment method/error/payment sheet closed.

⏰ TODO

  • Ensure no duplicate taps occur when tapping the "Add New Payment" button
  • Ensure that loading spinner stops spinning when either error/payment card added.
  • Ensure selecting a new card stops showing of payment sheet.
  • Ensure pledging can occur during loading state (regular and Apple Pay)
  • Write tests.

…ting progress screen is. Still need to eliminate duplicate clicks and ensure pledges can be made while loading. Also double check error states and test.
@msadoon msadoon requested review from scottkicks and a team August 22, 2022 22:40
@msadoon msadoon self-assigned this Aug 22, 2022
@msadoon msadoon added this to the release-5.5.0 milestone Aug 22, 2022
@msadoon msadoon added the WIP label Aug 22, 2022
@msadoon msadoon added needs review and removed WIP labels Aug 24, 2022
@msadoon msadoon marked this pull request as ready for review August 24, 2022 19:17
@codecov
Copy link

codecov bot commented Aug 25, 2022

Codecov Report

Merging #1713 (03b93ca) into main (8ccf0b4) will increase coverage by 0.01%.
The diff coverage is 90.90%.

@@            Coverage Diff             @@
##             main    #1713      +/-   ##
==========================================
+ Coverage   85.32%   85.33%   +0.01%     
==========================================
  Files        1269     1271       +2     
  Lines      114295   114511     +216     
  Branches    30195    30236      +41     
==========================================
+ Hits        97518    97715     +197     
- Misses      15729    15746      +17     
- Partials     1048     1050       +2     
Impacted Files Coverage Δ
...ewModels/PledgePaymentMethodAddCellViewModel.swift 0.00% <0.00%> (ø)
...r-iOS/Views/Controllers/PledgeViewController.swift 72.93% <16.66%> (-0.73%) ⬇️
...ntrollers/PledgePaymentMethodsViewController.swift 46.47% <47.05%> (+1.86%) ⬆️
...ary/ViewModels/PledgePaymentMethodsViewModel.swift 96.64% <93.75%> (-0.18%) ⬇️
...S/DataSources/PledgePaymentMethodsDataSource.swift 88.88% <100.00%> (+2.35%) ⬆️
...aSources/PledgePaymentMethodsDataSourceTests.swift 99.17% <100.00%> (+0.05%) ⬆️
...r-iOS/Views/Cells/PledgePaymentMethodAddCell.swift 97.22% <100.00%> (+2.22%) ⬆️
...lers/PledgePaymentMethodsViewControllerTests.swift 100.00% <100.00%> (ø)
...iewModels/PledgePaymentMethodsViewModelTests.swift 97.90% <100.00%> (+0.11%) ⬆️
Library/Navigation.swift 85.20% <0.00%> (-0.65%) ⬇️
... and 1 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@msadoon msadoon merged commit 423abaa into main Aug 25, 2022
@msadoon msadoon deleted the pay-1816/payment-sheet-loading-states branch August 25, 2022 14:19
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

1 participant