Hello, I am trying to test my code in sandbox account. Here is a series of query-response:
First authorize credit card:
request:
<?xml version="1.0" encoding="UTF-8"?> <createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> <merchantAuthentication> <name>XXX</name> <transactionKey>XXX</transactionKey> </merchantAuthentication> <transactionRequest> <transactionType>authOnlyTransaction</transactionType> <amount>10.00</amount> <payment> <creditCard> <cardNumber>5424000000000015</cardNumber> <expirationDate>1220</expirationDate> <cardCode>999</cardCode> </creditCard> </payment> </transactionRequest> </createTransactionRequest>
response:
<?xml version="1.0" encoding="utf-8"?> <createTransactionResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.or/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> <messages> <resultCode>Ok</resultCode> <message> <code>I00001</code> <text>Successful.</text> </message> </messages> <transactionResponse> <responseCode>1</responseCode> <authCode>MF06GN</authCode> <avsResultCode>Y</avsResultCode> <cvvResultCode>P</cvvResultCode> <cavvResultCode>2</cavvResultCode> <transId>2245923274</transId> <refTransID/> <transHash>1DE64B85A48D93892B9CDED9CE586D3B</transHash> <testRequest>0</testRequest> <accountNumber>XXXX0015</accountNumber> <accountType>MasterCard</accountType> <messages> <message> <code>1</code> <description>This transaction has been approved.</description> </message> </messages> </transactionResponse> </createTransactionResponse>
And here everything ok. Then I call capture previously authorized:
request:
<?xml version="1.0" encoding="UTF-8"?> <createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> <merchantAuthentication> <name>XXX</name> <transactionKey>XXX</transactionKey> </merchantAuthentication> <transactionRequest> <transactionType>priorAuthCaptureTransaction</transactionType> <amount>10.00</amount> <refTransId>2245923274</refTransId> </transactionRequest> </createTransactionRequest>
response:
<?xml version="1.0" encoding="utf-8"?> <createTransactionResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.or/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> <messages> <resultCode>Ok</resultCode> <message> <code>I00001</code> <text>Successful.</text> </message> </messages> <transactionResponse> <responseCode>1</responseCode> <authCode>MF06GN</authCode> <avsResultCode>P</avsResultCode> <cvvResultCode/> <cavvResultCode/> <transId>2245923274</transId> <refTransID>2245923274</refTransID> <transHash>1DE64B85A48D93892B9CDED9CE586D3B</transHash> <testRequest>0</testRequest> <accountNumber>XXXX0015</accountNumber> <accountType>MasterCard</accountType> <messages> <message> <code>1</code> <description>This transaction has been approved.</description> </message> </messages> </transactionResponse> </createTransactionResponse>
And here is averything ok. But when I then send refund transaction request:
request:
<?xml version="1.0" encoding="UTF-8"?> <createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> <merchantAuthentication> <name>44r9cD9FxNj</name> <transactionKey>2dC3C28n8843VhzR</transactionKey> </merchantAuthentication> <transactionRequest> <transactionType>refundTransaction</transactionType> <amount>10.00</amount> <payment> <creditCard> <cardNumber>5424000000000015</cardNumber> <expirationDate>1220</expirationDate> <cardCode>999</cardCode> </creditCard> </payment> <refTransId>2245923274</refTransId> </transactionRequest> </createTransactionRequest>
response:
<?xml version="1.0" encoding="utf-8"?> <createTransactionResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.or/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> <messages> <resultCode>Error</resultCode> <message> <code>E00027</code> <text>The transaction was unsuccessful.</text> </message> </messages> <transactionResponse> <responseCode>3</responseCode> <authCode/> <avsResultCode>P</avsResultCode> <cvvResultCode/> <cavvResultCode/> <transId>0</transId> <refTransID>2245923274</refTransID> <transHash>0DEB1569CBFB876F6BFAE1F571DA7594</transHash> <testRequest>0</testRequest> <accountNumber>XXXX0015</accountNumber> <accountType>MasterCard</accountType> <errors> <error> <errorCode>54</errorCode> <errorText>The referenced transaction does not meet the criteria for issuing a credit.</errorText> </error> </errors> </transactionResponse> </createTransactionResponse>
I am getting an error. What does it mean
The referenced transaction does not meet the criteria for issuing a credit
? Where to read about what criteria transaction must meet, and what criteria this transaction does not meet?
Thanks.
12-02-2015 07:52 AM
Hello @s9gf4ult
Your transaction must settle before a refund can be issued. Settlement occurs once every 24 hours after the transaction cut-off time specified in the merchant interface.
For unsettled transactions, use Void which cancels the entire transaction.
Richard
12-02-2015 08:13 AM
Thanks for your answer.
By the way, could you say where can I get xsd shchemas for queries and replies? Or maybe tons of example responses? It would radically simplify my testing scenarios.
12-02-2015 10:42 AM
12-02-2015 04:29 PM