Fix Satispay mandate_data missing with setup_future_usage#12232
Merged
toluo-stripe merged 6 commits intomasterfrom Jan 20, 2026
Merged
Fix Satispay mandate_data missing with setup_future_usage#12232toluo-stripe merged 6 commits intomasterfrom
toluo-stripe merged 6 commits intomasterfrom
Conversation
Contributor
|
Diffuse output: APKDEX |
| * | ||
| * For saved payment methods, this checks the payment method type's requiresMandate property. | ||
| */ | ||
| private fun PaymentMethodConfirmationOption.requiresMandateData(): Boolean { |
Collaborator
There was a problem hiding this comment.
This seems off from what we do in the client-side confirm flow. We should be re-using the logic here which handles the setup intent and payment intent use cases.
private fun mandateData(
intent: StripeIntent,
paymentMethodType: PaymentMethod.Type?,
optionsParams: PaymentMethodOptionsParams?,
intentConfigSetupFutureUsage: ConfirmPaymentIntentParams.SetupFutureUsage?
): MandateDataParams? {
return paymentMethodType?.let { type ->
val supportsAddingMandateData = when (intent) {
is PaymentIntent ->
intent.canSetupFutureUsage(paymentMethodType.code) ||
type.requiresMandateForPaymentIntent ||
optionsParams?.setupFutureUsage()?.hasIntentToSetup() == true ||
intentConfigSetupFutureUsage?.hasIntentToSetup() == true
is SetupIntent -> true
}
return MandateDataParams(MandateDataParams.Type.Online.DEFAULT).takeIf {
supportsAddingMandateData && type.requiresMandate
}
}
}| ) { | ||
| } | ||
|
|
||
| fun configure( |
Collaborator
There was a problem hiding this comment.
What's going on here?
Collaborator
There was a problem hiding this comment.
Seems unused and can be removed.
7f2b6bc to
5c0618a
Compare
When confirming a PaymentIntent with Satispay and setup_future_usage set to off_session, the SDK was not including mandate_data in the request, causing the API to reject the request. The root cause was that Satispay had requiresMandate = false in PaymentMethod.kt. The mandateData() function in ConfirmStripeIntentParamsFactory only adds mandate_data when both: 1. The intent supports setup for future usage (true for off_session) 2. The payment method requiresMandate is true This change sets requiresMandate = true for Satispay, ensuring mandate_data is included when setup_future_usage is set. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Committed-By-Agent: claude
When confirming with a Confirmation Token (deferred intent), the SDK wasn't including mandate_data when Payment Method Options (PMO) Setup Future Usage (SFU) was set. This caused errors for payment methods like Satispay that require mandate_data when SFU is set. The fix adds a check in ConfirmationTokenConfirmationInterceptor to also include mandate_data when: 1. The payment method type has requiresMandate = true 2. PMO SFU is set in optionsParams (populated from IntentConfiguration) Also updates playground to only send PMO SFU for Normal integration type to avoid hitting this issue in deferred flows. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Committed-By-Agent: claude
3eb5d71 to
eaa5540
Compare
payments-core/src/main/java/com/stripe/android/ConfirmStripeIntentParamsFactory.kt
Outdated
Show resolved
Hide resolved
| * @param intentConfigSetupFutureUsage The intent configuration level SFU | ||
| */ | ||
| @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) | ||
| fun mandateDataForDeferredIntent( |
Collaborator
There was a problem hiding this comment.
Nit: Naming here should just be mandateData since we don't know whether or not the intent is deferred.
samer-stripe
approved these changes
Jan 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes an issue where confirming a PaymentIntent with Satispay and
setup_future_usage = off_sessionfails becausemandate_datais not included in the confirmation request.Motivation
https://stripe.slack.com/archives/CFA2HJ99A/p1768416799593999
Testing
Changelog