Download the PHP package zaver/sdk without Composer
On this page you can find all versions of the php package zaver/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package sdk
Zaver PHP SDK
This is the officially supported PHP SDK for Zaver Checkout, developed as a Composer package by Krokedil.
Requirements
- PHP 7.4+
- Zaver API key (either test or prod)
- Zaver callback token (optional but recommended)
Installation
Usage
All classes and methods are properly type-hinted with complementary PHPDoc - please see the API documentation for further details.
Examples
- Zaver PHP SDK
- Requirements
- Installation
- Usage
- Examples
- Initialize payment
- Receive payment callback
- Do a refund
- Receive refund callback (e.g. after refund approval)
- Identify your integration
- Handle API errors
Initialize payment
Receive payment callback
Do a refund
Receive refund callback (e.g. after refund approval)
List the available payment methods
getPaymentMethods() returns the methods Zaver offers the merchant for a market, optionally narrowed down by
amount and currency. Merchants with several variants of a method (for example PAY_LATER in 14, 30 or 90
days) get one entry per variant, identified by paymentMethodVariant; other merchants get one entry per
method without a variant:
Show a credit method as its title and description, a divider, the credit warning and the representative example.
getPaymentMethod() and getPaymentMethodVariant() on a PaymentStatusResponse tell which method (and
variant) the payer chose; both are null until the payer has made a choice.
Price an amount (credit pricing)
getCreditPricing() tells which consumer credit options you may show for an amount before any payment exists:
single invoices (PAY_LATER, with the payment plan the unpaid balance converts to on the due date), installments
and monthly invoices, each with the representative example in the requested language. Shops use it for
"from X per month" badges and loan calculators on product pages:
getPayLaterOptions() and getInstallmentOptions() filter the options by method. An empty getOptions() means
Zaver offers no credit for the amount, for instance below the merchant's minimum; it is not an error.
Identify your integration
Every request carries a User-Agent header with the SDK and PHP versions. Add your platform and plugin
so Zaver can see which versions a merchant runs when you ask for support:
The same parameter exists on Refund and Manage. Without it, the header is zaver-php-sdk/<version> PHP/<version>.
Handle API errors
All API and transport failures throw Zaver\SDK\Utils\Error: