Class TransactionRestResponse

java.lang.Object
pro.mypvit.responses.AbstractResponse
pro.mypvit.responses.TransactionRestResponse

public class TransactionRestResponse extends AbstractResponse
Represents the response for a REST transaction request in the MyPVit SDK.

This class extends AbstractResponse to inherit functionality for JSON deserialization and provides specific fields related to REST transaction results.

Key Features:
  • Inherits JSON deserialization capabilities from AbstractResponse.
  • Includes fields for transaction status, operator, references, and additional details.
  • Supports automatic generation of getters, setters, equals, and hashCode methods through Lombok.
Usage: Use the `fromJson` method provided by AbstractResponse to deserialize a JSON response into an instance of this class. Example:
 String jsonResponse = "{"
     + "\"status\": \"SUCCESS\","
     + "\"status_code\": \"200\","
     + "\"operator\": \"AIRTEL_MONEY\","
     + "\"reference_id\": \"REF123456\","
     + "\"merchant_reference_id\": \"MERCHANT_REF123\","
     + "\"merchant_operation_account_code\": \"ACC123456\","
     + "\"message\": \"Transaction processed successfully\""
     + "}";

 TransactionRestResponse response = AbstractResponse.fromJson(jsonResponse, TransactionRestResponse.class);
 System.out.println("Status: " + response.getStatus());
 System.out.println("Operator: " + response.getOperator());
 System.out.println("Reference ID: " + response.getReferenceId());
 System.out.println("Message: " + response.getMessage());
 
  • Constructor Details

    • TransactionRestResponse

      public TransactionRestResponse()
      Default constructor