Hi all,
I'm trying to perform refundTransaction with the below request.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="https://api.authorize.net/xml/v1/schema/AnetApiSchema.xsd"><soapenv:Body><createTransactionRequest ><merchantAuthentication><name>NAME</name><transactionKey>KEY</transactionKey></merchantAuthentication><refId>123456</refId><transactionRequest><transactionType>refundTransaction</transactionType><amount>5.00</amount><payment><creditCard><cardNumber>1111</cardNumber><expirationDate>2018-12</expirationDate></creditCard></payment><refTransId>40009461284</refTransId></transactionRequest></createTransactionRequest></soapenv:Body></soapenv:Envelope>
and I'm getting the following as response
<?xml version="1.0" encoding="utf-8"?><ErrorResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Error</resultCode><message><code>E00004</code><text>The name of the requested API method is invalid.</text></message></messages></ErrorResponse>
could you all please help me where I'm doing it wrong.
Thanks in Advance,
Mohammed Uzair
Solved! Go to Solution.
01-11-2018 06:49 AM
Hi guys,
I've found out the issue. The issue is with xml START_ELEMENT.
Below is the working code
String soapXML = '<?xml version="1.0" ?>'; soapXML += '<createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">'; soapXML += '<merchantAuthentication>'; soapXML += '<name>Name</name>'; soapXML += '<transactionKey>Key</transactionKey>'; soapXML += '</merchantAuthentication>'; soapXML += '<refId>123456</refId>'; soapXML += '<transactionRequest>'; soapXML += '<transactionType>refundTransaction</transactionType>'; soapXML += '<amount>5.00</amount>'; soapXML += '<payment>'; soapXML += '<creditCard>'; soapXML += '<cardNumber>1111</cardNumber>'; soapXML += '<expirationDate>'+ expDate +'</expirationDate>'; soapXML += '</creditCard>'; soapXML += '</payment>'; soapXML += '<refTransId>40009461284</refTransId>'; soapXML += '</transactionRequest>'; soapXML += '</createTransactionRequest>';
01-11-2018 07:39 AM
Hi guys,
I've found out the issue. The issue is with xml START_ELEMENT.
Below is the working code
String soapXML = '<?xml version="1.0" ?>'; soapXML += '<createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">'; soapXML += '<merchantAuthentication>'; soapXML += '<name>Name</name>'; soapXML += '<transactionKey>Key</transactionKey>'; soapXML += '</merchantAuthentication>'; soapXML += '<refId>123456</refId>'; soapXML += '<transactionRequest>'; soapXML += '<transactionType>refundTransaction</transactionType>'; soapXML += '<amount>5.00</amount>'; soapXML += '<payment>'; soapXML += '<creditCard>'; soapXML += '<cardNumber>1111</cardNumber>'; soapXML += '<expirationDate>'+ expDate +'</expirationDate>'; soapXML += '</creditCard>'; soapXML += '</payment>'; soapXML += '<refTransId>40009461284</refTransId>'; soapXML += '</transactionRequest>'; soapXML += '</createTransactionRequest>';
01-11-2018 07:39 AM