cancel
Showing results for 
Search instead for 
Did you mean: 

AIM - PHP - Description

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?

Wstar
Contributor
1 ACCEPTED SOLUTION

Accepted Solutions

That looks good to me! :)


-------------------------------------------------------------------------------------------------------------------------------------------
John Conde :: Certified Authorize.Net Developer (Brainyminds) :: Official Authorize.Net Blogger

NEW! Handling Authorize.Net's Webhooks with PHP

Integrate Every Authorize.Net JSON API with One PHP Class (Sample code included)

Tutorials for integrating Authorize.Net with PHP: AIM, ARB, CIM, Silent Post
All About Authorize.Net's Silent Post

View solution in original post

5 REPLIES 5

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.

 

 


-------------------------------------------------------------------------------------------------------------------------------------------
John Conde :: Certified Authorize.Net Developer (Brainyminds) :: Official Authorize.Net Blogger

NEW! Handling Authorize.Net's Webhooks with PHP

Integrate Every Authorize.Net JSON API with One PHP Class (Sample code included)

Tutorials for integrating Authorize.Net with PHP: AIM, ARB, CIM, Silent Post
All About Authorize.Net's Silent Post
stymiee
Expert
Expert

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(

 

That looks good to me! :)


-------------------------------------------------------------------------------------------------------------------------------------------
John Conde :: Certified Authorize.Net Developer (Brainyminds) :: Official Authorize.Net Blogger

NEW! Handling Authorize.Net's Webhooks with PHP

Integrate Every Authorize.Net JSON API with One PHP Class (Sample code included)

Tutorials for integrating Authorize.Net with PHP: AIM, ARB, CIM, Silent Post
All About Authorize.Net's Silent Post

Thank you for the help!

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.