paykit-php/dummy

Dummy gateway package for Paykit PHP

Maintainers

Package info

github.com/paykit-php/dummy

Type:paykit

pkg:composer/paykit-php/dummy

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2026-04-23 11:10 UTC

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