question

Dyego Costa avatar image
Dyego Costa asked hammer answered

Challenges of ICloverConnectorListener#onConfirmPaymentRequest

How can I know which kind of challenges could be passed to this function?

From the docs: "Will be called, passing in the Payment, if some type of confirmation is required to accept a payment"

I see that payment duplication can be one of them but I'd need to know all the possible challenges so I could handle them properly, otherwise I'd have to reject the payment for every unhandled challenge.

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

hammer avatar image
hammer answered

The implementation of ICloverConnectorListener.onConfirmPaymentRequest(ConfirmPaymentRequest) should use the set of Challenges obtained from ConfirmPaymentRequest to prompt the merchant for confirmation. The Challenge objects contain a user facing message (Challenge.message) that can be presented to the merchant to indicate the challenge. The ChallengeType(for the javascript connector see https://github.com/clover/remote-pay-...) defines the current possible set of challenges. You can see that the set includes a duplicate payment, and (depending on the merchant configuration) an 'offline' confirmation. This set will likely expand in the future. If the merchant wants the payment to continue, then CloverConnector.acceptPayment(Payment) would be called using the payment obtained from ConfirmPaymentRequest.getPayment(). If the merchant did not want the payment to proceed, then CloverConnector.rejectpayment(Payment, Challenge) would be called using the payment obtained from ConfirmPaymentRequest.getPayment() and the Challenge that the merchant chose to reject.

10 |2000

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