Download the PHP package affiliatecom/zeroclick-sdk-sellers-php without Composer

On this page you can find all versions of the php package affiliatecom/zeroclick-sdk-sellers-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package zeroclick-sdk-sellers-php

ZeroClick Seller SDK for PHP

CI

Accept agent traffic forwarded by ZeroClick in a PHP API: verify that the traffic is genuine, check that the buyer's plan covers the work, do the work, and settle what was consumed.

⚠️ Unofficial package

This is an unofficial, third-party SDK published by Affiliate.com. It is not affiliated with or endorsed by ZeroClick, and ZeroClick does not produce, review, or support it. Nothing here is a ZeroClick asset or wordmark. If you need a vendor-supported client, ask ZeroClick for one — they ship TypeScript, Python, and Go.

What it does

An agent calls your API through ZeroClick. Four things have to happen, in this order, and this package does each of them:

Step What it means How
Verify The request really came from ZeroClick and reached you unaltered HMAC over six canonical fields, locally, with no network call
Check The buyer's plan covers the work you are about to do POST /v1/usage/check, before anything billable starts
Serve Your handler does the work Nothing of ours in the way
Settle Report what was actually consumed On the response, or asynchronously afterwards

A refused request is a decision, not an exception: the guard hands back a ready-to-return 401, 402, or 503, so your code reads as a guard clause rather than a try/catch around ordinary traffic.

Requirements

Install

If you have no PSR-18 client or PSR-17 factories installed yet, add one of each — for example:

Sixty-second quickstart

Configure the credentials ZeroClick issued you:

The key id is the second half of the signing credential, issued beside the secret and shown with it in the ZeroClick dashboard. Pasting the secret in on its own is the most common setup mistake — see configuration.

Then wrap the billable route in the guard. One line of wiring performs the whole sequence in the order that matters, so no route can get that order wrong or forget the last step:

A denied request comes back as the refusal, the handler never runs, and nothing is billed. A served one comes back carrying zc-usage, which is what turns the work into revenue.

The full wiring — building the client, the identity guard for free endpoints, ceilings, and asynchronous reports — is in the quickstart.

Three things that cost money quietly

Each of these is a silent, expensive failure rather than an error you will see in a log.

The default serves work you may never bill. When the allowance API gives no usable answer, this package serves the request anyway (OutagePolicy::Allow), matching every reference SDK. That keeps a ZeroClick outage from becoming your outage, and the cost is traffic authorised by nobody that may never be paid for. Watch for it with onAllowanceUnavailable, or choose OutagePolicy::Deny if refusing customers costs you less than serving them for free.

An unreported ceiling settles at zero. A maxQuantity authorises up to a limit and charges whatever amount you settle. Deliver the response without settling and that amount is zero — free for the buyer, unbilled for you, with no error anywhere. The report is what turns the work into revenue. Use a fixed quantity whenever the size is known before the work starts.

A normalised request target fails verification, and a proxy can normalise it before PHP sees it. ZeroClick signs the percent-encoded path and query exactly as it sent them. A framework — or an ingress — that decodes or reorders them breaks verification for those URLs only, in production only, presenting as an unexplained 401. This package detects the framework case and faults loudly. The proxy case no PHP change can fix: nginx and several managed load balancers normalise %2F by default, and this can appear on a working deployment with no application change at all. See the raw request target for what to check.

Documentation

Document What is in it
Quickstart Verify, check, serve, settle — end to end
Configuration Every option: type, default, environment fallback, when to change it
API reference Every public class and method, with signatures and examples
Errors The fault hierarchy, decisions versus faults, every error code
Middleware PSR-15, Laravel, and Symfony wiring
The raw request target The highest-cost failure mode, and what to check
Read-only catalog Sellers, services, meters, plans — unverified surface
Read-only analytics Overview, revenue, transactions — unverified surface
Examples Runnable PSR-15, Laravel, and Symfony integrations

Limitations

Stated plainly, because the alternative is that you find out later.

Versioning

Semantic Versioning. What the commitment covers — and what it deliberately does not — is stated in the changelog. Read that before pinning: the upstream protocol is outside our control, and we do not pretend otherwise.

Contributing

One command per task, and ci runs locally exactly what CI runs:

The suite is fully offline — every outbound call goes through a recording PSR-18 fake — so nothing here depends on an external service.

Documentation is executed, not reviewed. Every PHP sample on every page in docs/, and in this README, is extracted and run against that same fake, so a signature change breaks the build instead of quietly rotting the docs. Test coverage is measured by an actual run in CI (composer test:coverage); no coverage figure is written here, because a number typed into a file is not a measurement.

Licence

Apache-2.0. See LICENSE.


All versions of zeroclick-sdk-sellers-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-hash Version *
ext-json Version *
php-http/discovery Version ^1.19
psr/clock Version ^1.0
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^2.0
psr/http-server-handler Version ^1.0
psr/http-server-middleware Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package affiliatecom/zeroclick-sdk-sellers-php contains the following files

Loading the files please wait ...