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]: PaymentElement onChange triggers only once and doesn't provide country data #541

Open
marko1010 opened this issue Nov 12, 2024 · 1 comment
Labels
bug Something isn't working stale

Comments

@marko1010
Copy link

marko1010 commented Nov 12, 2024

What happened?

I want to extract the country field value from the PaymentElement on every change.

<PaymentElement onChange={(e) => console.log(e)} />

When I select a country from the dropdown the onChange fires and the console logs:

{
    "elementType": "payment",
    "collapsed": false,
    "empty": true,
    "complete": false,
    "value": {
        "type": "card"
    }
}

The value object doesn't contain information about the country. How can I obtain that information?

Additionally, on subsequent country changes the onChange event doesn't get fired anymore.

Environment

Chrome 130.0.6723.117 on Windows 11

Reproduction

No response

@marko1010 marko1010 added the bug Something isn't working label Nov 12, 2024
@marko1010 marko1010 changed the title [BUG]: PaymentElement onChange triggers only once and doesn't show country data [BUG]: PaymentElement onChange triggers only once and doesn't provide country data Nov 12, 2024
Copy link

stale bot commented Dec 8, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 8, 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 stale
Projects
None yet
Development

No branches or pull requests

1 participant