Open suneel11 opened 5 years ago
Hi @suneel11 ,
Thanks for reaching out to us.
After you've made a transaction, the transaction can be in Unsettled or Settled state.
For canceling an Unsettled transaction, you can void it. This can be done in one of three ways:
Void Transaction
API request.For canceling a Settled transaction, you can refund it. This can be done in one of three ways:
Refund Transaction
API request.Kindly let us know if you need further information.
I am getting an issue with the settled transactions for the refund while sending the transaction id in refTransID, please check and help me with the issue:
[0] => net\authorize\api\contract\v1\TransactionResponseType\ErrorsAType\ErrorAType Object (
[errorCode:net\authorize\api\contract\v1\TransactionResponseType\ErrorsAType\ErrorAType:private] => 54
[errorText:net\authorize\api\contract\v1\TransactionResponseType\ErrorsAType\ErrorAType:private] => The referenced transaction does not meet the criteria for issuing a credit.
)
Thanks.
Hi @suneel11 ,
Well, error code 54 can have different reasons (Error Response 54). Are you sure the transaction ID you placed in the refTransId is the same transaction ID you got from our servers?
Or maybe the transaction has not been settled yet? I would need to understand the timeline for your requests to check if the transaction has settled or not.
The status for the transaction is settled payment and its money has been settled. And the transaction is generated from your servers only i.e: 11 digit number. Everything is good just the refund api is creating the problem while refunding settled transaction.
Is it possible to share the request sent for RefundTransaction API ? You can hide all sensitive information, like credit card information, dates, keys, etc.
Here it is, I am working with the laravel framework
$merchantAuthentication = new AnetAPI\MerchantAuthenticationType(); $merchantAuthentication->setName(env("ANET_LOGIN_KEY")); $merchantAuthentication->setTransactionKey(env("ANET_TRANSACTION_KEY"));
$refId = 'ref' . time();
$creditCard = new AnetAPI\CreditCardType(); $creditCard->setCardNumber($cardNo); $creditCard->setExpirationDate($expDate); $payOne = new AnetAPI\PaymentType(); $payOne->setCreditCard($creditCard);
$tranRequest = new AnetAPI\TransactionRequestType(); $tranRequest->setTransactionType( "refundTransaction"); $tranRequest->setAmount('5.00'); $tranRequest->setPayment($payOne); $tranRequest->setRefTransId($t_tranId);
$req = new AnetAPI\CreateTransactionRequest(); $req->setMerchantAuthentication($merchantAuthentication); $req->setRefId($refId); $req->setTransactionRequest( $tranRequest); $contr = new AnetController\CreateTransactionController($req); $respo = $contr->executeWithApiResponse( \net\authorize\api\constants\ANetEnvironment::PRODUCTION);
Thanks
This seems correct. Perhaps there's something wrong with the original transaction. Is it possible to share the transaction details of the original transaction? If you want a secure way of sending, please feel free to send it to my personal email: jus4me2009@gmail.com.
Hi @suneel11
Can you help me with a few questions:
$cardNo
and $expDate
Hello @ashtru
I am using the values in this format: $cardNo = '4242424242424242' $expDate = YYYY-MM format (2022-11)
Even if I am using the 4 digits card number and date with YYMM format then also it is providing me the same issue.
Thanks.
Hi @suneel11 ,
From the information you shared, I see that you are using v1.9.6 of the SDK.
The latest stable version is v1.9.9. Is it possible for you to test this out with the latest version?
Does the old version do not support the refund api and if so then how it can be done in the older version.
hello there is there any help for me regarding that.
Hi @suneel11
If a transaction is in unsettled state you need to do a Void Transaction API request. And if the transaction is in settled state you need to do a Refund Transaction API request.
As per your original issue you were trying to do a refund of a unsettled transaction, hence you were getting Transaction Response Code 54 (the transaction does not meet the criteria). Now the next day the transaction state changed to settled as per your comment, so you will not be able to void it anymore, but you can now call the Refund API till 120 days from the date of settlement.
Hope this resolves your issue.
Kaushik
hello But why i am not able to refund the settled transaction whose payment has been done
hello @kikmak42
I am still waiting for your reply that why I am not able to refund the transaction whose payment has beed confirmed or has been settled.
Hello, can anyone help me with the issue for how can I refund the unsettled transactions which are not currently refundable. Or the void can help me to refund back the amount charged for particular transaction. Please help me with that as I am making the payment from the card and I want to refund the amount even when the transaction is unsettled.
Thanks.