How adityaambre/payment-sdk works
Project type and purpose
• This is a Java Payment SDK library (jar) intended to be embedded in client applications to provide a unified payment interface supporting multiple payment modes (debit/credit card, net banking).
• The README confirms it’s not a standalone app but a reusable SDK: you include PaymentSDK.jar, configure your IDE, then call its API (PaymentSDK.getInstance().init(), initialise(), pay(), onResult()).
File structure
• Top-level artifacts:
• jar/PaymentSDK.jar – compiled library
• src/sdk – Java packages for the SDK
• src/sdk/client – client-facing API: base classes, model classes (PaymentMode, CardRequirement, NetBankingRequirement), example (SdkConfiguration)
• src/sdk/core – core engine: base types, constants, delegate, service logic, utilities, validators
• Architectural hints:
• A singleton entry point (PaymentSDK.getInstance())
• A delegate pattern (PaymentDelegate) that orchestrates flow
• A service class (PaymentService) that executes business logic
• Validators and utilities to enforce rules and transform data
• Model/requirement objects to decouple mode-specific parameters
Key points from the README
• Integration steps outline the high-level “call flow”:
1. import SDK packages
2. set up PaymentMode + PaymentRequirement
3. init SDK → get PaymentDelegate
4. delegate.initialise(...).pay(amount).onResult(callback)
• Example client code (SdkConfiguration) shows typical usage.