I'm getting an error when I try a eCheck transaction using AIM.
I get the following XML Error
<?xml version="1.0" encoding="utf-8"?> <ErrorResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> <messages> <resultCode>Error</resultCode> <message> <code>E00003</code> <text>The element 'bankAccount' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'accountNumber' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'accountType, routingNumber' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.</text> </message> </messages> </ErrorResponse>
Here is my XML I'm submitting
<?xml version="1.0"?> <createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> <merchantAuthentication> <name>########</name> <transactionKey>###############</transactionKey> </merchantAuthentication> <refId/> <transactionRequest> <transactionType>authCaptureTransaction</transactionType> <amount>4.99</amount> <payment> <bankAccount> <accountNumber>123456789</accountNumber> <routingNumber>071921891</routingNumber> <nameOnAccount>Jerrod Davenport</nameOnAccount> <bankName>PNC</bankName> <echeckType>WEB</echeckType> </bankAccount> </payment> <customer> <id/> <email>jerrod@gmail.com</email> </customer> <transactionSettings> <setting> <settingName>testRequest</settingName> <settingValue>false</settingValue> </setting> </transactionSettings> <userFields> <userField> <name>Membership ID</name> <value>12</value> </userField> </userFields> </transactionRequest> </createTransactionRequest>
I don't see anything wrong with the code, but I guess there is. Any help?
Thank you in advance.
Solved! Go to Solution.
12-28-2011 07:00 AM
Same as ARB XML, sequence matter, follow the xml I posted earlier.
12-28-2011 11:01 AM
The xml pdf probably is outdated. This is from the schema added 2 new fields and changed the seq
<bankAccount> <accountType>checking,savings,businessChecking</accountType> <routingNumber></routingNumber> <accountNumber></accountNumber> <nameOnAccount></nameOnAccount> <echeckType></echeckType> <bankName></bankName> <checkNumber></checkNumber> </bankAccount>
12-28-2011 07:25 AM
Check number is required for echecks using WEB type?
12-28-2011 07:45 AM
Only required for ARC or BOC type
12-28-2011 07:50 AM
Still getting an error. The type is WEB as it is a transaction over the web for a subscription which will be billed first by AIM method. I can not find out where the problem is. I do not understand the error as I have the required fields.
I'll display my code, Sent XML, and the Response XML
Code
require('authorize/testing/config.inc.php');
require('authorize/testing/AuthnetXML.class.php');
$xml = new AuthnetXML(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetXML::USE_DEVELOPMENT_SERVER);
$xml->createTransactionRequest(array(
'refId' => $userid,
'transactionRequest' => array(
'transactionType' => 'authCaptureTransaction',
'amount' => $membership_amount,
'payment' => array(
'bankAccount' => array(
'accountNumber' => $account,
'routingNumber' => $routing,
'nameOnAccount' => $nameonaccount,
'bankName' => $bankname,
'accountType' => $frm_banktype,
'echeckType' => 'WEB',
),
),
'customer' => array(
'id' => $userid,
'email' => $email,
),
'transactionSettings' => array(
'setting' => array(
'settingName' => 'allowPartialAuth',
'settingValue' => 'false',
),
'setting' => array(
'settingName' => 'duplicateWindow',
'settingValue' => '0',
),
'setting' => array(
'settingName' => 'emailCustomer',
'settingValue' => 'false',
),
'setting' => array(
'settingName' => 'recurringBilling',
'settingValue' => 'false',
),
'setting' => array(
'settingName' => 'testRequest',
'settingValue' => 'false',
),
),
'userFields' => array(
'userField' => array(
'name' => 'CustomerID',
'value' => $userid,
),
'userField' => array(
'name' => 'Membership ID',
'value' => $membership,
),
),
),
));
Sent XML
<?xml version="1.0"?> <createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> <merchantAuthentication> <name>47V4Uej6</name> <transactionKey>95r933WDW6mb75fQ</transactionKey> </merchantAuthentication> <refId>109728</refId> <transactionRequest> <transactionType>authCaptureTransaction</transactionType> <amount>9.99</amount> <payment> <bankAccount> <accountNumber>123456789</accountNumber> <routingNumber>071921891</routingNumber> <nameOnAccount>asddd</nameOnAccount> <bankName>asd</bankName> <accountType>checking</accountType> <echeckType>WEB</echeckType> </bankAccount> </payment> <customer> <id>109728</id> <email>jerrod.davenport@gmail.com</email> </customer> <userFields> <userField> <name>Membership ID</name> <value>14</value> </userField> </userFields> </transactionRequest> </createTransactionRequest>
Response XML
<?xml version="1.0" encoding="utf-8"?> <ErrorResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> <messages> <resultCode>Error</resultCode> <message> <code>E00003</code> <text>The element 'bankAccount' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'accountNumber' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'accountType, routingNumber' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.</text> </message> </messages> </ErrorResponse>
12-28-2011 10:57 AM
Same as ARB XML, sequence matter, follow the xml I posted earlier.
12-28-2011 11:01 AM
That corrected the problem! Thank you so much!
12-28-2011 12:19 PM