Load SDK configuration for the resource. This intialization code can be done as Init Servlet.
Sample showing how to get a Payout Item Status
We are re-using the GetPayoutBatchStatusServlet to get a batch payout for us. This will make sure the samples will work all the time.
In the samples, we are extractingt he payoutItemId of a payout we just created. In reality, you might be using the payoutItemId stored in your database, or passed manually.
Initiate the response object
Retrieve the access token from OAuthTokenCredential by passing in ClientID and ClientSecret It is not mandatory to generate Access Token on a per call basis. Typically the access token can be generated once and reused within the expiry window
Pass in a ApiContext
object to authenticate
the call and to send a unique request id
(that ensures idempotency). The SDK generates
a request id if you do not pass one explicitly.
Use this variant if you want to pass in a request id that is meaningful in your application, ideally a order id. String requestId = Long.toString(System.nanoTime(); APIContext apiContext = new APIContext(accessToken, requestId ));
Get Payout Item Status
Use this call to get data about a payout item, including the status, without retrieving an entire batch. You can get the status of an individual payout item in a batch in order to review the current status of a previously-unclaimed, or pending, payout item. API used: GET /v1/payments/payouts-item/