Details
-
Type: Bug
-
Status: Closed
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 3.4.3
-
Fix Version/s: 3.6.0
-
Component/s: None
-
Labels:None
Description
Someone inquired with PayPal regarding failed refunds due to an "Internal Error". The reply was:
"Thank you for contacting PayPal Merchant Technical Service.
Internal error usually occurs if there are wrong variables passed in the
API call or if there are any intermittent issue at PayPal's end during
the time of transaction.
Looking into your API requests, I can see that you are trying to make a
partial refund for this transaction: 8P5262567W398632Yfor an amount of :
2.50 USD. However, looking into the transaction, I noticed that, the
total amount received for that transaction is 2. 50 USD. In that case,
if you are going to make a partial refund it has be to for an amount
lesser than 2.50 USD.
However, if you are going to make a full refund, you need to pass the
REFUNDTYPE =Full and you do not need to set an AMT value for it.
You may refer to this documentation on how RefundTransaction API is done :
https://developer.paypal.com/docs/classic/api/merchant/RefundTransaction_API_Operation_NVP/
Do get back to us if the issue still occurs. Thank you"
It appears PayPal is not able to distinguish a full amount from a partial amount except to refuse the refund as an internal error based on the REFUNDTYPE.
I suggest updating the PayPal Payments Standard gateway to fetch the associated transaction in ::refund to determine whether the given amount is the full transaction amount, and setting the REFUNDTYPE as FULL or PARTIAL accordingly.
Blesta currently only allows full refunds, so we should be able to simply set FULL as the type, right? Is an amount even needed then?