Reply
Contributor
Posts: 41
Registered: ‎09-30-2011
Accepted Solution

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?


Accepted Solutions
Solution
Accepted by topic author Wstar
‎08-21-2015 01:58 AM
Posts: 1,476
Topics: 33
Kudos: 34
Solutions: 126
Registered: ‎09-14-2009

Re: AIM - PHP - Description

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


All Replies
Posts: 1,476
Topics: 33
Kudos: 34
Solutions: 126
Registered: ‎09-14-2009

Re: AIM - PHP - Description

[ Edited ]

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
Contributor
Posts: 41
Registered: ‎09-30-2011

Re: AIM - PHP - Description

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(

 

Solution
Accepted by topic author Wstar
‎08-21-2015 01:58 AM
Posts: 1,476
Topics: 33
Kudos: 34
Solutions: 126
Registered: ‎09-14-2009

Re: AIM - PHP - Description

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
Contributor
Posts: 41
Registered: ‎09-30-2011

Re: AIM - PHP - Description

Thank you for the help!

Posts: 1,609
Topics: 15
Kudos: 201
Solutions: 121
Registered: ‎06-23-2011

Re: AIM - PHP - Description

[ Edited ]

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.