Hi @Jeffrey Blattman @David Marginian @Jacob Abrams,
We have integrated the updated clover SDK and passed the external reference Id along with the Sale request using Payment Connector, and it’s working as expected. But when we tried to refund that transaction by using below code we got following exceptions.
Code to send Refund request:
RefundPaymentRequest refund = new RefundPaymentRequest();
refund.setPaymentId(mRefundPayment.getPaymentId());
refund.setOrderId(mRefundPayment.getOrderId());
refund.setFullRefund(mRefundPayment.isFullPayment());
refund.setAmount(10L);
mPaymentConnector.refundPayment(refund);
Exception seen in the Logcat:
02-06 02:50:10.769 680-704/? I/Timeline: Timeline: Activity_windows_visible id: ActivityRecord{11307b85 u0 com.clover.payment.builder.pay/com.clover.payment.common.activities.tasks.PaymentRefundCardNotPresentActivity t34} time:5008269
02-06 02:50:11.738 808-1431/? I/CloverOkHttpClient: execute(CloverOkHttpClient.java:259): Completed method: POST, to URL: https://apisandbox.dev.clover.com/v2/refund, response: 499 (Application error), elapsed time: 1315ms
02-06 02:50:11.745 1598-4005/? E/PaymentRefundCardNotPresentActivity: doInBackground(PaymentRefundCardNotPresentActivity.java:153): refund failed
com.clover.sdk.v1.ServiceException: status code: 500 This refund would make the order's total refunded amount greater than the original order's amount.
at com.clover.sdk.v1.ServiceConnector.throwOnFailure(ServiceConnector.java:329)
at com.clover.sdk.v1.ServiceConnector.execute(ServiceConnector.java:260)
at com.clover.sdk.v3.order.OrderV31Connector.refund2(OrderV31Connector.java:782)
at com.clover.payment.common.activities.tasks.PaymentRefundCardNotPresentActivity$1.doInBackground(PaymentRefundCardNotPresentActivity.java:137)
at com.clover.payment.common.activities.tasks.PaymentRefundCardNotPresentActivity$1.doInBackground(PaymentRefundCardNotPresentActivity.java:40)
at android.os.AsyncTask$2.call(AsyncTask.java:292)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
02-06 02:50:11.746 1598-4005/? E/PaymentRefundCardNotPresentActivity: doInBackground(PaymentRefundCardNotPresentActivity.java:156): This refund would make the
order's total refunded amount greater than the original order's amount.
Note: We have tried with both partial and full refund and also verified the amount and it was less than or equal to the total amount. Also I just want to update you that the same code was working fine earlier. We are testing it in sandbox environment.
Please let us know if we have missed any, also provide the solutions for the same.
Thanks.