lainz avatar image
lainz asked lainz commented

Payment Connector with partial payment

I have working a payment with this code

But I want to support partial payments, how I can detect that there was a partial payment?

I need to read from response.payment on SaleResponse, this is right?

override fun onSaleResponse(response: SaleResponse?) { response.payment <------ this

Then relaunch the clover payment connector again until all is payed?

What happens with the

Clover Android SDK
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 lainz commented

Currently, you will need to compare the amount of the sale to the amount of the payment in the sale response. You can then start a new payment for the difference, or you can void the partial payment, it is up to you. externalId is for your POSs tracking purposes, so I don't understand your question entirely.

10 |2000

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

Hi, ok, thanks. So I can reuse the external id to keep track for all these payments?

Because I store only a credit card payment on our system, the sum of all these small payments.

My second question if is if I can reuse the code, or it must be different, that's all.

0 Likes 0 ·

I know we do impose some limitations on using the same externalId (for example, for back-to-back transactions). I don't have time to test this right now, so you may want to run a few tests. If you find you cannot perform the second part of the transaction with the same externalId you will need to build in another mechanism for joining the two (not ideal I realize).

0 Likes 0 ·
lainz avatar image lainz David Marginian ♦♦ ·

Thanks, we finally saved each one into separate rows in the database, one for each card.

0 Likes 0 ·

Welcome to the
Clover Developer Community