Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / "A valid amount is required" error with Authorize.net AIM

"A valid amount is required" error with Authorize.net AIM

Views: 13,526

Results 1 to 12 of 12
9 Mar 2014, 9:09 PM
#1
buggrub_com avatar

buggrub_com

New Zenner

Join Date:
Jul 2013
Location:
Cambridge, UK
Posts:
9
Plugin Contributions:
0

"A valid amount is required" error with Authorize.net AIM

I have just signed up to Authorize.net and I am using the builtin Authorize.net AIM paymant module in Zencart.

I have tried this in test mode and production mode and I still get the same error message when trying to process a transaction. I have set up the log file (shown below) and it shows x_amount => 0.00 when the transaction is actially for £16.60 GBP.

Has anyone else seen this error and can you help?

Many thanks
Peter

Mar-07-2014 08:32:20

Response Code: 3.
Response Text: (TESTMODE) A valid amount is required.

Sending to Authorizenet: Array
(
[x_login] => *******
[x_tran_key] => *******
[x_relay_response] => FALSE
[x_delim_data] => TRUE
[x_delim_char] => |
[x_encap_char] => *
[x_version] => 3.1
[x_type] => AUTH_CAPTURE
[x_method] => CC
[x_amount] => 0.00
[x_currency_code] => USD
[x_card_num] => XXXXXXXXX0015
[x_exp_date] => 1214
[x_card_code] => ****
[x_email_customer] => FALSE
[x_email_merchant] => FALSE
[x_cust_id] => 1
[x_invoice_num] => TEST-10502-VQbRfk
[x_first_name] => Peter
[x_last_name] => Ward
[x_company] => BugGrub Limited
[x_address] => 4 Lynn Road
[x_city] => King's Lynn
[x_state] => Norfolk
[x_zip] => PE33 0EW
[x_country] => United Kingdom
[x_phone] => 447973320013
[x_email] => [email protected]
[x_ship_to_first_name] => Peter
[x_ship_to_last_name] => Ward
[x_ship_to_address] => 4 Lynn Road
[x_ship_to_city] => King's Lynn
[x_ship_to_state] => Norfolk
[x_ship_to_zip] => PE33 0EW
[x_ship_to_country] => United Kingdom
[x_description] => Test product 1 (qty: 1)
[x_recurring_billing] => NO
[x_customer_ip] => 86.157.161.22
[x_po_num] => Mar-07-2014 08:32:19
[x_tax_exempt] => FALSE
[x_duty] => 0
[x_allow_partial_Auth] => FALSE
[Date] => March 7, 2014, 8:32 pm
[IP] => 86.157.161.22
[Session] => fd1d8a867b6f52d2ed82c01ccd11e2f7
[x_test_request] => TRUE
[url] => https://secure.authorize.net/gateway/transact.dll
)

Results Received back from Authorizenet: Array (
[0] => Response from gateway
[1] => 3
[2] => 1
[3] => 5
[4] => (TESTMODE) A valid amount is required.
[5] => 000000
[6] => P
[7] => 0
[8] => TEST-10502-VQbRfk
[9] => Test product 1 (qty: 1)
[10] => 0.00
[11] => CC
[12] => auth_capture
[13] => 1
[14] => Peter
[15] => Ward
[16] => BugGrub Limited
[17] => 4 Lynn Road
[18] => Kings Lynn
[19] => Norfolk
[20] => PE33 0EW
[21] => United Kingdom
[22] => 447973320013
[23] =>
[24] => [email protected]
[25] => Peter
[26] => Ward
[27] =>
[28] => 4 Lynn Road
[29] => Kings Lynn
[30] => Norfolk
[31] => PE33 0EW
[32] => United Kingdom
[33] =>
[34] => 0.00
[35] =>
[36] => FALSE
[37] => Mar-07-2014 08:32:19
[38] => FC50DAC180EE8E7A303080D6285E4272
[39] =>
[40] =>
[41] =>
[42] =>
[43] =>
[44] =>
[45] =>
[46] =>
[47] =>
[48] =>
[49] =>
[50] =>
[51] => XXXX0015
[52] => MasterCard
[53] =>
[54] =>
[55] =>
[56] =>
[57] =>
[58] =>
[59] =>
[60] =>
[61] =>
[62] =>
[63] =>
[64] =>
[65] =>
[66] =>
[67] =>
[68] =>
[69] => March 7, 2014, 8:32 pm
[70] => 86.157.161.22
[71] => fd1d8a867b6f52d2ed82c01ccd11e2f7
[Expected-MD5-Hash] => FC50DAC180EE8E7A303080D6285E4272
[HashMatchStatus] => PASS
)

CURL communication info: Array
(
[url] => https://secure.authorize.net/gateway/transact.dll
[content_type] => text/html
[http_code] => 200
[header_size] => 288
[request_size] => 208
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 1.137378
[namelookup_time] => 0.027753
[connect_time] => 0.2024
[pretransfer_time] => 0.75883
[size_upload] => 1048
[size_download] => 633
[speed_download] => 556
[speed_upload] => 921
[download_content_length] => 633
[upload_content_length] => 1048
[starttransfer_time] => 0.934109
[redirect_time] => 0
[certinfo] => Array
(
)

[primary_ip] => 64.94.118.32
[redirect_url] =>

)

RAW data received:
3|1|5|(TESTMODE) A valid amount is
required.
|000000|P|0|TEST-10502-VQbRfk|Test product 1 (qty:
1)
|0.00|CC|auth_capture|1|Peter|Ward|BugGrub Limited|4 Lynn
Road
|Kings Lynn|Norfolk|PE33 0EW|United
Kingdom
|447973320013||[email protected]|Peter|Ward||4
Lynn Road
|Kings Lynn|Norfolk|PE33 0EW|United
Kingdom
||0.00||FALSE|Mar-07-2014
08:32:19
|FC50DAC180EE8E7A303080D6285E4272|||||||||||||XXXX0015|MasterCard|||||||||||||||||March
7, 2014, 8:32 pm
|86.157.161.22|fd1d8a867b6f52d2ed82c01ccd11e2f7

9 Mar 2014, 9:11 PM
#2
buggrub_com avatar

buggrub_com

New Zenner

Join Date:
Jul 2013
Location:
Cambridge, UK
Posts:
9
Plugin Contributions:
0

Re: "A valid amount is required" error with Authorize.net AIM

One further thing to add is that I have Paypal Express installed and this works correctly, sending both the correct amount and currency to PayPal.

9 Mar 2014, 11:02 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: "A valid amount is required" error with Authorize.net AIM

I'm guessing you have no currency-exchange rate configured in your store for both USD and GBP? Admin->Localisation->Currencies

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

10 Mar 2014, 7:04 AM
#4
buggrub_com avatar

buggrub_com

New Zenner

Join Date:
Jul 2013
Location:
Cambridge, UK
Posts:
9
Plugin Contributions:
0

Re: "A valid amount is required" error with Authorize.net AIM

DrByte

I only have one currency set up, GBP with no conversion rate. USD is not used.

10 Mar 2014, 9:55 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: "A valid amount is required" error with Authorize.net AIM

The module is apparently translating to USD, and since there's not exchange rate set for it, it's using 0.00 as the multiplier.

So, either add USD with an exchange rate of 1.0000 so it submits the same amount regardless of currency,
or experimentally add the authnet module from v1.6.0 as found on the zen cart github account, and see if it solves the problem for you (since it's designed to support GBP as well as USD for authorize.net).

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

11 Mar 2014, 10:58 AM
#6
buggrub_com avatar

buggrub_com

New Zenner

Join Date:
Jul 2013
Location:
Cambridge, UK
Posts:
9
Plugin Contributions:
0

Re: "A valid amount is required" error with Authorize.net AIM

I've added USD as a payment option with the correct conversion rate, and it has cleared the above problem but seems to be sending the converted price as USD and my merchant account does not accept USD only GBP.

(TESTMODE) The supplied currency code is either invalid, not supported, not allowed for this merchant or doesn't have an exchange rate. - Your credit card could not be authorized for this reason. Please correct the information and try again or contact us for further assistance.

Mar-11-2014 11:49:00

Response Code: 3.
Response Text: (TESTMODE) The supplied currency code is either invalid, not supported, not allowed for this merchant or doesn't have an exchange rate.

Sending to Authorizenet: Array
(
[x_login] => *******
[x_tran_key] => *******
[x_relay_response] => FALSE
[x_delim_data] => TRUE
[x_delim_char] => |
[x_encap_char] => *
[x_version] => 3.1
[x_type] => AUTH_CAPTURE
[x_method] => CC
[x_amount] => 29.55
[x_currency_code] => USD
[x_card_num] => XXXXXXXXXXXXX0027
[x_exp_date] => 1214
[x_card_code] => ****
[x_email_customer] => FALSE
[x_email_merchant] => FALSE
[x_cust_id] => 1
[x_invoice_num] => TEST-10502-GXptfs

I think my only option will be to install "the authnet module from v1.6.0 as found on the zen cart github account" as you suggested above. I can't believe the standard Authorize.net is not set up to accept payments other than in USD. Surely other customers in the UK must have this payment method.

I'll send an update later.

Peter

11 Mar 2014, 11:52 AM
#7
buggrub_com avatar

buggrub_com

New Zenner

Join Date:
Jul 2013
Location:
Cambridge, UK
Posts:
9
Plugin Contributions:
0

Re: "A valid amount is required" error with Authorize.net AIM

I have downloaded the authnet module from v1.6.0 as found on the zen cart github account and placed the following 3 files in my shop:-

/includes/modules/payment/authorizenet_aim.php
/includes/modules/payment/authorizenet/authorizenet_admin_notification.php
/includes/languages/english/modules/payment/authorizenet_aim.php

When I go to modules -> payment in the site admin the page stops just below the new "authorizenet_aim" and doesn't load the remaining payment modules. I am just thinking that maybe I need to make a change to the DB for this new module.

If so, could you please provide the sql script for this.

For info. if I roll back to the original 3 files, the pages loads correctly.

Many thanks
Peter

11 Mar 2014, 12:18 PM
#8
buggrub_com avatar

buggrub_com

New Zenner

Join Date:
Jul 2013
Location:
Cambridge, UK
Posts:
9
Plugin Contributions:
0

Re: "A valid amount is required" error with Authorize.net AIM

I have been doing a little playing around and found that if I use:-

/includes/languages/english/modules/payment/authorizenet_aim.php (v1.5.1)

I have used the original language file version from v1.5.1 alongside the two v1.6.0 payment module files and it seems to be working now in GBP. Should this be OK?

13 Mar 2014, 2:07 AM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: "A valid amount is required" error with Authorize.net AIM

BugGrub.com:

I can't believe the standard Authorize.net is not set up to accept payments other than in USD. Surely other customers in the UK must have this payment method.
It's quite simple really: At the time when v1.5.1 was published, Authorize.net didn't offer GBP support, so it wasn't built into the code.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

13 Mar 2014, 2:09 AM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: "A valid amount is required" error with Authorize.net AIM

BugGrub.com:

I have downloaded the authnet module from v1.6.0 as found on the zen cart github account and placed the following 3 files in my shop:-

/includes/modules/payment/authorizenet_aim.php
/includes/modules/payment/authorizenet/authorizenet_admin_notification.php
/includes/languages/english/modules/payment/authorizenet_aim.php

When I go to modules -> payment in the site admin the page stops just below the new "authorizenet_aim" and doesn't load the remaining payment modules. I am just thinking that maybe I need to make a change to the DB for this new module.

If so, could you please provide the sql script for this.

For info. if I roll back to the original 3 files, the pages loads correctly.

Many thanks
PeterApologies. I'd forgotten that v1.6.0 introduced some new features to make admin troubleshooting of payment/shipping modules easier. But in doing so made it incompatible with v1.5.x
The v1.5.2 edition of those files should be fine. There's a beta for v1.5.2 available in the forum's News & Announcements section.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

2 Apr 2019, 6:00 PM
#11
avaadorn avatar

avaadorn

Zen Follower

Join Date:
Feb 2012
Posts:
106
Plugin Contributions:
0

Re: "A valid amount is required" error with Authorize.net AIM

I had deactivated Authorize.net for a few months when business was slow and I just reactivated and now I'm getting this same error: A valid amount is required. - Your credit card could not be authorized for this reason. Please correct the information and try again or contact us for further assistance.

It's sending a $0 amount but in USD. It was working just fine a few months ago and I didn't change a thing. I just disabled the payment module in my shopping cart and now I've enabled it but I'm getting that strange error. Where should I look to fix this?

3 Apr 2019, 8:49 PM
#12
avaadorn avatar

avaadorn

Zen Follower

Join Date:
Feb 2012
Posts:
106
Plugin Contributions:
0

Re: "A valid amount is required" error with Authorize.net AIM

Looks like it had something to do with applying store credit if it was available. If a value of $0 store credit is chosen, then it doesn't work. I guess it's a bug I need to fix.