Skip to content

Use Link branding for PTM payment methods in SPM #5130

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

Merged
merged 3 commits into from
Jul 11, 2025

Conversation

tillh-stripe
Copy link
Collaborator

@tillh-stripe tillh-stripe commented Jul 8, 2025

Summary

This pull request extends the Link branding beyond payment methods of type link to payment methods that were created in passthrough mode.

Motivation

Testing

Changelog

@tillh-stripe tillh-stripe requested a review from mats-stripe July 8, 2025 21:12
@tillh-stripe tillh-stripe marked this pull request as ready for review July 8, 2025 21:13
@tillh-stripe tillh-stripe requested review from a team as code owners July 8, 2025 21:13
@@ -59,6 +59,8 @@ struct ElementsCustomer: Equatable, Hashable {
let paymentMethod = paymentMethodWithLinkDetails.paymentMethod
if let linkDetails = paymentMethodWithLinkDetails.linkDetails {
paymentMethod.setLinkPaymentDetails(from: linkDetails)
} else {
paymentMethod.isLinkPassthroughMode = paymentMethodWithLinkDetails.isLinkOrigin
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

A payment method is only created in Link passthrough if isLinkOrigin is true but linkDetails is nil.

@@ -779,7 +779,7 @@ extension PaymentOption {
let hasLinkAccount = LinkAccountContext.shared.account?.isRegistered ?? false
switch self {
case .saved(let paymentMethod, _):
return paymentMethod.isLinkPaymentMethod && hasLinkAccount
return (paymentMethod.isLinkPaymentMethod || paymentMethod.isLinkPassthroughMode) && hasLinkAccount
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Treat passthrough and payment method mode the same when it comes to the return-user experience.

davidme-stripe
davidme-stripe previously approved these changes Jul 8, 2025
@tillh-stripe tillh-stripe merged commit 86eb8b4 into master Jul 11, 2025
6 checks passed
@tillh-stripe tillh-stripe deleted the tillh/link-ptm-in-spm branch July 11, 2025 17:31
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