Replaces the errorMessage of failed results with a message for the customer, in their language, chosen by the result's normalized code (or by a plugin's error code in errorCode). The provider's message stays in providerMessage.
errorMessage
code
errorCode
providerMessage
import { localizedErrors } from 'better-payment/plugins';const payment = betterPayment({ providers: { ... }, plugins: [localizedErrors({ locale: 'tr' })],}); Copy
import { localizedErrors } from 'better-payment/plugins';const payment = betterPayment({ providers: { ... }, plugins: [localizedErrors({ locale: 'tr' })],});
Replaces the
errorMessageof failed results with a message for the customer, in their language, chosen by the result's normalizedcode(or by a plugin's error code inerrorCode). The provider's message stays inproviderMessage.