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-1390: Add Stripe Link #2048

Merged
merged 5 commits into from
May 7, 2024

Conversation

amy-at-kickstarter
Copy link
Contributor

@amy-at-kickstarter amy-at-kickstarter commented Apr 25, 2024

📲 What

Implement Stripe Link for iOS.

🤔 Why

Stripe Link allows backers to store their card information with Stripe, and then auto-complete it when they use the Stripe payment sheet in Kickstarter. We're implementing this because it's a nicer user experience in checkout.

🛠 How

When Stripe Link returns, it gives us payment display information specific to Stripe Link - i.e. it was giving us a the Link icon and the label "Stripe Link".

Screenshot 2024-04-25 at 9 53 49 AM

To work around this, Stripe suggested we fetch the underlying payment method associated with the link, which allows us to grab the last four digits of the card and its card image. This makes Stripe Link function the way a manually added card does, and looks better in our UI.

Screenshot 2024-05-06 at 11 37 03 AM

👀 See

stripe-link-working.mp4

✅ Regression testing before merging

  • Pay with Stripe Link in live pledge flow
  • Pay with Stripe Link in late pledge flow
  • Pay with manually added card in live pledge flow
  • Pay with manually added card in late pledge flow

@amy-at-kickstarter amy-at-kickstarter force-pushed the feat/adyer/MBL-1390/add-stripe-link branch from 8048c8a to faa7992 Compare May 6, 2024 15:18
@@ -22,15 +22,15 @@ extension STPPaymentMethod {
])

static let sampleStringPaymentOption: (STPPaymentMethod) -> PaymentSheet.PaymentOption = { paymentMethod in
PaymentSheet.PaymentOption.saved(paymentMethod: paymentMethod)
PaymentSheet.PaymentOption.saved(paymentMethod: paymentMethod, confirmParams: nil)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Small change due to the Stripe SDK upgrade

@@ -157,6 +157,8 @@ public final class PaymentMethodSettingsViewModel: PaymentMethodsViewModelType,
var configuration = PaymentSheet.Configuration()
configuration.merchantDisplayName = Strings.general_accessibility_kickstarter()
configuration.allowsDelayedPaymentMethods = true
configuration.defaultBillingDetails.email = AppEnvironment.current.currentUserEmail
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is how Stripe looks up the user for Stripe Link

.retrieveSetupIntent(
withClientSecret: clientSecret,
expand: ["payment_method"]
) { [weak self] intent, _ in
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The callbacks for retrieveSetupIntent and for retrievePaymentIntent have different types, so they can't be shared.

@amy-at-kickstarter amy-at-kickstarter marked this pull request as ready for review May 6, 2024 15:44
@amy-at-kickstarter amy-at-kickstarter force-pushed the feat/adyer/MBL-1390/add-stripe-link branch from faa7992 to 5d6f6ae Compare May 6, 2024 16:47
@amy-at-kickstarter amy-at-kickstarter requested review from a team and ifosli and removed request for a team May 6, 2024 16:47
@amy-at-kickstarter amy-at-kickstarter self-assigned this May 6, 2024
@amy-at-kickstarter amy-at-kickstarter marked this pull request as draft May 6, 2024 18:38
@amy-at-kickstarter
Copy link
Contributor Author

Converting to draft so I can add a feature flag

@amy-at-kickstarter amy-at-kickstarter force-pushed the feat/adyer/MBL-1390/add-stripe-link branch from 5d6f6ae to 9783d4e Compare May 7, 2024 15:40
@amy-at-kickstarter amy-at-kickstarter marked this pull request as ready for review May 7, 2024 15:40
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.

👍

@amy-at-kickstarter amy-at-kickstarter merged commit ce7c8f8 into main May 7, 2024
5 checks passed
@amy-at-kickstarter amy-at-kickstarter deleted the feat/adyer/MBL-1390/add-stripe-link branch May 7, 2024 21:15
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.

2 participants