-
Notifications
You must be signed in to change notification settings - Fork 199
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
Error with localization #77
Comments
|
I'm the original poster on the WP support area. - I've investigated this a little more. It ends up this only occurs on empty form submission. If you submit an empty form to stripe, it returns an error message without a code. Empty form response: If the form has any data it will return with a code Example response: The problem being it's not currently possible to localise the empty form error response. |
@roykho you have added messages only for card_error type and assumed that any responseObject will have a code, but as you can see in the results pasted by @netplus and also in the Stripe docs, there also additional error types and not all types have a code, some of them only have a type and message. From the Stripe.com docs linked above:
The appropriate solution would be check responseObject.response.error.type to determine what data contains the responseObject (e.g. it has a code or not?) and proceed accordingly. That is basically what Stripe.com is recommending with this:
|
@samuelaguilera - this has already been flagged a bug so it is known and will be fixed by next release. |
@roykho great! just commented because of your comment after flagging it as a bug and also seeing that it was labeled as "needs author reply" days after that. Just wanted to add some light here :) |
Wrong object returned from stripe is being used, causing localised error messages to not display.
stripe.js l:93
Broken:
Fixed:
Source: https://wordpress.org/support/topic/error-message-localization-broken/
The text was updated successfully, but these errors were encountered: