Skip to content

feat: scaffold modern Khalti SDK API with verification resources, doc…#1

Merged
sudiptpa merged 2 commits into
masterfrom
feat/khalti-modern-sdk
Feb 22, 2026
Merged

feat: scaffold modern Khalti SDK API with verification resources, doc…#1
sudiptpa merged 2 commits into
masterfrom
feat/khalti-modern-sdk

Conversation

@sudiptpa
Copy link
Copy Markdown
Owner

@sudiptpa sudiptpa commented Feb 22, 2026

PR Highlights

  • Complete rebuild of sudiptpa/khalti-sdk-php as a modern, framework-agnostic SDK.
  • Industry-style resource API designed for readability and safety:
    • payments()->create(...)
    • payments()->status(...)
    • verification()->parseReturnQuery(...)
    • verification()->verify(...)
    • legacyPayments()->verify(...) / legacyPayments()->status(...)
    • transactions()->all(...) / transactions()->find(...)
  • Strongly typed package design:
    • typed models for request/response payloads
    • enums for environment and payment status
    • typed exception hierarchy for precise error handling
  • Transport architecture built for extensibility:
    • TransportInterface contract
    • default CurlTransport (no heavy HTTP dependency lock-in)
    • custom transport support for app/framework integrations
  • Safe API client core:
    • structured JSON request/response handling
    • authentication header management (Authorization: Key ...)
    • consistent error mapping for auth/validation/api/transport/response failures
  • Security-focused payment verification flow:
    • explicit server-side verification using pidx status lookup
    • callback/return parsing and verification decision model
    • amount mismatch protection in verification path
  • Explicit documentation that Khalti ePayment does not provide checkout webhook in this flow:
    • backend manual verification is mandatory before fulfillment
    • clear “do not trust return query alone” guidance
  • Laravel-focused DX without adding framework dependency in core:
    • Laravel v12/v13 integration guide
    • optional LaravelTransport example in README
  • Developer and contributor docs added:
    • complete README from quick-start to advanced usage
    • ARCHITECTURE.md with lifecycle, project map, extension points
  • Quality tooling and CI setup from day one:
    • PHPUnit tests
    • PHPStan static analysis
    • PHP lint script
    • GitHub Actions CI matrix for PHP 8.2, 8.3, 8.4, 8.5
  • Validation status:
    • tests passing
    • static analysis passing
    • syntax lint passing

@sudiptpa sudiptpa merged commit e59c6b9 into master Feb 22, 2026
4 checks passed
@sudiptpa sudiptpa deleted the feat/khalti-modern-sdk branch February 22, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant