question

kapilk avatar image
kapilk asked David Marginian Deactivated edited

Refund for split custom amount using PaymentConnector in Clover station

Hi, @David Marginian

Reg: Multiple refund payment requests for different payment ids under same order id.

I am trying to refund for split custom amount transactions using PaymentConnector in clover station. My code will trigger refundPayment request in a loop for all split transactions. But only partial refund happened and considering only first request. Please check below code snippet and attached the image.

Can't we initiate multiple refundPayment requests in a loop ?
Can we initiate next refundPayment request in the queue only after prior request returns response ? I mean, next refundPayment request in queue can be initiated in below handler ?

public void onRefundPaymentResponse(RefundPaymentResponse response) {}


screen-shot-2021-12-29-at-61311-pm.png


// model for split custom transaction details like paymentId and orderId
class CloverRefundModel { 
    private String paymentId;
    private String orderId; // and getters methods
}

CloverRefundModel[] mRefundModelList // is an array of CloverRefundModel objects

for (CloverRefundModel refundModel : mRefundModelList) {
    RefundPaymentRequest refund = new RefundPaymentRequest();
    refund.setPaymentId(refundModel.getPaymentId());
    refund.setOrderId(refundModel.getOrderId());
    refund.setFullRefund(true);
    mPaymentConnector.refundPayment(refund);
}




Clover Android SDKSandboxClover StationPaymentConnectorRefund
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
David Marginian avatar image
David Marginian Deactivated answered David Marginian Deactivated edited

I don't quite understand your post, but no, you can't make refund requests in a loop. These are card present transaction requests being made to the device (which can only process 1 transaction at a time), the first one needs to be complete before you can initiate the second one.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community