Solved! Go to Solution.
11-03-2011 11:52 AM - edited 11-03-2011 11:57 AM
CaptureOnly, only tested on sandbox.
<?xml version="1.0" encoding="utf-8"?> <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>LoginID</name> <transactionKey>TranKey</transactionKey> </merchantAuthentication> <refId>myReferenceID</refId> <transactionRequest> <transactionType>captureOnlyTransaction</transactionType> <amount>5</amount> <payment> <creditCard> <cardNumber>4111111111111111</cardNumber> <expirationDate>1113</expirationDate> <cardCode>999</cardCode> </creditCard> </payment> <authCode>6char</authCode> <transactionSettings> <setting> <settingName>allowPartialAuth</settingName> <settingValue>false</settingValue> </setting> <setting> <settingName>duplicateWindow</settingName> <settingValue>0</settingValue> </setting> <setting> <settingName>emailCustomer</settingName> <settingValue>false</settingValue> </setting> <setting> <settingName>recurringBilling</settingName> <settingValue>false</settingValue> </setting> <setting> <settingName>testRequest</settingName> <settingValue>false</settingValue> </setting> </transactionSettings> </transactionRequest> </createTransactionRequest>
11-03-2011 12:40 PM
Easy solution I would think would be to use one of the SDK API's (let's say PHP), only modify the code that actually sends the XML to Authorize.net and have it print it out for you. That way you can generate the XML for any protocol you want and see what it looks like.
I'd go dig through the API and find the right spot to do this, but I have some work to get to.
11-03-2011 12:34 PM
CaptureOnly, only tested on sandbox.
<?xml version="1.0" encoding="utf-8"?> <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>LoginID</name> <transactionKey>TranKey</transactionKey> </merchantAuthentication> <refId>myReferenceID</refId> <transactionRequest> <transactionType>captureOnlyTransaction</transactionType> <amount>5</amount> <payment> <creditCard> <cardNumber>4111111111111111</cardNumber> <expirationDate>1113</expirationDate> <cardCode>999</cardCode> </creditCard> </payment> <authCode>6char</authCode> <transactionSettings> <setting> <settingName>allowPartialAuth</settingName> <settingValue>false</settingValue> </setting> <setting> <settingName>duplicateWindow</settingName> <settingValue>0</settingValue> </setting> <setting> <settingName>emailCustomer</settingName> <settingValue>false</settingValue> </setting> <setting> <settingName>recurringBilling</settingName> <settingValue>false</settingValue> </setting> <setting> <settingName>testRequest</settingName> <settingValue>false</settingValue> </setting> </transactionSettings> </transactionRequest> </createTransactionRequest>
11-03-2011 12:40 PM
Refund
<?xml version="1.0" encoding="utf-8"?> <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>loginID</name> <transactionKey>TranKey</transactionKey> </merchantAuthentication> <refId>myReferenceID</refId> <transactionRequest> <transactionType>refundTransaction</transactionType> <amount>5</amount> <payment> <creditCard> <cardNumber>XXXX1111</cardNumber> <expirationDate>1113</expirationDate> </creditCard> </payment> <refTransId>10digits</refTransId> <transactionSettings> <setting> <settingName>allowPartialAuth</settingName> <settingValue>false</settingValue> </setting> <setting> <settingName>duplicateWindow</settingName> <settingValue>0</settingValue> </setting> <setting> <settingName>emailCustomer</settingName> <settingValue>false</settingValue> </setting> <setting> <settingName>recurringBilling</settingName> <settingValue>false</settingValue> </setting> <setting> <settingName>testRequest</settingName> <settingValue>false</settingValue> </setting> </transactionSettings> </transactionRequest> </createTransactionRequest>
11-03-2011 12:46 PM
11-03-2011 01:05 PM
It seems the SDK does not use the XML API for AIM. Since the others use it I would think they would have that one updated to use it as well. Maybe they have that in store for a future release?
@TJPride wrote:Easy solution I would think would be to use one of the SDK API's (let's say PHP), only modify the code that actually sends the XML to Authorize.net and have it print it out for you. That way you can generate the XML for any protocol you want and see what it looks like.
I'd go dig through the API and find the right spot to do this, but I have some work to get to.
11-03-2011 01:06 PM
Oh, hmm. I guess I got thrown off by this in the shared file:
if (preg_match('/xml/',$post_url)) { curl_setopt($curl_request, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml")); }
Seemed to indicate that XML was being sent at least some of the time. And the documentation seems largely centered around XML protocols. But you're right, the AIM library seems to be constructing a POST string. So much for that idea.
11-03-2011 01:19 PM