Class StkPushExample

java.lang.Object
io.github.openpaydev.mpesa.examples.StkPushExample

public class StkPushExample extends Object
A runnable example demonstrating how to use the MpesaClient for an STK Push and Status Query.

Prerequisites:

Before running this example, you must set the following environment variables:

  • MPESA_CONSUMER_KEY: Your sandbox consumer key.
  • MPESA_CONSUMER_SECRET: Your sandbox consumer secret.
  • MPESA_PASSKEY: Your sandbox Lipa Na M-Pesa passkey.
  • MPESA_SHORTCODE: The sandbox business shortcode (e.g., "174379").
  • Constructor Details

    • StkPushExample

      public StkPushExample()
  • Method Details

    • main

      public static void main(String[] args)