paykit-php / dummy
Dummy gateway package for Paykit PHP
dev-main
2026-04-23 11:10 UTC
Requires
- paykit-php/paykit: dev-main
Requires (Dev)
- laravel/pint: dev-main
This package is auto-updated.
Last update: 2026-04-23 11:15:51 UTC
README
This dummy vendor defines the standard for building Payment Gateway packages in the Paykit ecosystem.
It focuses on enforcing consistency in contracts, naming, and data boundaries across all vendor implementations.
Purpose
- Provide a baseline for new vendor packages
- Ensure consistent integration patterns
- Prevent vendor-specific leakage into application layer
Scope
This standard covers:
- Required methods
- Naming conventions
- DTO usage
- Mapping rules
It does not enforce:
- Directory structure
- Framework or library choices
- Internal architecture
Required Contract
Every vendor must implement:
- getMethods(int $amount = 0): PaymentMethodsDto
- purchase(PurchaseDto $payment): PaymentDto
- inquiry(string $reference): PaymentDto
Optional Contracts
- callback(array $payload): PaymentDto
- redirect(array $payload, bool $shouldVerify): PaymentDto
- getBalance(): BalanceDto
Payment Method Standard
DTO Rules
- DTO is the only boundary between vendor and application
- Always use getters, never direct property access
- Additional fields must be accessed based on
type
Mapping Rules
- All external responses must be mapped into DTOs
- Mapping must be explicit and controlled
- Do not pass through unknown or unused fields
Validation Rules
- Accept numeric values as strings (e.g. "10000")
- Must support form-urlencoded inputs
- Prioritize compatibility at the boundary layer
Design Principles
- Consistency over flexibility
- Explicit mapping over implicit behavior
- Strict DTO boundaries
- No vendor leakage
- Interchangeable implementations
Expected Outcome
All vendor packages should be:
- Consistent
- Predictable
- Replaceable without changing business logic
- Easy to maintain