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

[MBL-866] Remove Add New Card Page #1829

Merged
merged 8 commits into from Jul 7, 2023

Conversation

msadoon
Copy link
Contributor

@msadoon msadoon commented Jun 19, 2023

📲 What

With the removal of Optimizely as our feature flagging tool, we've hardcoded the Stripe payment sheet as permanent feature. With that done, we no longer need our older Add New Card page.
This also simplifies the update to Stripe's framework (less UI components to update).

🤔 Why

It's part of technical roadmap for the rest of 2023, but also a precursor to upgrading Stripe.

🛠 How

AddNewCardViewController
AddNewCardViewControllerTests -> There were no associated screenshots
AddNewCardViewModel
AddNewCardViewModelTests

Associated views that present the above screen:
PledgePaymentMethodsViewController
PaymentMethodsViewController

Adjustments were made to remove input and output signals to functions presenting the view.

👀 See

No difference, Stripe payment sheet is displayed as before.

✅ Acceptance criteria

  • Ensure that AirTable script that presents the Pledge Page Stripe Payment Sheet is run through and all tests pass.
  • Ensure that AirTable script that presents the Stripe Payment Sheet in User Settings is run through and all tests pass.

⏰ TODO

  • Fix tests

@msadoon msadoon self-assigned this Jun 19, 2023
@msadoon msadoon added the WIP label Jun 19, 2023
@msadoon msadoon added this to the release-5.9.0 milestone Jun 19, 2023
@nativeksr
Copy link
Collaborator

1 Warning
⚠️ Big PR

Generated by 🚫 Danger

@codecov
Copy link

codecov bot commented Jul 5, 2023

Codecov Report

Merging #1829 (ec33279) into main (b2b69aa) will increase coverage by 0.13%.
The diff coverage is 92.46%.

@@            Coverage Diff             @@
##             main    #1829      +/-   ##
==========================================
+ Coverage   84.33%   84.46%   +0.13%     
==========================================
  Files        1277     1274       -3     
  Lines      115881   115167     -714     
  Branches    30810    30666     -144     
==========================================
- Hits        97728    97278     -450     
+ Misses      17086    16821     -265     
- Partials     1067     1068       +1     
Impacted Files Coverage Δ
...hods/Controller/PaymentMethodsViewController.swift 64.24% <0.00%> (+4.24%) ⬆️
...ontroller/PledgePaymentMethodsViewController.swift 48.85% <ø> (+3.64%) ⬆️
...iewModels/PledgePaymentMethodsViewModelTests.swift 96.83% <91.89%> (-0.75%) ⬇️
Library/ViewModels/PaymentMethodsViewModel.swift 98.17% <100.00%> (-0.08%) ⬇️
...rary/ViewModels/PaymentMethodsViewModelTests.swift 94.28% <100.00%> (-0.20%) ⬇️
...ary/ViewModels/PledgePaymentMethodsViewModel.swift 90.23% <100.00%> (-0.95%) ⬇️

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

@msadoon msadoon marked this pull request as ready for review July 6, 2023 15:37
@msadoon msadoon added needs review and removed WIP labels Jul 6, 2023
@msadoon msadoon requested a review from scottkicks July 6, 2023 15:37
@msadoon
Copy link
Contributor Author

msadoon commented Jul 6, 2023

@scottkicks So as for the acceptence criteria I went through most of it - the stuff I skipped was anything Apple Pay related, required backend support or didn't surface the Stripe payment sheet.

Here's what I tested:

[iOS] PLEDGE WITH EXISTING CARD (IN FLAG)
[iOS] PLEDGE WITH NEW CARD (IN FLAG)
[iOS] CHANGE PAYMENT METHOD (SAVED CARD) LIVE PLEDGE (IN FLAG)
[iOS] CHANGE PAYMENT METHOD (NEW CARD) LIVE PLEDGE (IN FLAG)

Here's what I didn't test:

[iOS] UPDATE PLEDGE (AMOUNT) LIVE PLEDGE (IN FLAG) (doesn't surface the Stripe sheet)
[iOS] CHANGE PAYMENT METHOD (APPLE PAY) LIVE PLEDGE (IN FLAG) (doesn't surface the Stripe sheet)
[iOS] PLEDGE WITH APPLE PAY (IN FLAG) (doesn't surface the Stripe sheet)
[iOS] EDIT REWARD LIVE PLEDGE (IN FLAG) (doesn't surface the Stripe sheet)
[iOS] FIX ERRORED PLEDGE WITH SAVED CARD (IN FLAG) (requires backend support)
[iOS] FIX ERRORED PLEDGE WITH NEW CARD (IN FLAG) (requires backend support)
[iOS] FIX ERRORED PLEDGE WITH APPLE PAY (IN FLAG) (requires backend support)

Feel free to do as much of the untested stuff as you want. I'm confident based on the code changes and testing there were no regressions introduced. If you can find any - great! I encourage you to try to break this code - ie. find ways it might not be production ready.

@msadoon
Copy link
Contributor Author

msadoon commented Jul 6, 2023

@scottkicks Tests were passing before I assigned, they just got re-run because main updated. That merge commit adds no new code - so there's no reason tests should fail.

Comment on lines 8 to 9
"revision" : "a5f16ba68913840ee5df91b8dc06f5cc063579de",
"version" : "1.2021110200.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to commit these version updates in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay good call. I'll remove these updates because they could potentially introduce breaking changes. It seemed okay in testing, but these dependencies were not tested individually in their use cases. It's on my plate to go over the dependencies with Isabel and understand what we need to update each quarter. We'll update this file separately.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I said they were okay in a previous comment, but re-thinking it here is safer not to commit these changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

great. thanks

@msadoon msadoon requested a review from scottkicks July 6, 2023 18:45
Copy link
Contributor

@scottkicks scottkicks left a comment

Choose a reason for hiding this comment

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

Ran through the test cases and couldn't get the add new payment feature to break. nice work!

I did notice that in PledgePaymentMethodsViewModelTests we should be able to remove private let goToAddCardIntent on line: 14. It isn’t being mapped to any view model outputs and may just be left over from some of the optimally removal work

One other question I have:
Is the expected UI when adding a card from settings that the loading indicator keeps showing until the new card has been added or cancelled? Or do we want that to stop loading once the add card screen pops up?

@msadoon
Copy link
Contributor Author

msadoon commented Jul 6, 2023

Ran through the test cases and couldn't get the add new payment feature to break. nice work!

I did notice that in PledgePaymentMethodsViewModelTests we should be able to remove private let goToAddCardIntent on line: 14. It isn’t being mapped to any view model outputs and may just be left over from some of the optimally removal work

One other question I have: Is the expected UI when adding a card from settings that the loading indicator keeps showing until the new card has been added or cancelled? Or do we want that to stop loading once the add card screen pops up?

Yea totally valid - I missed cleaning up goToAddCardIntent in PledgePaymentMethodsViewModelTests, so nice pointer. Removed that.

The loading spinner was implemented a long time ago - like last year - so reworking that is a little out of scope on this PR. It was acceptable UI when the Stripe payment sheet went in. Ideally we'd have loading off after the payment sheet is shown and turned on again before the payment cards are updated. Then off again after the update.

This is a nice-to-have. It wasn't an introduced regression from this code. Was this way since last year if I remember correctly.

@msadoon msadoon requested a review from scottkicks July 6, 2023 23:41
Copy link
Contributor

@scottkicks scottkicks left a comment

Choose a reason for hiding this comment

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

thanks for the changes.

your point about the loading state makes sense. it isn't a priority right now and since its out of scope for this PR we can leave for now.

@msadoon msadoon merged commit 268fbed into main Jul 7, 2023
5 checks passed
@msadoon msadoon deleted the mbl-866/remove-non-stripe-payment-sheet branch July 7, 2023 15:25
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

3 participants