Skip to content

Latest commit

 

History

History
45 lines (33 loc) · 1.78 KB

File metadata and controls

45 lines (33 loc) · 1.78 KB

Create a Transaction

Here, createRefundTransaction() creates a POST request to /transactions/type/adjustment

Provided with a valid object representation, this endpoint allows for a new transaction to be created for a given transaction type passed via the URL.

Usage/Examples

MMClient mmClient = new MMClient("<Place your consumer key>", "<Place your consumer secret>", "<Place your API key>");
Transaction transaction = new Transaction();
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.setDebitParty(debitPartyList);
transaction.setCreditParty(creditPartyList);
transaction.setAmount("<amount>");
transaction.setCurrency("<currency>");

RecurringPaymentRequest recurringPaymentRequest = new RecurringPaymentRequest();
recurringPaymentRequest.setTransaction(transaction);

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

Response Example

{
  "serverCorrelationId": "63420476-fdce-4fb2-95e5-b1dfed69d93c",
  "status": "pending",
  "notificationMethod": "callback",
  "objectReference": "19864",
  "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.