Skip to content

feat: add model-first payload entities and transport guidance#3

Merged
sudiptpa merged 4 commits into
masterfrom
feat/khalti-transport-default-and-models
Feb 23, 2026
Merged

feat: add model-first payload entities and transport guidance#3
sudiptpa merged 4 commits into
masterfrom
feat/khalti-transport-default-and-models

Conversation

@sudiptpa
Copy link
Copy Markdown
Owner

@sudiptpa sudiptpa commented Feb 23, 2026

Highlights

  • Added model-first payment payload support for cleaner, safer request building:
    • CustomerInfo
    • AmountBreakdownItem
    • ProductDetail
    • upgraded EpaymentInitiateRequest with make(...), getters/setters, and fluent adders
  • Preserved backward compatibility for initiate payloads by still accepting array-based fields in EpaymentInitiateRequest.
  • Added readable payment API aliases:
    • payments()->initiate(...) (alias of create(...))
    • payments()->lookup(...) (alias of status(...))
  • Kept CurlTransport as default core transport and improved the runtime error when ext-curl is missing:
    • now clearly instructs users to install ext-curl or provide a custom TransportInterface.
  • Expanded tests:
    • new unit tests for model serialization and backward-compatible array payloads
    • new unit tests for initiate()/lookup() aliases
  • Upgraded docs (README.md) with:
    • concrete PSR-18/Guzzle transport adapter example using Khalti SDK naming
    • clearer custom transport guidance
    • explicit optional-dependency note for PSR-18/Guzzle integrations
    • restored typed model/value object highlights
  • Updated architecture docs (ARCHITECTURE.md) to reflect:
    • model-first payload flow
    • alias method flow
    • default transport behavior and override path
  • Dependency/CI alignment:
    • removed ext-json hard dependency from composer.json
    • synced composer.lock so composer validate --strict passes in CI

@sudiptpa sudiptpa merged commit 7e23bdf into master Feb 23, 2026
5 checks passed
@sudiptpa sudiptpa deleted the feat/khalti-transport-default-and-models branch February 23, 2026 02:55
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