Class StkPushResponse

java.lang.Object
io.github.openpaydev.mpesa.core.models.StkPushResponse

public final class StkPushResponse extends Object
Represents the synchronous response received from the M-Pesa API immediately after initiating an STK Push.

This is NOT the final result of the transaction. This object confirms that M-Pesa has received the request and is processing it. The final result will be sent to your callback URL.

  • Method Details

    • builder

      public static StkPushResponse.StkPushResponseBuilder builder()
    • getMerchantRequestID

      public String getMerchantRequestID()
      A unique identifier for the transaction that was provided by the merchant's system.
    • getCheckoutRequestID

      public String getCheckoutRequestID()
      A unique identifier for the transaction generated by the M-Pesa system.

      Important: This is the ID you must use to query the status of the transaction later.

    • getResponseCode

      public String getResponseCode()
      The status code of the request. A value of "0" indicates that the request was successfully received and is being processed. Any other value indicates an error with the initial request.
    • getResponseDescription

      public String getResponseDescription()
      A brief description of the response code. Example: "Success. Request accepted for processing"
    • getCustomerMessage

      public String getCustomerMessage()
      A message that can be displayed to the end-user. Example: "Success. Request accepted for processing"
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object