Skip to main content
Taliup\Sdk\Resources\HostedPayments provides methods for creating hosted checkout sessions and verifying transactions. You access it through the Client — never instantiate it directly. Retrieve the resource by calling hostedPayments() on a configured Client instance:

Methods

createCheckoutUrl(array $payload): array

Creates a hosted payment page and returns the URL to redirect your customer to. The customer enters their card details on Taliup’s secure hosted page; your server is notified of the result via webhook. Endpoint: POST /hosted-payments/checkout-url

Parameters

float
required
The total amount to charge. For example, 49.99.
string
ISO 4217 currency code. Accepted values: CAD, USD. Defaults to the currency configured on your merchant account.
string
Your internal order or reference ID. This value is echoed back in the webhook payload, making it easy to reconcile payments with your own records.
string
HTTPS URL to redirect the customer to after a successful payment. Must use https://.
string
HTTPS URL to redirect the customer to if they cancel the payment. Must use https://.
string
Customer’s first name. Pre-fills the checkout form if provided.
string
Customer’s last name. Pre-fills the checkout form if provided.
string
Customer’s email address. Pre-fills the checkout form if provided.
array
Array of line-item objects to display on the checkout page. Each element may include:
string
HTTPS URL that Taliup will POST a notification to after the payment is captured. Must use https://. See the Webhook reference for signature verification.
string
A free-form tag used to identify the originating platform or integration (e.g. "my-storefront"). Appears in reporting.
int
How long the checkout session stays valid, in minutes. Must be between 5 and 60. Defaults to 30.

Response

string
The hosted checkout page URL. Redirect your customer here immediately after receiving this response.
string
Unique session token that identifies this checkout attempt. Store it if you need to reference the session later.
string
ISO 8601 timestamp indicating when the session expires (e.g. 2026-05-14T18:30:00+00:00).

Example

redirect_url, cancel_url, and webhook_url must all use https://. Plain HTTP URLs will be rejected.

verifyTransaction(array $payload): array

Verifies the status of a previously created transaction. Use this to confirm a payment server-side when you prefer polling over webhooks, or as a secondary check after receiving a webhook. Endpoint: POST /hosted-payments/verify-transaction

Example