Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refund Unsettled Transactions #354

Open
suneel11 opened this issue Dec 6, 2018 · 15 comments
Open

Refund Unsettled Transactions #354

suneel11 opened this issue Dec 6, 2018 · 15 comments
Labels
help-wanted Developer Inquiry on usage and installation

Comments

@suneel11
Copy link

suneel11 commented Dec 6, 2018

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.

@gnongsie
Copy link
Contributor

gnongsie commented Dec 7, 2018

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:

  • Sending a Void Transaction API request.
  • Going to the Merchant Interface, searching for your unsettled transaction and voiding the transaction there.
  • Going to the Merchant Interface and creating a Void Transaction from the Virtual Terminal.

For canceling a Settled transaction, you can refund it. This can be done in one of three ways:

  • Sending a Refund Transaction API request.
  • Going to the Merchant Interface, searching for your unsettled transaction and refunding the transaction there.
  • Going to the Merchant Interface and creating a Refund Transaction from the Virtual Terminal.

Kindly let us know if you need further information.

@suneel11
Copy link
Author

suneel11 commented Dec 7, 2018

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.

@gnongsie
Copy link
Contributor

gnongsie commented Dec 9, 2018

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.

@suneel11
Copy link
Author

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.

@gnongsie
Copy link
Contributor

Is it possible to share the request sent for RefundTransaction API ? You can hide all sensitive information, like credit card information, dates, keys, etc.

@suneel11
Copy link
Author

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

@gnongsie
Copy link
Contributor

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.

@ashtru
Copy link
Contributor

ashtru commented Dec 11, 2018

Hi @suneel11

Can you help me with a few questions:

  1. How are you getting the value of $cardNo and $expDate
  • For card number, is it the last 4 digits, or the entire card number?
  • What is the format for the expiration date YYMM or YYYY-MM?

@ashtru ashtru added the help-wanted Developer Inquiry on usage and installation label Dec 11, 2018
@suneel11
Copy link
Author

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.

@gnongsie
Copy link
Contributor

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?

@suneel11
Copy link
Author

Does the old version do not support the refund api and if so then how it can be done in the older version.

@suneel11
Copy link
Author

hello there is there any help for me regarding that.

@kikmak42
Copy link
Contributor

kikmak42 commented Jan 3, 2019

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

@suneel11
Copy link
Author

suneel11 commented Jan 3, 2019

hello
But why i am not able to refund the settled transaction whose payment has been done

@suneel11
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help-wanted Developer Inquiry on usage and installation
Development

No branches or pull requests

5 participants
@kikmak42 @gnongsie @ashtru @suneel11 and others