Fix Stripe Link payment method not being sent to transactionInitialize#52
Merged
lkostrowski merged 1 commit intomainfrom Jan 27, 2026
Merged
Fix Stripe Link payment method not being sent to transactionInitialize#52lkostrowski merged 1 commit intomainfrom
lkostrowski merged 1 commit intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
witoszekdev
approved these changes
Jan 27, 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
elements.submit()returnsselectedPaymentMethodas undefined for LinkPaymentElement'sonChangeevent and use it as a fallbackProblem
When a user pays with Stripe Link (saved payment credentials),
elements.submit()returnsselectedPaymentMethodas undefined instead of"link". This causes thetransactionInitializemutation to fail because no payment method type is provided.Solution
Use the
PaymentElement'sonChangeevent to track the selected payment method type (event.value.type). Whenelements.submit()doesn't returnselectedPaymentMethod, fall back to the value captured fromonChange.Changes (
stripe-checkout-form.tsx)StripePaymentElementChangeEventtypepaymentMethodTypestate to track the selected type fromonChangeonChangehandler onPaymentElementselectedPaymentMethod || paymentMethodTypeTest plan
paymentMethodsent totransactionInitializeis"link"Related
saleor/apps#2207
🤖 Generated with Claude Code