zen4ever / django-authorizenet

Django and Authorize.NET payment gateway integration
MIT License
87 stars 36 forks source link

CreateTransactionRequest not works for 'void' type of transaction (CIM api). #12

Closed piterimov closed 12 years ago

piterimov commented 12 years ago

CreateTransactionRequest require 'amount' parameter for all type of transactions. As described here http://www.authorize.net/support/CIM_XML_guide.pdf 'amount' not needed for 'void' transaction. But CreateTransactionRequest create '<amount>...</amount>' tags for 'void' also. Because of this, authorize.net return the error message:

"The element 'profileTransVoid' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'amount' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'customerProfileId, customerPaymentProfileId, customerShippingAddressId, transId' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd" . And transaction doesn't pass.

zen4ever commented 12 years ago

Could you please try this fix in the branch 'ticket12' and see if it works for you?

piterimov commented 12 years ago

Yes, it works great. Only need to correct the typo in line 697 if amount and self.transaction_type != "Void": from amount to self.amount and it will work fine.

Thank you!