PHPackages                             zaver/sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. zaver/sdk

ActiveLibrary[Payment Processing](/categories/payments)

zaver/sdk
=========

PHP SDK for Zaver Checkout.

3.0.0(2mo ago)011.4k↑192.9%2MITPHPPHP &gt;=7.4.0

Since Mar 28Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/zaver-io/zaver-php-sdk)[ Packagist](https://packagist.org/packages/zaver/sdk)[ Docs](https://github.com/zaver-io/zaver-php-sdk)[ RSS](/packages/zaver-sdk/feed)WikiDiscussions main Synced yesterday

READMEChangelog (3)Dependencies (2)Versions (8)Used By (0)

Zaver PHP SDK
=============

[](#zaver-php-sdk)

This is the officially supported PHP SDK for [Zaver Checkout](https://www.zaver.io/), developed as a Composer package by [Krokedil](https://www.krokedil.com/).

Requirements
------------

[](#requirements)

- PHP 7.4+
- Zaver API key (either test or prod)
- Zaver callback token (optional but recommended)

Installation
------------

[](#installation)

```
composer require zaver/sdk

```

Usage
-----

[](#usage)

All classes and methods are properly type-hinted with complementary PHPDoc - please see [the examples](#examples) on this page, and read [the API documentation](https://api-docs.zaver.se/v-1-2-0/checkout.html) for further details.

Examples
--------

[](#examples)

- [Zaver PHP SDK](#zaver-php-sdk)
    - [Requirements](#requirements)
    - [Installation](#installation)
    - [Usage](#usage)
    - [Examples](#examples)
        - [Initialize payment](#initialize-payment)
        - [Receive payment callback](#receive-payment-callback)
        - [Do a refund](#do-a-refund)
        - [Receive refund callback (e.g. after refund approval)](#receive-refund-callback-eg-after-refund-approval)

### Initialize payment

[](#initialize-payment)

```
// URL: https://example.com/checkout

use Zaver\SDK\Checkout;
use Zaver\SDK\Object\MerchantUrls;
use Zaver\SDK\Object\PaymentCreationRequest;
use Zaver\SDK\Object\LineItem;
use Zaver\SDK\Config\ItemType;

const API_KEY = '';
const CALLBACK_TOKEN = '';
const IS_TEST_ENVIRONMENT = true;

$api = new Checkout(API_KEY, IS_TEST_ENVIRONMENT);

$item = LineItem::create()
    ->setName('Fancy pants')
    ->setMerchantReference('FANCY-123')
    ->setQuantity(2)
    ->setUnitPrice(1000)
    ->setTotalAmount(2000)
    ->setTaxRatePercent(25)
    ->setTaxAmount(400)
    ->setItemType(ItemType::PHYSICAL);

$shipping = LineItem::create()
    ->setName('DHL')
    ->setQuantity(1)
    ->setUnitPrice(100)
    ->setTotalAmount(100)
    ->setTaxRatePercent(25)
    ->setTaxAmount(20)
    ->setItemType(ItemType::SHIPPING);

$urls = MerchantUrls::create()
    ->setSuccessUrl('https://example.com/thank-you')
    ->setCancelUrl('https://example.com/canceled')
    ->setCallbackUrl('https://example.com/api/payment-callback');

$request = PaymentCreationRequest::create()
    ->setMerchantPaymentReference('123456')
    ->setAmount(2100)
    ->setCurrency('SEK')
    ->setMarket('SE')
    ->setTitle('My fancy payment')
    ->setMerchantUrls($urls)
    ->addLineItem($item)
    ->addLineItem($shipping);

$payment = $api->createPayment($request);

echo $payment->getPaymentStatus();
// Output: CREATED

echo $api->getHtmlSnippet($payment);
// Outputs iframe with Zaver Checkout
```

### Receive payment callback

[](#receive-payment-callback)

```
// URL: https://example.com/api/payment-callback

use Zaver\SDK\Checkout;

const API_KEY = '';
const CALLBACK_TOKEN = '';
const IS_TEST_ENVIRONMENT = true;

$api = new Checkout(API_KEY, IS_TEST_ENVIRONMENT);
$payment = $api->receiveCallback(CALLBACK_TOKEN);

echo $payment->getPaymentStatus();
// Output: SETTLED
```

### Do a refund

[](#do-a-refund)

```
use Zaver\SDK\Refund;
use Zaver\SDK\Object\RefundCreationRequest;

const API_KEY = '';
const CALLBACK_TOKEN = '';
const IS_TEST_ENVIRONMENT = true;

$api = new Refund(API_KEY, IS_TEST_ENVIRONMENT);

// It does most likely not make any sense to fetch the payment first - this is just for
// showing the relation between a payment and a refund.
$payment = $api->getPaymentStatus('463d6d10-4c0f-424b-b804-8e95114864dd');

$urls = MerchantUrls::create()
    ->setCallbackUrl('https://example.com/api/refund-callback');

$request = RefundCreationRequest::create()
    ->setPaymentId($payment->getPaymentId())
    ->setRefundAmount($payment->getAmount())
    ->setDescription('Mr Fancy Pants changed his mind')
    ->setMerchantUrls($urls);

foreach($payment->getLineItems() as $paymentItem) {
    $refundItem = RefundLineItem::create()
        ->setLineItemId($paymentItem->getId())
        ->setRefundTotalAmount($paymentItem->getTotalAmount())
        ->setRefundTaxAmount($paymentItem->getTaxAmount())
        ->setRefundTaxRatePercent($paymentItem->getTaxRatePercent())
        ->setRefundQuantity($paymentItem->getQuantity())
        ->setRefundUnitPrice($paymentItem->getUnitPrice());

    $request->addLineItem($refundItem);
}

$refund = $api->createRefund($request);

echo $refund->getStatus();
// Outputs: PENDING_MERCHANT_APPROVAL

```

### Receive refund callback (e.g. after refund approval)

[](#receive-refund-callback-eg-after-refund-approval)

```
// URL: https://example.com/api/refund-callback

use Zaver\SDK\Refund;

const API_KEY = '';
const CALLBACK_TOKEN = '';
const IS_TEST_ENVIRONMENT = true;

$api = new Refund(API_KEY, IS_TEST_ENVIRONMENT);
$refund = $api->receiveCallback(CALLBACK_TOKEN);

echo $refund->getStatus();
// Output: PENDING_EXECUTION
```

###  Health Score

48

—

FairBetter than 93% of packages

Maintenance86

Actively maintained with recent releases

Popularity26

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~373 days

Total

5

Last Release

67d ago

Major Versions

1.0.2 → 2.0.02024-03-19

2.0.0 → 3.0.02026-04-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/54f81b606a956f192af534b154daa6a1600d35747132b8a08c6ea12618cfbab9?d=identicon)[Webbmaffian](/maintainers/Webbmaffian)

![](https://www.gravatar.com/avatar/1a4a74d0cd261a278981521d70b1ef881ce9aa643d44ea2223af816f49784f3b?d=identicon)[Zaver](/maintainers/Zaver)

---

Top Contributors

[![traed](https://avatars.githubusercontent.com/u/7236190?v=4)](https://github.com/traed "traed (39 commits)")[![Webbmekanikern](https://avatars.githubusercontent.com/u/8144421?v=4)](https://github.com/Webbmekanikern "Webbmekanikern (37 commits)")[![MichaelBengtsson](https://avatars.githubusercontent.com/u/26217027?v=4)](https://github.com/MichaelBengtsson "MichaelBengtsson (18 commits)")[![mntzrr](https://avatars.githubusercontent.com/u/26507935?v=4)](https://github.com/mntzrr "mntzrr (7 commits)")[![michaelheumann](https://avatars.githubusercontent.com/u/25079867?v=4)](https://github.com/michaelheumann "michaelheumann (3 commits)")[![maxlandbornzaver](https://avatars.githubusercontent.com/u/61457270?v=4)](https://github.com/maxlandbornzaver "maxlandbornzaver (2 commits)")[![dfcardenasp](https://avatars.githubusercontent.com/u/88217490?v=4)](https://github.com/dfcardenasp "dfcardenasp (1 commits)")[![NiklasHogefjord](https://avatars.githubusercontent.com/u/985946?v=4)](https://github.com/NiklasHogefjord "NiklasHogefjord (1 commits)")

---

Tags

sdkpaymentcardcheckoutrefundswishcreditzaver

### Embed Badge

![Health badge](/badges/zaver-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/zaver-sdk/health.svg)](https://phpackages.com/packages/zaver-sdk)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.6M13](/packages/checkout-checkout-sdk-php)[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4851.0k](/packages/sebdesign-laravel-viva-payments)[mrprompt/cielo

Integration with Cielo gateway.

482.2k1](/packages/mrprompt-cielo)[freelancehunt/php-credit-card-validator

Validates popular debit and credit cards' numbers against regular expressions and Luhn algorithm. Also validates the CVC and the expiration date.

18679.5k2](/packages/freelancehunt-php-credit-card-validator)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
