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

[BUG]: defaultValues and fields configuration ignored if Payment Element is initialised without Payment intent #701

Open
tomswales opened this issue Dec 13, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@tomswales
Copy link

What happened?

In the API docs for Payment Element, it mentions the defaultValues and fields options for prefilling or hiding fields in the Payment Element. This works for a Payment Element initiated with a Payment Intent already created, but not for a Payment Element initiated with no Payment Intent already created. The prefilled fields and hidden fields provided are simply ignored. For example:

defaultValues: { billingDetails: { name: "My Name", email: "tom@example.com" } }

Has a different outcome depending on whether the payment intent was created or not:

Screenshot 2024-12-13 at 13 38 34 Screenshot 2024-12-13 at 13 39 38

Is it intentional? There are valid use cases for initiating the Payment Element with prefilled fields even where we don't want to create an intent yet.

Environment

No response

Reproduction

No response

@tomswales tomswales added the bug Something isn't working label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant