Skip to content

Latest commit

 

History

History
47 lines (34 loc) · 1.8 KB

File metadata and controls

47 lines (34 loc) · 1.8 KB

View A Request State

Here, viewRequestState(String serverCorrelationId) creates a GET request to /requeststates/{serverCorrelationId}

This endpoint returns a specific request state.

Usage/Examples

MMClient mmClient = new MMClient("<Place your consumer key>", "<Place your consumer secret>", "<Place your API key>");
BillPaymentRequest billPaymentRequest = new BillPaymentRequest();
List<AccountIdentifier> debitPartyList = new ArrayList<>();
List<AccountIdentifier> creditPartyList = new ArrayList<>();

debitPartyList.add(new AccountIdentifier("<identifier type>", "<identifier>"));
creditPartyList.add(new AccountIdentifier("<identifier type>", "<identifier>"));

Transaction transaction = new Transaction();
transaction.setDebitParty(debitPartyList);
transaction.setCreditParty(creditPartyList);
transaction.setAmount("<Amount>");
transaction.setCurrency("<Currency>");

billPaymentRequest.setTransaction(transaction);

AsyncResponse sdkResponse = mmClient.addRequest(billPaymentRequest).addCallBack("<Place your callback URL>").createBillTransaction();

sdkResponse = mmClient.addRequest(billPaymentRequest).viewRequestState(sdkResponse.getServerCorrelationId());

Response Example

{
  "serverCorrelationId": "83075964-97ec-4bb4-aa51-65f7fbf4ed85",
  "status": "completed",
  "notificationMethod": "callback",
  "objectReference": "REF-16346283708744",
  "pollLimit": 100
}

NOTE

In asynchronous flows, a callback mechanism or polling mechanism is utilised to allow the client to determine the request's final state. Use the viewRequestState() function for the polling mechanism to receive the status of a request, and the viewTransaction() function to acquire the final representation of the transaction object.