cancel
Showing results for 
Search instead for 
Did you mean: 

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 Authorize.net auto customer email
$payment->setParameter("x_description", "Refund");
$payment->process();

 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.

three3
Contributor
2 REPLIES 2

 

Hi,
 
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.
 
Thanks,
Joy
Joy
Administrator Administrator
Administrator

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.

TJPride
Expert