I'm having diffuculkties trying to display the description for an AIM transaction. I have read the AIM Guild and was getting confused. Is the "Description" tag used by itself, like "amount"?
Here is my code for the transaction. I've tried moving the "Description" tag around and I keep getting a child element error.
$xml->ARBCreateSubscriptionRequest(array( 'refId' => $userid, 'subscription' => array( 'name' => $membership_name, 'paymentSchedule' => array( 'interval' => array( 'length' => '1', 'unit' => 'months' ), 'startDate' => $date_next_month, 'totalOccurrences' => '9999', ), 'amount' => $membership_amount, 'Description' => $membership_name, 'payment' => array( 'bankAccount' => array( 'accountType' => $frm_banktype, 'routingNumber' => $routing, 'accountNumber' => $account, 'nameOnAccount' => $nameonaccount, 'echeckType' => 'WEB', 'bankName' => $bankname ), ), 'billTo' => array( 'firstName' => $firstname, 'lastName' => $lastname, 'address' => $address, 'city' => $city, 'zip' => $zip ) ) )); // END $xml->ARBCreateSubscriptionRequest(array(
Would this be correct?
Solved! Go to Solution.
01-03-2012 08:48 AM
That looks good to me! :)
01-03-2012 09:26 AM
That is incorrect. You're using the ARB API to make a call to the AIM API. Obviously that won't work.
According to the example in the AIM XML announcement and in the XML guide, it doesn't look like there is a field for a general description for the entire order available in the XML schema. There are only item based descriptions available. It looks like the original name value pairs API still allows for a description though.
01-03-2012 09:06 AM - edited 01-03-2012 09:07 AM
So Sorry, I copied the wrong code :)
So, I have to add a lineItem in order to have a description. Like this?
$xml->createTransactionRequest(array( 'refId' => $userid, 'transactionRequest' => array( 'transactionType' => 'authCaptureTransaction', 'amount' => $payment_price, 'Description' => $membership_name, 'payment' => array( 'bankAccount' => array( 'accountType' => $frm_banktype, 'routingNumber' => $routing, 'accountNumber' => $account, 'nameOnAccount' => $nameonaccount, 'echeckType' => 'WEB', 'bankName' => $bankname ), ), 'lineItems' => array( 'lineItem' => array( 'itemId' => $membership, 'name' => $membership_name, 'description' => $membership_description, 'quantity' => '1', 'unitPrice' => $payment_price ), ), 'customer' => array( 'id' => $userid, 'email' => $email, ), 'billTo' => array( 'firstName' => $firstname, 'lastName' => $lastname, 'address' => $address, 'city' => $city, 'zip' => $zip, ), 'transactionSettings' => array( 'setting' => array( 'settingName' => 'allowPartialAuth', 'settingValue' => 'false', ), 'setting' => array( 'settingName' => 'duplicateWindow', 'settingValue' => '0', ), 'setting' => array( 'settingName' => 'emailCustomer', 'settingValue' => 'true', ), '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, ), ), ), )); // END $xml->createTransactionRequest(array(
01-03-2012 09:22 AM
That looks good to me! :)
01-03-2012 09:26 AM
Thank you for the help!
01-03-2012 12:39 PM
Wrong, there is a field for description. This is the first part of the createTransactionRequest example in the AIM XML guide:
<?xml version="1.0" encoding="utf-16"?> <createTransactionRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> <merchantAuthentication> <name>bvt_[L2x</name> <sessionToken>gAc9F$cY0VRqpzLLlfhWdhQYR9WWLxhUvnXWSE9ffqkA</session Token> <mobileDeviceId>mpldf58693</mobileDeviceId> </merchantAuthentication> <transactionRequest> <transactionType>authCaptureTransaction</transactionType> <amount>10.00</amount> <payment> <creditCard> <cardNumber>5424000000000015</cardNumber> <expirationDate>0511</expirationDate> <cardCode>123</cardCode> </creditCard> </payment> <order> <invoiceNumber>INV001</invoiceNumber> <description>Really nice things!</description>
</order>
It's also clearly mentioned in the regular PHP API documentation, and I've used it myself through that.
01-03-2012 12:40 PM - edited 01-03-2012 12:40 PM