I'm using the PHP SDK (version 1.1.8) to do an Authorize and Capture.
I'm trying to set the field "currency_code" and get this error:
[15-Mar-2013 08:46:21] PHP Fatal error: Uncaught exception 'AuthorizeNetException' with message 'Error: no field currency_code exists in the AIM API.
To set a custom field use setCustomField('field','value') instead.' in D:\usr\projects\PRCI_pubs\public\pscripts\anet\lib\AuthorizeNetAIM.php:308
A review of the AuthorizeNetAIM class reveals that currency_code is not in the array of $_all_aim_fields.
Is there a reason the currency_code is not implemented in this SDK?
03-15-2013 05:59 AM
Probably because at the time the only currency supported is USD.
03-15-2013 06:25 AM
vmallu, I found the same issue.. looking at the very latest version of the PHP SDK the currency_code field is not there, however the AIM API documentation found here http://developer.authorize.net/guides/AIM/wwhelp/wwhimpl/js/html/wwhelp.htm says this ...
x_currency_code | Optional Value: USD, CAD, or GBP. Format: 3 character string. Notes: If this field is not submitted, the default is the currency selected by the merchant’s payment processor. Setting this field to a currency that is not supported by the payment processor will result in an error. |
There are no timestamps on the documentation... Maybe this is a new addition and is coming soon? Who knows, would be awesome if Auth.Net staff could clarify.
Cheers,
05-16-2013 11:45 PM
the SDK came out over a year ago, and the currency support just about 2 months ago.
05-17-2013 04:10 AM - edited 05-17-2013 04:11 AM
So is the SDK officially supported or not? If so, I'd expect that it would be upgraded to support new features in the API.
What's the fix? I'd like to set the currency_code without changing the sourcecode and without getting the exception. Is there a ->setVarWithoutException() or something?
08-19-2013 01:50 PM
Turns out that you can do:
$txn->verify_x_fields = false;
$txn->currency_code = $product->currency;
$txn->verify_x_fields = true;
08-19-2013 09:59 PM
Hello jshannon,
Setting the currency_code isn't a required field. Each gateway account is configured with a single currency and you cannot overide this using the currency_code. If you attempt to set a currency_code different than the one configured for the gateway, it will return an error.
Sanbox accounts are configured for USD.
Richard
08-21-2013 12:29 PM