How oktocode-l-l-c/sham-cash-php-sdk works
This is a PHP SDK for the ShamCash payment API. The main workflow is an application calling the SDK to create, retrieve, or refund bills and list transactions; the client validates and encrypts requests, transport sends them to ShamCash, and response mapping returns typed results. Separately, ShamCash posts encrypted webhook bodies to the application, which the SDK decrypts, validates timestamps, and maps into a notification. The graph also shows pagination and supporting crypto, mapping, and transport layers. Relationships are grounded in the README and shown source; unsampled components are included only where documented capabilities and paths are clear.
Main entry points: ResponseMapper.php Response mapper · Transport.php HTTP transport · Client.php SDK client · DirectJwe.php Direct JWE
Components 30
SDK operations
- SDK client
src/Client.php - Bill operations
src/Client.php - Refund operation
src/Client.php - Transaction queries
src/Client.php - Transaction iteration
src/Client.php - Webhook parsing
src/Client.php
API and cryptography
- HTTP transport
src/Http/Transport.php - Direct JWE
src/Crypto/DirectJwe.php
Payment models
- Bill result
src/Model/Bill.php - Refund result
src/Model/RefundResult.php - Transaction page
src/Model/TransactionPage.php - Transaction
src/Model/Transaction.php - Webhook notification
src/Model/WebhookNotification.php - Refund entry
src/Model/Refund.php - Bill statuses
src/Enum/BillStatus.php - Currencies
src/Enum/Currency.php - API result codes
src/Enum/ResultCode.php - Transaction types
src/Enum/TransactionType.php
Shared support
- Response mapper
src/Support/ResponseMapper.php - JSON support
src/Support/Json.php - Input validation
src/Support/Input.php - Decimal amounts
src/Support/DecimalValue.php - Clock
src/Support/Clock.php - SDK exceptions
src/Exception/ShamCashException.php - API exception
src/Exception/ApiException.php - Transport exception
src/Exception/TransportException.php - Crypto exception
src/Exception/CryptoException.php - Field extraction
src/Support/Fields.php
Other components
- PHP application
- ShamCash API
Connections 48
- PHP application → SDK client: calls
README.md - SDK client → Bill operations: exposes
src/Client.php - SDK client → Refund operation: exposes
src/Client.php - SDK client → Transaction queries: exposes
src/Client.php - SDK client → Transaction iteration: exposes
src/Client.php - SDK client → Webhook parsing: exposes
src/Client.php - Bill operations → Input validation: validates
src/Client.php - Refund operation → Input validation: validates
src/Client.php - Transaction queries → Input validation: validates
src/Client.php - Bill operations → Decimal amounts: formats amounts
src/Client.php - Refund operation → Decimal amounts: formats amounts
src/Client.php - Bill operations → Direct JWE: encrypts payload
src/Client.php - Refund operation → Direct JWE: encrypts payload
src/Client.php - Transaction queries → Direct JWE: encrypts payload
src/Client.php - Bill operations → HTTP transport: posts request
src/Client.php - Refund operation → HTTP transport: posts request
src/Client.php - Transaction queries → HTTP transport: posts request
src/Client.php - HTTP transport → ShamCash API: sends HTTP
src/Http/Transport.php - ShamCash API → HTTP transport: returns response
README.md - HTTP transport → JSON support: decodes response
src/Http/Transport.php - HTTP transport → API exception: raises API errors
src/Http/Transport.php - HTTP transport → Transport exception: raises transport errors
src/Http/Transport.php - HTTP transport → API result codes: checks result
src/Http/Transport.php - Bill operations → Response mapper: maps response
src/Client.php - Refund operation → Response mapper: maps response
src/Client.php - Transaction queries → Response mapper: maps response
src/Client.php - Response mapper → Bill result: builds
src/Support/ResponseMapper.php - Response mapper → Refund result: builds
src/Support/ResponseMapper.php - Response mapper → Transaction page: builds
src/Support/ResponseMapper.php - Response mapper → Transaction: builds
src/Support/ResponseMapper.php - Response mapper → Refund entry: builds
src/Support/ResponseMapper.php - Response mapper → Webhook notification: builds
src/Support/ResponseMapper.php - Response mapper → Field extraction: extracts fields
src/Support/ResponseMapper.php - Response mapper → Bill statuses: maps status
src/Support/ResponseMapper.php - Response mapper → Currencies: maps currency
src/Support/ResponseMapper.php - Response mapper → Transaction types: maps type
src/Support/ResponseMapper.php - Transaction iteration → Transaction queries: requests pages
src/Client.php - Transaction iteration → Transaction page: reads cursor
src/Client.php - PHP application → Webhook parsing: passes raw body
README.md - Webhook parsing → JSON support: decodes envelope
src/Client.php - Webhook parsing → Direct JWE: decrypts token
src/Client.php - Webhook parsing → Clock: checks timestamps
src/Client.php - Webhook parsing → Response mapper: maps notification
src/Client.php - ShamCash API → PHP application: posts webhook
README.md - Webhook notification → PHP application: returns event
README.md - Bill result → Bill statuses: uses status
src/Model/Bill.php - Bill result → Currencies: uses currency
src/Model/Bill.php - Transaction → Currencies: uses currency
src/Model/Transaction.php