PawaPay Java SDK

Local Integration & Testing Environment (but make it ✨silly🧠)

🐸 Server Status: Online (and slightly dizzy)
🤹‍♂️ 🦄 🔮

๐ŸŒ Java Hosted Payment Page Simulator

SANDBOX MODE ON
runPaymentPage.java โ€” weird-mode
import com.katorymnd.pawapay.sdk.api.ApiClient;
import com.katorymnd.pawapay.sdk.config.Config;

// 1. Build Config with your Sandbox Token
Config config = new Config.Builder()
        .apiKey("")
        .environment("sandbox")
        .build();

// 2. Initialize Native Core Client
String apiVersion = ;
ApiClient client = new ApiClient(config, "KATORYMND_PAWAPAY_SDK_LICENSE_KEY", true, apiVersion);

// 3. Set Payment Page Parameters
String depositId = Helpers.generateUniqueId();
String amount = "";
String currency = "";
String phoneNumber = "";
String country = "";
String returnUrl = "https://example.com/payment-success";

// 4. Create Session Parameters Map
Map<String, Object> params = new HashMap<>();
params.put("depositId", depositId);
params.put("amount", amount);
params.put("currency", currency);
params.put("phoneNumber", phoneNumber);
params.put("country", country);
params.put("returnUrl", returnUrl);
params.put("customerMessage", "Payment for Order #12345");

// 5. Create Hosted Payment Page Session
Map<String, Object> response = client.createPaymentPageSessionAuto(params).join();

System.out.println("Redirect URL: " + response.get("redirectUrl"));
JAVA CONSOLE // OUT
Waiting for JVM to compile thoughts...

๐Ÿ’ก What this does:

  • Creates a hosted payment page session (no provider selection needed)
  • Supports both V1 and V2 API versions
  • Customer selects their preferred payment method on the hosted page
  • Returns a redirect URL to the hosted checkout experience
  • Includes country parameter (UGA, KEN, TZA, etc.) for localized payment options
  • Automatically redirects to returnUrl after payment completion