0

When a customer checks out on my Magento 2 website, and the credit card is rejected due to an AVS mismatch (Authorize.net), Magento 2 only says "server error". Where can I edit this to say "Address verification failure"?

On Magento 1, I was able to install a plugin that allowed for Authorize.net to provide customers with custom messages. This is not available for Magento 2, so I would just like to change "server error" to "address verification failure" so the customers know that is why their order did not go through.

1 Answer 1

0

the workaround I put into place:

Copy

`vendor/magento/module-payment/view/frontend/templates/transparent/iframe.phtm1` 

to

app/design/frontend/[VENDOR]/[THEME]/Magento_Payment/templates/transparent/iframe.phtml.

Edit the new template's

block, especially the message: $t('An error occurred on the server. Please try to place the order again.') line. This block checks if there is an error message, but never actually uses it. I changed the text to:

if ($msg === 'This transaction has been declined.') {
    $msg = 'The transaction was declined. Please review your payment details and try again.';
}

This block alters the error a bit, to make it more customer friendly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.