question

kirank avatar image
kirank asked David Marginian Deactivated commented

Refund with Tip

I'm trying to understand the expected working model.

Our requirement was: Using Payment connector, if a Payment (SaleResponse) contained a tip added, refund Object (RefundPaymentResponse) returned from SDK should contain the original tip amount as well.

What we are doing:
onSaleResponse:
Payment _payment = saleResponse.getPayment();
tip = _payment.getTipAmount() == null ? 0 : _payment.getTipAmount();

onRefundPaymentResponse:
Refund refundObj = refundResponse.getRefund();
long tip = refundObj.getTipAmount() == null ? 0 : refundObj.getTipAmount();

We have confirmed tip onSale is correct.

We think refundObj.getTipAmount() is returning null/0.
Is this the right place to check for tip refunded?

Other details: Sandbox, US on Flex device.



PaymentConnector
10 |2000

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

David Marginian avatar image
David Marginian Deactivated answered
This is a bug. I will create an internal issue.
10 |2000

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

kirank avatar image
kirank answered
Couple of data points.
1. Any ETA or recommended workaround? This seems fairly basic problem?
2. Just to complete here is the full refund response from the onRefundResponse object
{
	"success": true,
	"result": "SUCCESS",
	"message": null,
	"refund": {
		"amount": 4655,
		"taxAmount": null,
		"payment": {
			"id": "A803914TVPE96"
		},
		"id": "41GBTWZ50DREA",
		"employee": {
			"id": "3Z4QPVN70HC5E"
		},
		"createdTime": 1571153170513,
		"clientCreatedTime": 1571153170513,
		"voided": false,
		"device": {
			"id": "2d1ee4d2-******* b8744e2e89c8"
		}
	}
}
10 |2000

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

David Marginian avatar image
David Marginian Deactivated answered David Marginian Deactivated commented
No ETA. It is easy to work-around, if you are performing a payment refund you already have the payment so just grab the tip information off of the payment.
4 comments
10 |2000

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

kirank avatar image kirank commented ·

Normally, inside our app, we have the original transaction's payment ID that we are refunding. We don't have the entire object.


Since we can't go back to the requestor and change interfaces.. Instead we though of using paymentConnector.retrievePayment. But the request object here allows only externalPaymentID not the Clover Payment ID so that setting does not work for us. Is this the right call to get the payment details when we only have Clover Payment ID? Any other way to get the payment object with only the Clover Payment ID & Order ID?



0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ kirank commented ·

There are certainly ways to obtain the payment with just a Clover payment id (REST API being one of them) but I would recommend creating and associating a unique external id to the payment. If you aren't already doing this it sounds like a pretty serious flaw in your POS.

0 Likes 0 ·
kirank avatar image kirank David Marginian ♦♦ commented ·

We have an external ID. The only issue is our internal modules that does refund takes the platform provided ID as input. When we were designing the internal module we did not expect an underlying SDK (PaymentConnector) would not support its own ID.

We can change the module. But feel RetrievePayment call should take Clover Payment ID if external ID is not set.

0 Likes 0 ·
Show more comments

Welcome to the
Clover Developer Community