question

vidivici avatar image
vidivici asked Raymond Lee Deactivated answered

How to get Payment by payment ID?

Is there a connector/method that lets you obtain a payment object by its paymentID?
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

Raymond Lee avatar image
Raymond Lee Deactivated answered
Hi @Vidivici,

We currently do not provide a method to retrieve a Payment object using a paymentID, there are 2 workarounds for now:

1. If you don't need a Payment object exactly, but need information from the payment, you can send a GET request to /v3/merchants/{merchantId}/payments/{paymentId}, and read the response for the information you need.

2. If you need the Payment object, if you have the Order object / OrderID, you can call getPayments() on the Order object to retrieve the list of Payments for that order. Then you can iterate through the list of Payments, checking the paymentID of each one using getId() until it matches the paymentID you are looking for.

Hope that helps,

Raymond
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