Integration and Testing

Authorize.Net API questions and help with your payment integration.

Posts: 23
Registered: ‎12-02-2010

Best API for Recurring Payment

I am having trouble Refunding a transcation using the AIM API. Here is my code so far using PHP:


$payment = new AuthnetAIM('blah', 'blahblah');
$payment->setTransactionType("CREDIT"); //This is for refunds only
$payment->setTransaction(XXXX1111, 1.00, "$transaction_id");
$payment->setParameter("x_email", $email);
$payment->setParameter("x_email_customer", TRUE); //Enable auto customer email
$payment->setParameter("x_description", "Refund");

 I keep getting an error message saying that the expiration date is required. Any thoughts? In the documentation it says that only the last 4 of the credit card used, amount, and transaction ID are required.

Administrator Administrator
Posts: 563
Registered: ‎08-03-2011

Re: Best API for Recurring Payment


It's likely that this error is because the transaction ID is not being properly set. I see that you are entering it into your code, but you don't appear to be using our SDK so I cannot determine if you are setting it correctly. I would recommend doublechecking the toolkit that you are using.
Posts: 1,609
Topics: 15
Kudos: 209
Solutions: 121
Registered: ‎06-23-2011

Re: Best API for Recurring Payment

Yes, go into your SDK (I'm assuming you're using PHP?) and look in the doc folder for a file called AIM.markdown. It will give you fairly clear code samples for a wide variety of things. If you use some third-party library, nobody is probably going to be able to help.