Skip to content

Commit

Permalink
Only conditionally attach LAS to Intent
Browse files Browse the repository at this point in the history
  • Loading branch information
tillh-stripe committed Jan 28, 2025
1 parent b76a650 commit e07ad1a
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ internal class CollectBankAccountForACHLauncher(
private val hostedSurface: String?
) : CollectBankAccountLauncher {

private val attachToIntent: Boolean
// We only attach the intent if we're not hosted within another
// Stripe surface. If we're in one, then the surface will take care of
// attaching the LinkAccountSession.
get() = hostedSurface == null

override fun presentWithPaymentIntent(
publishableKey: String,
stripeAccountId: String?,
Expand All @@ -21,7 +27,7 @@ internal class CollectBankAccountForACHLauncher(
clientSecret = clientSecret,
configuration = configuration,
hostedSurface = hostedSurface,
attachToIntent = true
attachToIntent = attachToIntent,
)
)
}
Expand All @@ -39,7 +45,7 @@ internal class CollectBankAccountForACHLauncher(
clientSecret = clientSecret,
configuration = configuration,
hostedSurface = hostedSurface,
attachToIntent = true
attachToIntent = attachToIntent,
)
)
}
Expand Down

0 comments on commit e07ad1a

Please sign in to comment.