Note that there are some explanatory texts on larger screens.

plurals
  1. POcannot get lineitems to work in Authorized.net xml createTransactionRequest
    primarykey
    data
    text
    <p>I am trying to take info out of a mysql table and insert it into the createTransactionRequest array to show the lineitems in the email. When I do this and echo it on on the page it looks like it should but it keeps giving me an error. If I remove the array ( $lineitem ) I create it goes through fine. I feel I am inserting this wrong or its just not possible to do this the way I am trying to do it. Hoping someone with more experience in this can help me figure it out.</p> <p>I create the array like this.</p> <pre><code>while($r = mysql_fetch_array($cartitems)) { $lineitem[] = array('itemId' =&gt; ''.$r['itemid'].'','name' =&gt; ''.$r['productname'].'','description' =&gt; ''.$r['productdescription'].'','quantity' =&gt; '1','unitPrice' =&gt; ''.$price.''); } </code></pre> <p>Then I plug it into the array like this..</p> <pre><code>$xml-&gt;createTransactionRequest(array( 'refId' =&gt; rand(1000000, 100000000), 'transactionRequest' =&gt; array( 'transactionType' =&gt; 'authCaptureTransaction', 'amount' =&gt; 45.00, 'payment' =&gt; array( 'creditCard' =&gt; array( 'cardNumber' =&gt; '4111111111111111', 'expirationDate' =&gt; '122015', 'cardCode' =&gt; '123', ), ), 'order' =&gt; array( 'invoiceNumber' =&gt; '123123', 'description' =&gt; 'Purchase from website', ), 'lineItems' =&gt; array( 'lineItem' =&gt; $lineitem ), 'poNumber' =&gt; '123123321', 'customer' =&gt; array( 'id' =&gt; 123, 'email' =&gt; email@website.com, ), 'billTo' =&gt; array( 'firstName' =&gt; $firstname, 'lastName' =&gt; $lastname, 'address' =&gt; $address, 'city' =&gt; $city, 'state' =&gt; $state, 'zip' =&gt; $zipcode, 'country' =&gt; 'USA', ), 'customerIP' =&gt; 12-12-12-1234, 'transactionSettings' =&gt; array( 'setting' =&gt; array( 0 =&gt; array( 'settingName' =&gt;'allowPartialAuth', 'settingValue' =&gt; 'false' ), 1 =&gt; array( 'settingName' =&gt; 'duplicateWindow', 'settingValue' =&gt; '0' ), 2 =&gt; array( 'settingName' =&gt; 'emailCustomer', 'settingValue' =&gt; 'true' ), 3 =&gt; array( 'settingName' =&gt; 'recurringBilling', 'settingValue' =&gt; 'false' ), 4 =&gt; array( 'settingName' =&gt; 'testRequest', 'settingValue' =&gt; 'false' ) ) ), ), )); </code></pre> <p>---------------editing below, showing output from print----------------</p> <pre><code>Array ( [refId] =&gt; 90801855 [transactionRequest] =&gt; Array ( [transactionType] =&gt; authCaptureTransaction [amount] =&gt; 31.41 [payment] =&gt; Array ( [creditCard] =&gt; Array ( [cardNumber] =&gt; 4111111111111111 [expirationDate] =&gt; 042012 [cardCode] =&gt; 123 ) ) [order] =&gt; Array ( [invoiceNumber] =&gt; 1360116011 [description] =&gt; Purchase from website ) [lineItems] =&gt; Array ( [lineItem] =&gt; Array ( [0] =&gt; Array ( [itemId] =&gt; 1 [name] =&gt; item one title [description] =&gt; item one description [quantity] =&gt; 1 [unitPrice] =&gt; 19.90 ) [1] =&gt; Array ( [itemId] =&gt; 4 [name] =&gt; item 4 title [description] =&gt; item 4 description -- [quantity] =&gt; 1 [unitPrice] =&gt; 15.00 ) ) ) [poNumber] =&gt; 22 [customer] =&gt; Array ( [id] =&gt; 2 [email] =&gt; email@website.com ) [billTo] =&gt; Array ( [firstName] =&gt; john [lastName] =&gt; smith [address] =&gt; 132 addy here lane [city] =&gt; foxboro [state] =&gt; MA [zip] =&gt; 01955 [country] =&gt; USA ) [customerIP] =&gt; 12.123.123.123 [transactionSettings] =&gt; Array ( [setting] =&gt; Array ( [0] =&gt; Array ( [settingName] =&gt; allowPartialAuth [settingValue] =&gt; false ) [1] =&gt; Array ( [settingName] =&gt; duplicateWindow [settingValue] =&gt; 0 ) [2] =&gt; Array ( [settingName] =&gt; emailCustomer [settingValue] =&gt; true ) [3] =&gt; Array ( [settingName] =&gt; recurringBilling [settingValue] =&gt; false ) [4] =&gt; Array ( [settingName] =&gt; testRequest [settingValue] =&gt; false ) ) ) ) ) </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload