Download the PHP package ridebuilder/affiliate without Composer
On this page you can find all versions of the php package ridebuilder/affiliate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ridebuilder/affiliate
More information about ridebuilder/affiliate
Files in ridebuilder/affiliate
Package affiliate
Short Description Server-side SDK for RideBuilder FirstParty affiliate tracking: capture click_id and send checkout/return postbacks.
License MIT
Homepage https://ridebuilder.com
Informations about the package affiliate
ridebuilder/affiliate (PHP)
Server-side SDK for RideBuilder's FirstParty affiliate program. It does two things:
- Capture the
click_ida shopper arrives with, so your backend can bind it to the cart/order. - Report checkout and return postbacks to RideBuilder (auth, retries, idempotency handled).
Mirrors the Node/.NET/Python SDKs — same contract, verified by the shared conformance suite.
Install
Requires PHP 8.1+ and ext-curl (bundled with virtually every PHP). No third-party runtime dependencies —
the default transport uses cURL. To run from source without Composer, require 'sdk/php/autoload.php'.
The pattern: capture at landing, bind to the order
Capture the click_id on landing, store it with the cart, and send it at purchase.
Store the API key server-side (env/secrets) — never in frontend code.
Decoupled frontend (e.g. React) + separate PHP backend
If the frontend is separate, the browser snippet captures the click_id into a first-party cookie, and
you get it to your backend one of two ways:
Either way, reportCheckout is unchanged — that's the SDK's real value in a decoupled setup.
Refunds
Integration protocol (register / verify / heartbeat)
The SDK reports its own type (php_sdk), version, and default capabilities.
Capture helpers
All validate ref == "ridebuilder" and the UUID-v4 click_id, returning null otherwise:
Capture::fromUrl($url)— from an absolute or relative URL.Capture::fromQuery($query)— from a decoded query map.Capture::fromCookieHeader($cookieHeader)— recover it from theridebuilder_attributioncookie.Capture::fromHeaders($headers, $name = 'X-RideBuilder-Click-Id')— from a forwarding header (decoupled path).
Client options
reportCheckout / reportReturn return PostbackResult(accepted, status) (202 = accepted, validated
asynchronously). Invalid input throws a non-retryable RideBuilderException; auth/size failures (401,
413) throw with ->status and ->errorCode. Amounts must be > 0 with at most 2 decimal places (pass a
string to avoid float rounding) or the call throws up front.
Tests
Plain PHP, no PHPUnit/Composer required:
Contract
Wraps the RideBuilder affiliate REST contract — POST /v1/postback/checkout, /postback/return,
/postback/health, the /integration/* endpoints, the /redirect link format, and API-key provisioning.
Verified byte-for-byte against the Node/.NET/Python SDKs by the shared conformance fixtures.
All versions of affiliate with dependencies
ext-curl Version *
ext-json Version *