Skip to content

Latest commit

 

History

History
71 lines (46 loc) · 1.9 KB

File metadata and controls

71 lines (46 loc) · 1.9 KB

Create A Reversal

Here, createReversal(String transactionReference) creates a POST request to /transactions/{transactionReference}/reversals

`Provided with a valid object representation, this endpoint allows for a new reversal to be

Usage/Examples

Declare the revesal object

private Reversal reversalObject;
     reversalObject = new Reversal();
     reversalObject.setReversal("reversal");

Call the reversal function with reversal and reference Id of transaction obtained using the polling method

  SDKManager.internationalTransfer.createReversal(NotificationMethod.POLLING,"","Place your Reference id", reversalObject, new RequestStateInterface() {
            @Override
            public void onRequestStateSuccess(RequestStateObject requestStateObject) {
                      serverCorrelationId = requestStateObject.getServerCorrelationId();

            }

            @Override
            public void onRequestStateFailure(GSMAError gsmaError) {
             
            }

            @Override
            public void onValidationError(ErrorObject errorObject) {
                
            }
            @Override
            public void getCorrelationId(String correlationID) {
               
            }
        });

Example Output

202
{
  "serverCorrelationId": "66b3e91a-1d36-41a6-8f4a-833ef1f9d125",
  "status": "pending",
  "notificationMethod": "callback",
  "objectReference": "8287",
  "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