I've been going round and round trying to figure out why my credits won't process properly. I keep getting an incorrect card number message despite what I use. I know I have the right number and I've submitted it as both 'XXXX0000' as well as '0000'. I tried both ways because I've found conflicting information on this forum. I wish I had a good PHP example to follow since there might be something I'm missing. I'm not sure why the downloadable sample only has VOID as a refund example and not a more inclusive refund and partial refund example.
Here's the first part of my code:
if ($METHOD_TO_USE == "AIM") {
$transaction = new AuthorizeNetAIM;
$transaction->setSandbox(AUTHORIZENET_SANDBOX);
$transaction->setFields(
array(
'trans_id'=> $confcode,
'amount'=> $refund,
'card_num'=> $ccnum, //currently set for last 4 digits only
'type' => "CREDIT",
)
);
$response = $transaction->authorizeAndCapture();
if ($response->approved) {...
Is that the correct way to start the refund process? Any idea why I might be getting the card number error?
Thank you in advance,
Don
07-11-2011 08:24 PM
Shouldn't it be
$response = $transaction->credit();
07-12-2011 04:29 AM
Thank you, that was it. I appreciate the help.
It would have been great to have that in a sample php with the sample application.
07-12-2011 08:40 AM