What the SDK provides
Hosted Payments
Generate a checkout URL, redirect your customer, and let Taliup handle the payment form, card tokenisation, and 3-D Secure flows. Verify completed transactions server-side with
verifyTransaction().Webhook Verification
Receive a signed
payment.captured event the moment a transaction completes, and verify the HMAC-SHA256 signature with a single method call.Typed Error Handling
Every API and connection failure surfaces as a single
ApiException that exposes the HTTP status code, human-readable message, and raw response body.Quickstart
Up and running in minutes — install via Composer, drop in your credentials, and create your first checkout URL.
Key features
- Zero configuration by default — the SDK points at
https://taliuphq.com/api/v1out of the box; only your credentials are required. - Fluent resource interface — access hosted-payments functionality through
$client->hostedPayments(), keeping future resources nicely namespaced. - Webhook helpers —
Webhook::constructEvent()verifies the signature and decodes the payload in one call;Webhook::verify()returns a plainboolwhen you just need a guard check. - Transaction verification —
verifyTransaction()lets you confirm a completed transaction server-side using the token returned bycreateCheckoutUrl(). - Guzzle-powered HTTP — built on
guzzlehttp/guzzle ^7.8with a configurable timeout and clean exception wrapping. - MIT licensed — use it freely in commercial and open-source projects alike.
Requirements
Installation
Install the SDK with Composer:guzzlehttp/guzzle automatically. Once the install completes, the SDK is available via your project’s standard autoloader:
Public API surface
The following classes and methods make up the full public interface of the SDK.Client
merchant_site_id, merchant_secret_key. Optional keys: base_url (default https://taliuphq.com/api/v1), timeout (default 10 seconds). Throws ApiException immediately if either required credential is missing.
HostedPayments resource, which exposes checkout and transaction-verification methods.
HostedPayments
checkout_url, token, and expires_at. Redirect your customer to checkout_url to collect payment.
token returned by createCheckoutUrl() to confirm the payment outcome without relying solely on the webhook.
Webhook
true if the X-Taliup-Signature header matches an HMAC-SHA256 digest of the raw request body signed with your merchant_secret_key. Returns false otherwise — no exception is thrown.
ApiException if the signature is invalid or the body is not valid JSON.
ApiException
0 for connection-level errors.
Next steps
Quickstart
Create your first checkout URL and handle your first webhook in under five minutes.