Showing results for 
Search instead for 
Did you mean: 

Refunds etc in new API

So the XML-based API is supposed to be ready for prime time and that's what we should be using for new development?


I could be up for that and for retrofitting it, BUT...


I was more than a little surprised when installing per instructions put almost 4,200 files (and 25 MB) on my server to support what a little digging shows can be done in a couple of dozen lines of code or less per type of operation, probably less on average taking overlap into account.  IOW minimal change.  That's to get from input-array to output-array sandwiching actual execution of the transaction.  A guy sure can't tell that from a first look at the dox, though.


Even after (or because of) all that, there were unresolved dependencies and the sample code was dying on yaml.  It seems this general approach to installation and configuration would become a chronic source of inherent fragility and even vulnerability to deliberate sabotage.


So now I'm just embedding a curl connection pretty close to what my existing code base uses, merely spouting and digesting XML instead of the old format. 


If I'm not supposed to be using the new stuff yet for production work, then where can I find the docs and examples for old-style ARB and TD not dependent on adapters to the new schema?


Now about the refunds in my title:  I copied the example request verbatim.  (That part of the documentation seems a vast improvement over the past, quite an elegant little digest.)


<createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">

But I plugged in real live everything for a recently settled transaction.


Here's what I get: back:

<?xml version="1.0" encoding="utf-8"?>
<createTransactionResponse xmlns:xsi="" xmlns:xsd="" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
			<text>The transaction was unsuccessful.</text>
		<authCode />
		<cvvResultCode />
		<cavvResultCode />
				<errorText>Invoice Number is required.</errorText>
				<errorText>Description is required.</errorText>
				<errorText>Customer ID is required.</errorText>
				<errorText>Bill To First Name is required.</errorText>
				<errorText>Bill To Last Name is required.</errorText>
				<errorText>Bill To Address is required.</errorText>
				<errorText>Bill To City is required.</errorText>
				<errorText>Bill To State/Province is required.</errorText>
				<errorText>Bill To Zip/Postal Code is required.</errorText>
				<errorText>Bill To Country is required.</errorText>
				<errorText>Phone is required.</errorText>
				<errorText>Email is required.</errorText>

(Transaction-specific return data changed to 9999s)


What's going on?  I've tried providing some of that information, but then it complains about the enclosing elements.  It's almost like it's not recognizing this as a refund request.  But surely the feature must work or it would have come to light already.  So what do I need to do?


Having now put my client on notice of the need to implement a new protocol to get new functionality they have requested/demanded, I'm reluctant to backtrack.  But the main thing is to have refunds, subscriptions, and transaction detail functioning by Wednesday AM, so I'll do it the old way if that gets there faster.


ok richards got it. 


Now i have another question regarding void. I have used void for cancellation of any order and its working fine. now i have 1 question regarding refunding of money. after void do i have to again call refund transaction or authorize will directly refund money?



You would issue a Void or a Refund, but not both.


Void is used to cancel an entire transaction before it settles.  Settlement occurs once a day starting after the transaction cut-off time.  


A refund is used to return an amount less than or equal to the original authorization but must be done after the transaction settles.



Ya Rechard i understood that. My question is that suppose i have place order of amount 10$. when i placed order 10$ would be deducted from my account. now if i cancel the order(which is not yet settled). will i get money back in my account with void API?