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 CreateSinglePayoutServlet 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 ));
Cancel Unclaimed Payout
Use this call to cancel an existing, unclaimed transaction. If an unclaimed item is not claimed within 30 days, the funds will be automatically returned to the sender. This call can be used to cancel the unclaimed item prior to the automatic 30-day return. API used: POST /v1/payments/payouts-item//cancel