Package io.github.openpaydev.mpesa.core
Enum Class MpesaEnvironment
- All Implemented Interfaces:
Serializable,Comparable<MpesaEnvironment>,Constable
Enum representing the M-Pesa API environments and their corresponding endpoint URLs.
This enum centralizes all API endpoint URLs, ensuring that the client code does not need to be aware of the specific paths for authentication or transactions.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe Production environment for live, real-money transactions.The Sandbox environment for development and testing purposes. -
Method Summary
Modifier and TypeMethodDescriptionReturns the full URL for the OAuth token generation endpoint.Returns the full URL for the C2B Register URL endpoint.Returns the full URL for the STK Push (Lipa Na M-Pesa Online) process request endpoint.Returns the full URL for the STK Push Query (Transaction Status) endpoint.static MpesaEnvironmentReturns the enum constant of this class with the specified name.static MpesaEnvironment[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SANDBOX
The Sandbox environment for development and testing purposes. -
PRODUCTION
The Production environment for live, real-money transactions.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getAuthUrl
Returns the full URL for the OAuth token generation endpoint.- Returns:
- The complete authentication URL as a String.
-
getStkPushUrl
Returns the full URL for the STK Push (Lipa Na M-Pesa Online) process request endpoint.- Returns:
- The complete STK Push URL as a String.
-
getStkQueryUrl
Returns the full URL for the STK Push Query (Transaction Status) endpoint.- Returns:
- The complete STK Push Query URL as a String.
-
getC2bRegisterUrl
Returns the full URL for the C2B Register URL endpoint.- Returns:
- The complete C2B Register URL as a String.
-