Skip to main content
The Taliup PHP SDK lets you generate a secure, hosted payment page in just a few lines of code. You build a checkout payload, call createCheckoutUrl(), and redirect your customer to the returned URL — Taliup handles the payment form, card processing, and post-payment redirect for you.
1

Install and configure the client

Install the SDK via Composer. PHP 8.2 or higher is required.
Get your credentials from Taliup → Settings → Payments → Credentials, then instantiate the Client:
The following configuration options are available:
2

Build the checkout payload

Construct the payload array with the fields you need. Only amount is strictly required, but including reference, redirect_url, cancel_url, and customer details is strongly recommended.
Always pass a reference that maps to your internal order ID. Taliup returns this value in the webhook, so you can reliably reconcile payments without querying your database by transaction ID.
The session remains valid for between 5 and 60 minutes. If you omit expires_in_minutes, it defaults to 30 minutes. Once the session expires, the customer will need to start a new checkout.
3

Call createCheckoutUrl()

Pass your payload to createCheckoutUrl(). The SDK sends the request to the Taliup API and returns an associative array with the hosted checkout details.
A successful response contains three fields:
4

Redirect the customer to checkout_url

Once you have the checkout_url, redirect your customer’s browser to it immediately. The customer completes their payment on Taliup’s secure hosted page.
redirect_url, cancel_url, and webhook_url must all use HTTPS. Plain HTTP URLs will be rejected by the API.
5

Handle the return

After the payment is completed or abandoned, Taliup redirects the customer back to one of two URLs you provided in the payload:
  • redirect_url — the customer completed the payment flow (this does not guarantee approval; always confirm via the webhook).
  • cancel_url — the customer clicked Cancel or closed the checkout page.
Handle both routes in your application:
Do not fulfil orders based solely on the redirect_url callback. A redirect to that URL means the payment flow ended, not that the payment was approved. Always wait for a webhook event with status === 'approved' before marking an order as paid.

Complete example

The following snippet combines every step above into a single file you can adapt as a starting point: