Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[MBL-1905] Revert "[MBL-1613]" #2207

Merged
merged 3 commits into from
Dec 9, 2024
Merged

[MBL-1905] Revert "[MBL-1613]" #2207

merged 3 commits into from
Dec 9, 2024

Conversation

scottkicks
Copy link
Contributor

@scottkicks scottkicks commented Dec 2, 2024

📲 What

Reverts #2171

🤔 Why

As our estimated shipping flag has been rolling out, a backer experienced an error when attempting to late pledge with Apple Pay. They were shown an error banner and weren't able to retry their pledge.

This looks to be an error where re-creating a payment intent is failing because some backend state changed.
See original thread between mobile and payments for more context: https://kickstarter.slack.com/archives/C3LS41US0/p1732652825528529

🛠 How

By reverting these changes, the checkout screen will dismiss forcing a new checkout object to be created for the user so that a new payment intent can be created and validated when there is an error like this.

✅ Acceptance criteria

Tested this by manually forcing validate checkout and onCompleteSessionCheckout to fail on Staging. Testing the Apple Pay flow on Prod to verify that is working as expected will be important also.

  • Validate Checkout and Checkout errors show the error banner
  • The checkout screen dismisses when after the error banner is shown
  • Attempting to pledge after this error scenario results in a successful attempt when there are not validation or checkout errors.

⏰ TODO

  • Test Apple Pay flow on Test Flight

@scottkicks scottkicks self-assigned this Dec 2, 2024
@scottkicks scottkicks marked this pull request as ready for review December 2, 2024 19:26
@scottkicks scottkicks requested review from ifosli, a team and stevestreza-ksr and removed request for a team December 2, 2024 19:26
Copy link
Contributor

@ifosli ifosli left a comment

Choose a reason for hiding this comment

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

Looks good; just one concern

@@ -456,7 +457,6 @@ public class NoShippingPostCampaignCheckoutViewModel: NoShippingPostCampaignChec

let completeCheckoutWithCreditCardInput: Signal<GraphAPI.CompleteOnSessionCheckoutInput, Never> = Signal
.combineLatest(self.confirmPaymentSuccessfulProperty.signal.skipNil(), checkoutId, selectedCard)
.takeWhen(self.confirmPaymentSuccessfulProperty.signal.skipNil())
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should still keep this takeWhen - it's probably not needed since a user shouldn't be able to change the selected card again once we dismiss this vc if checkout fails, but having "change selected card" kick off checkout is not a risk I'd like to take.

.observeValues { [weak self] error in

#if DEBUG
let serverError = error.errorMessages.first ?? ""
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Maybe put a default value (Unknown server error or something) instead of an empty string here, since this is for debugging

@scottkicks scottkicks merged commit de19f81 into main Dec 9, 2024
5 checks passed
@scottkicks scottkicks deleted the scott/revert-mbl-1613 branch December 9, 2024 21:03
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants