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-1373] ValidateCheckout Before Completing Checkout With ApplePay #2047

Merged
merged 4 commits into from
Apr 30, 2024

Conversation

scottkicks
Copy link
Contributor

@scottkicks scottkicks commented Apr 25, 2024

📲 What

Calls ValidateCheckout mutation after ApplePay Context completes and before CompleteOnSessionCheckout

🤔 Why

We should be validating the current late pledge checkout for ApplePay pledges like we do for Stripe pledges.

🛠 How

When the ApplePay sheet completes, didCreatePaymentMethod is called and we pass our ApplePayParams object back to the ViewModel to complete the checkout. This method returns a StripePayments.STPPaymentMethod with an id (stripeId) that we need to validate the checkout. So, we'll use that ID to call ValidateCheckout before trying to complete the checkout.

👀 See

No visible changes

✅ Acceptance criteria

  • ApplePay Late Pledges still work
  • If ValidateCheckout fails, an error message banner is shown
  • The processing view is still shown until the backing is complete

@scottkicks scottkicks self-assigned this Apr 25, 2024
@scottkicks scottkicks force-pushed the scott/mbl-1373/validate-apple-pay-checkout branch from 000dd7c to e8ba3a6 Compare April 25, 2024 16:41
@scottkicks scottkicks marked this pull request as ready for review April 25, 2024 17:37
@scottkicks scottkicks requested review from a team and ifosli and removed request for a team April 25, 2024 17:47
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.

A couple comments but not blocking for this pr. However, please make sure you actually test this in prod if you haven't already! With the release timeline, I'm okay with just testing that in the testflight build if that's easier and doing a rollback if we need to, but let's make sure any apple pay changes are thoroughly tested before they're released to our users.

Copy link
Contributor

@amy-at-kickstarter amy-at-kickstarter left a comment

Choose a reason for hiding this comment

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

Also LGTM.

@scottkicks scottkicks requested a review from ifosli April 30, 2024 15:55
@scottkicks
Copy link
Contributor Author

@ifosli Noted in regression that we should thoroughly test this in TestFlight before releasing. I also cleaned up the ApplePayParams stuff. Good call out!

@scottkicks scottkicks merged commit 6378e7b into main Apr 30, 2024
5 checks passed
@scottkicks scottkicks deleted the scott/mbl-1373/validate-apple-pay-checkout branch April 30, 2024 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants