Question

Using Magento 2.3.3, I've set up a sandbox Auth.net account, and added the API Login ID, Transaction Key, Public Client Key and Signature Key to the admin configuration, enabled the Payment Method and cleared the cache.

On checkout, selecting the Auth.net payment method and clicking 'Place Order', I'm getting an error displayed on the payment page:

User authentication failed due to invalid authentication values.

But I'm seeing a different error in the requests to the API:

Request URL: https://apitest.authorize.net/xml/v1/request.api
Request Method: OPTIONS
Status Code: 200 OK

Response:

{"messages":{"resultCode":"Error","message":[{"code":"E00001","text":"Error reading JToken from JsonReader. Path '', line 0, position 0."}]}}

I guess this could be a result of the configuration, but afaict, there's nothing further required than the above.

No correct solution

OTHER TIPS

I have experienced this issue in Magento 2.3.4 and authorize.net production environment that I have downloaded authorize.net official extension from Magento marketplace and install then also found the same issue.

After debugging, I have found error due to the special character in the line item.

Authorize.net accept only 30 characters in the line item name field, but when use PHP substr function it can't work for arebic charectore and all request parameter become blank due to this error

I have changed in below file

AuthorizeNet\Core\Gateway\Request\AbstractRequestBuilder

line number 171

form

$formattedName = substr($item->getName(), 0, 31);

to

$formattedName = mb_substr($item->getName(), 0, 31, 'utf-8');

After this changes payment method working fine

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top