RefundPaymentRequest refund = new RefundPaymentRequest();
refund.setPaymentId(payment.getId());
refund.setOrderId(payment.getOrder().getId());
refund.setFullRefund(true);
paymentConnector.initializeConnection();
paymentConnector.refundPayment(refund);
Response of above request is as follow :
RefundPaymentResponse{json='{"message":"Payment to refund could not be found for paymentId: M5B1GPDX85CHY","success":false,"result":"ERROR","refund":null}', bundle=null, changeLog=Bundle[{success=null, refund=null, result=null, message=null}]}
always first time in a day , I am getting success response. but after that I am getting "message":"Payment to refund could not be found for paymentId:PAYMENT_ID"
FYI : I'm using Clover mini C-300