durango / authorize-net-cim

Authorize.net CIM bindings for Node.JS
14 stars 5 forks source link

Changes to XML API #18

Closed thgaskell closed 8 years ago

thgaskell commented 8 years ago

We recently have ran into issues because it seems that the XML API has changed on AuthorizeNet's side. I'm not sure if more changes need to be made to the other projects (durango/authorize-net-types and durango/authorize-net-request)?

It looks like the code responsible for generating the xml needs to be updated to comply with their new api?

http://developer.authorize.net/api/reference

<createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
  <merchantAuthentication>
    <name>API_LOGIN_ID</name>
    <transactionKey>API_TRANSACTION_KEY</transactionKey>
  </merchantAuthentication>
  <refId>123456</refId>
  <transactionRequest>
    <transactionType>authCaptureTransaction</transactionType>
    <amount>5</amount>
    <payment>
      <creditCard>
        <cardNumber>5424000000000015</cardNumber>
        <expirationDate>1220</expirationDate>
        <cardCode>999</cardCode>
      </creditCard>
    </payment>
    <order>
     <invoiceNumber>INV-12345</invoiceNumber>
     <description>Product Description</description>
    </order>
    <lineItems>
      <lineItem>
        <itemId>1</itemId>
        <name>vase</name>
        <description>Cannes logo </description>
        <quantity>18</quantity>
        <unitPrice>45.00</unitPrice>
      </lineItem>
    </lineItems>
    <tax>
      <amount>4.26</amount>
      <name>level2 tax name</name>
      <description>level2 tax</description>
    </tax>
    <duty>
      <amount>8.55</amount>
      <name>duty name</name>
      <description>duty description</description>
    </duty>
    <shipping>
      <amount>4.26</amount>
      <name>level2 tax name</name>
      <description>level2 tax</description>
    </shipping>
    <poNumber>456654</poNumber>
    <customer>
      <id>99999456654</id>
    </customer>
    <billTo>
      <firstName>Ellen</firstName>
      <lastName>Johnson</lastName>
      <company>Souveniropolis</company>
      <address>14 Main Street</address>
      <city>Pecan Springs</city>
      <state>TX</state>
      <zip>44628</zip>
      <country>USA</country>
    </billTo>
    <shipTo>
      <firstName>China</firstName>
      <lastName>Bayles</lastName>
      <company>Thyme for Tea</company>
      <address>12 Main Street</address>
      <city>Pecan Springs</city>
      <state>TX</state>
      <zip>44628</zip>
      <country>USA</country>
    </shipTo>
    <customerIP>192.168.1.1</customerIP>
    <!-- Uncomment this section for Card Present Sandbox Accounts -->
    <!-- <retail><marketType>2</marketType><deviceType>1</deviceType></retail> -->
    <transactionSettings>
      <setting>
        <settingName>testRequest</settingName>
        <settingValue>false</settingValue>
      </setting>
    </transactionSettings>
    <userFields>
      <userField>
        <name>MerchantDefinedFieldName1</name>
        <value>MerchantDefinedFieldValue1</value>
      </userField>
      <userField>
        <name>favorite_color</name>
        <value>blue</value>
      </userField>
    </userFields>
  </transactionRequest>
</createTransactionRequest>
thgaskell commented 8 years ago

After looking into this a little more, it seems like the error might be coming from somewhere else.

I did receive this email from their support team though which suggests using the createTransactionRequest method.

We have not made any changes to the createCustomerProfileTransactionRequest. We actually no longer recommend this method and new development all goes into just createTransactionRequest which can now take profile Ids.

durango commented 8 years ago

Interesting, I'll double check regardless thanks for the heads up.