Translate card errors

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Kevin
Posts: 13
Joined: 28 Nov 2017, 19:54

Translate card errors

Post by Kevin » 28 Dec 2017, 09:00

Hi,

How is it possible to translate errors when validating the card info in the checkout. Errors like:

Card has expired
Your card's security code is invalid.
...

Thanks !

K.

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: Translate card errors

Post by aimeos » 29 Dec 2017, 12:43

If the error messages are returned by Stripe, you should pass the ISO language code via the Stripe API so Stripe returns error messages for that language. In case you want to do some local checks and return errors before sending the data to Stripe, you can use the translate view helper to translate error messages to other languages via the config:

Code: Select all

<?= $this->translate( 'client', 'Card number invalid' ); ?>
https://aimeos.org/docs/Laravel/Overwrite_translations
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply