oktocode/sham-cash-sdk
oktocode/sham-cash-sdk is a lightweight PHP SDK for integrating Sham Cash payments into Laravel applications. Send transfers, verify transactions, and manage wallet operations through a clean API with minimal configuration.
{encData, agentKey} envelope, result === 2500 success semantics, webhook token verification with exp/iat skew checks — into a composer require and one Client entry point. The alternative is a bespoke crypto implementation that your team will get subtly wrong.getBill and frame it as a one-shot fallback "at least 10 minutes after create, and only when the webhook never arrived." That is a strong architectural steer — you are committing to an event-driven order state machine with a 5-minute token TTL and 30-second clock skew tolerance. Your infrastructure needs reliable inbound webhook delivery and reasonably synced clocks.callbackUrl and redirectUrl can be client defaults with per-call overrides, but ShamCash still requires both on the wire, and ShamCash does not append billNo to redirectUrl. So you must own correlation (session/state param) on the redirect yourself. This is a concrete design constraint for the returning-user experience.Consider adopting when:
dir/A256GCM, protected-header-as-AAD, Base64-decoded 32-byte key, decimal-string amounts without float casts.InvalidArgumentException before any HTTP call, typed ApiException vs TransportException vs CryptoException, TLS verification pinned on even with an injected PSR-18 client, and logging that must never touch secretKey, encData, or decrypted payloads.Look elsewhere or plan extra work when:
Client in the container, map exceptions to your domain errors).src/ before you ship.parseWebhook reject legitimate callbacks.Non-negotiable pre-adoption checks: confirm the license (MIT, per docs), verify the release tag exists on Packagist rather than trusting a date, and validate the whole flow against the dev API using local/sandbox.php-style credentials held outside version control.
For executives: ShamCash is a payment rail we can integrate in days instead of weeks. This MIT-licensed PHP SDK takes on the hard, failure-prone parts — payment-grade encryption, the exact provider wire protocol, and cryptographically verified webhook handling — so our engineers write business logic, not crypto. It is deliberately narrow: bill creation, refunds, transaction reconciliation, and webhooks. That narrowness is the point; it keeps our exposure small and auditable. Two things to flag: it is a small, single-maintainer project (12 stars, no downstream dependents), so we should wrap it behind our own internal payment interface to keep a future switch to another rail cheap; and it requires a reliable public webhook endpoint and accurate server clocks, both of which we should confirm before committing to a launch date.
For engineering: This is a framework-free Composer library, PHP 8.2+, Guzzle 7 required, PSR-18 client and PSR-3 logger injectable. Client is the only entry point — createBill, getBill, refundBill, listTransactions, eachTransaction, parseWebhook; everything in Crypto, Http, and Support is @internal, so don't reach into it. Errors are typed by cause: local mistakes throw InvalidArgumentException before any HTTP call, provider rejections and succeeded !== true throw ApiException with a ResultCode, network/parse failures throw TransportException, and bad keys throw CryptoException — map these to distinct user-facing outcomes rather than one generic "payment failed." We own refund idempotency keys (10–100 chars, never auto-retried, repeat with the same key); a duplicate createBill may return 1704, so catch that and call getBill. Do not poll getBill — one shot, ten minutes minimum, webhook-missed only. parseWebhook wants the raw body string, unmodified. Never log secrets, ciphertext, or decrypted payloads, and keep TLS verification on. Our work item is a Laravel bridge: container binding, config, exception-to-domain mapping, and an order state machine driven by webhooks — the SDK gives us none of that by design. Verify installs against the dev API with credentials kept in gitignored local files.
How can I help you explore Laravel packages today?