PayPal Express Plugin Refund Error

3 years ago
Hi i am using your paypal express plugin and it is working perfect for me but when I am trying to refund from order screen it always giving me error "Transaction refused because of an invalid transaction id value ShortMessage: Invalid transaction id value ErrorCode: 10011"

What should I do to resolve this issue? If transaction id is not valid then how this order was process initially?

Can anyone help me out to resolve this bug?
3 years ago
Adee0614 wrote:
Hi i am using your paypal express plugin and it is working perfect for me but when I am trying to refund from order screen it always giving me error "Transaction refused because of an invalid transaction id value ShortMessage: Invalid transaction id value ErrorCode: 10011"

What should I do to resolve this issue? If transaction id is not valid then how this order was process initially?

Can anyone help me out to resolve this bug?


Would you mention nop version ?
3 years ago
sohel wrote:
Hi i am using your paypal express plugin and it is working perfect for me but when I am trying to refund from order screen it always giving me error "Transaction refused because of an invalid transaction id value ShortMessage: Invalid transaction id value ErrorCode: 10011"

What should I do to resolve this issue? If transaction id is not valid then how this order was process initially?

Can anyone help me out to resolve this bug?

Would you mention nop version ?


I have NopCommerce3.8 right now.
2 years ago
Hi,

i am using nopCommerce 3.80 with paypal express plugin and it is working fine but when I am trying to refund it is giving error see the error here.

Error : "Transaction refused because of an invalid transaction id value ShortMessage: Invalid transaction id value ErrorCode: 10011"

how to resolve this error.

Please help me to resolve this error.
2 years ago
having same issue using nop 3.90, any idea on that?
2 years ago
I have found out the reason for this error. The problem is the plugin has a bug as it is using the authorization transaction ID to issue a refund. This happens when you configured the plugin to use "Authorization" for the "Payment Action". When a new order comes in, it will save the authorization transaction id. When you click Capture on the order, Paypal will capture the money and issue a new capture transaction id back to you. The problem is that Nop is not saving this new capture transaction ID; therefore, when you need to issue a refund later, it will send the old authorization ID to Paypal to issue the refund resulting in wrong transaction id error.

However, if you set "Sale" for the "Payment Action", you do not have this problem because you will receive only a capture transaction id because the money is automatically captured. When you click refund, it will use the correct capture transaction id to issue the refund.
1 year ago
here is the correct code for Capture that will save the transaction ID necessary to refund:

      public CapturePaymentResult Capture(CapturePaymentRequest capturePaymentRequest)
      {
         var customSecurityHeaderType = _payPalSecurityService.GetRequesterCredentials();
         using (var payPalApiaaInterfaceClient = _payPalInterfaceService.GetAAService())
         {
            var doCaptureReq = _payPalRequestService.GetDoCaptureRequest(capturePaymentRequest);
            var response = payPalApiaaInterfaceClient.DoCapture(ref customSecurityHeaderType, doCaptureReq);
            
            return response.HandleResponse(new CapturePaymentResult(),
            (paymentResult, type) =>
            {
               paymentResult.NewPaymentStatus = PaymentStatus.Paid;
               paymentResult.CaptureTransactionResult = response.Ack.ToString();

               var paymentInfoType = type.DoCaptureResponseDetails.PaymentInfo;
               if (paymentInfoType != null)
                  paymentResult.CaptureTransactionId = paymentInfoType.TransactionID;

            },
            (paymentResult, type) =>
            response.Errors.AddErrors(paymentResult.AddError),
            capturePaymentRequest.Order.OrderGuid);
         }
      }