PHPackages                             swedbank-pay/swedbank-pay-sdk-php - 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. [API Development](/categories/api)
4. /
5. swedbank-pay/swedbank-pay-sdk-php

ActiveLibrary[API Development](/categories/api)

swedbank-pay/swedbank-pay-sdk-php
=================================

The Swedbank Pay SDK for PHP simplifies integrations against Swedbank Pay's API Platform by providing native PHP interface towards the REST API.

6.3.0(1mo ago)676.3k↓74.6%16[2 issues](https://github.com/SwedbankPay/swedbank-pay-sdk-php/issues)[1 PRs](https://github.com/SwedbankPay/swedbank-pay-sdk-php/pulls)2MITPHPCI passing

Since Apr 2Pushed 3w ago3 watchersCompare

[ Source](https://github.com/SwedbankPay/swedbank-pay-sdk-php)[ Packagist](https://packagist.org/packages/swedbank-pay/swedbank-pay-sdk-php)[ Docs](https://github.com/SwedbankPay/swedbank-pay-sdk-php)[ RSS](/packages/swedbank-pay-swedbank-pay-sdk-php/feed)WikiDiscussions main Synced 4d ago

READMEChangelog (10)Dependencies (26)Versions (38)Used By (2)

Swedbank Pay SDK for PHP
========================

[](#swedbank-pay-sdk-for-php)

[![Build status](https://github.com/SwedbankPay/swedbank-pay-sdk-php/workflows/PHP/badge.svg?branch=master)](https://github.com/SwedbankPay/swedbank-pay-sdk-php/workflows/PHP/badge.svg?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/a547de30c5949055c742d677d3fd1f72eda45b4c1fa4f42c2b7d1cb19218f635/68747470733a2f2f706f7365722e707567782e6f72672f7377656462616e6b2d7061792f7377656462616e6b2d7061792d73646b2d7068702f76657273696f6e)](https://packagist.org/packages/swedbank-pay/swedbank-pay-sdk-php)[![Total Downloads](https://camo.githubusercontent.com/250fbebd4370d86e5a99e617c57a986f5eea2e17343dac4e927e8da762655644/68747470733a2f2f706f7365722e707567782e6f72672f7377656462616e6b2d7061792f7377656462616e6b2d7061792d73646b2d7068702f646f776e6c6f616473)](https://packagist.org/packages/swedbank-pay/swedbank-pay-sdk-php)[![Codecov](https://camo.githubusercontent.com/c5d0deca4e509521fda41eed2e322657eff3cd59cae67006d6c6c393d0dedc0a/68747470733a2f2f636f6465636f762e696f2f67682f5377656462616e6b5061792f7377656462616e6b2d7061792d73646b2d7068702f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/SwedbankPay/swedbank-pay-sdk-php)[![License](https://camo.githubusercontent.com/8380b11916bd4158f6b2f177314919cc213cecb965fd84b097f5278745b95b98/68747470733a2f2f706f7365722e707567782e6f72672f7377656462616e6b2d7061792f7377656462616e6b2d7061792d73646b2d7068702f6c6963656e7365)](https://packagist.org/packages/swedbank-pay/swedbank-pay-sdk-php)

[![Swedbank Pay SDK for PHP](https://repository-images.githubusercontent.com/211837579/156c6000-53ed-11ea-8927-782b8067996f)](https://packagist.org/packages/swedbank-pay/swedbank-pay-sdk-php)

About
-----

[](#about)

**UNSUPPORTED**: This SDK is at an early stage of development and is not supported as of yet by Swedbank Pay. It is provided as a convenience to speed up your development, so please feel free to play around. However, if you need support, please wait for a future, stable release.

The Swedbank Pay SDK for PHP simplifies integrations against [Swedbank Pay's API Platform](https://developer.swedbankpay.com/) by providing native PHP interface towards the REST API.

This SDK includes the following payments options:

- Checkout
- Credit and debit cards (Visa, Mastercard, Visa Electron, Maestro etc).
- Invoice
- Swish
- Vipps
- MobilePay Online
- Trustly

Documentation
-------------

[](#documentation)

Documentation about Swedbank Pay's API Platform can be found on the [Swedbank Pay Developer Portal](https://developer.swedbankpay.com/) for now.

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

[](#installation)

The recommended way to install the Swedbank Pay SDK for PHP library is with Composer. You can also download the source code from one of the [releases here on GitHub](https://github.com/SwedbankPay/swedbank-pay-sdk-php/releases) or simply clone this repository.

### Composer

[](#composer)

The preferred method is via [Composer](https://getcomposer.org). Follow the [installation instructions](https://getcomposer.org/doc/00-intro.md) if you do not already have composer installed.

Once composer is installed, execute the following command in your project root to install this SDK:

```
composer require swedbank-pay/swedbank-pay-sdk-php
```

Examples
--------

[](#examples)

You can find examples in `/tests` directory or check out [Swedbank Pay Core for WooCommerce](https://github.com/SwedbankPay/swedbank-pay-woocommerce-core) code.

Using Online Payments v3.1
--------------------------

[](#using-online-payments-v31)

Version 6.3.0 introduces typed response support for Online Payments v3.1. The v3.1 surface lives under the `SwedbankPay\Api\Service\Paymentorder\V3` namespace and is fully additive — existing v2 classes are unchanged.

Opt in by setting the API version on the Client (this switches the `Content-Type` header to `application/json;version=3.1`):

```
use SwedbankPay\Api\Client\Client;
use SwedbankPay\Api\Service\Paymentorder\V3\Request\Purchase;
use SwedbankPay\Api\Service\Paymentorder\V3\Request\TransactionCapture;

$client = new Client();
$client->setAccessToken('...')->setPayeeId('...');
$client->setApiVersion('3.1');

// Create paymentOrder
$purchase = new Purchase($paymentOrderObject);
$purchase->setClient($client);
$response = $purchase->send();

$paymentOrder = $response->getResponseResource()->getPaymentOrder();
echo $paymentOrder->getStatus();      // "Initialized" / "Paid" / "Aborted" / ...
echo $paymentOrder->getId();
```

For post-purchase actions (Capture, Cancel, Reversal), call `setExpands(['financialtransactions', 'paid'])`when you want the freshly-created transaction inlined in the response:

```
$capture = new TransactionCapture($transactionObject);
$capture->setClient($client);
$capture->setPaymentOrderId($paymentOrderId);
$capture->setExpands(['financialtransactions', 'paid']);

$response = $capture->send();
$latest   = $response->getResponseResource()->getLatestFinancialTransaction();
echo $latest->getType();    // "Capture"
echo $latest->getNumber();
```

Typed callback parsing:

```
use SwedbankPay\Api\Service\Paymentorder\V3\Resource\Response\CallbackPayload;

$payload = new CallbackPayload($webhookBody);
$orderRef = $payload->getOrderReference();
$paymentOrderId = $payload->getPaymentOrder()->getId();
```

###  Health Score

60

—

FairBetter than 98% of packages

Maintenance87

Actively maintained with recent releases

Popularity39

Limited adoption so far

Community27

Small or concentrated contributor base

Maturity75

Established project with proven stability

 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 ~137 days

Recently: every ~288 days

Total

28

Last Release

32d ago

Major Versions

1.0.2 → 2.0.02018-10-11

2.0.1 → 3.0.02019-05-21

3.4.0 → 4.0.0-beta.12020-01-24

4.0.2 → 5.0.02021-06-04

5.6.0 → 6.0.02023-04-22

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/49415666?v=4)[Swedbank Pay](/maintainers/swedbankpay)[@SwedbankPay](https://github.com/SwedbankPay)

---

Top Contributors

[![aait](https://avatars.githubusercontent.com/u/6286270?v=4)](https://github.com/aait "aait (294 commits)")[![asbjornu](https://avatars.githubusercontent.com/u/12283?v=4)](https://github.com/asbjornu "asbjornu (101 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (73 commits)")[![olegisk](https://avatars.githubusercontent.com/u/871275?v=4)](https://github.com/olegisk "olegisk (70 commits)")[![mergify[bot]](https://avatars.githubusercontent.com/in/10562?v=4)](https://github.com/mergify[bot] "mergify[bot] (63 commits)")[![MichaelBengtsson](https://avatars.githubusercontent.com/u/26217027?v=4)](https://github.com/MichaelBengtsson "MichaelBengtsson (27 commits)")[![shahriar-vdc](https://avatars.githubusercontent.com/u/59009669?v=4)](https://github.com/shahriar-vdc "shahriar-vdc (21 commits)")[![samtroll](https://avatars.githubusercontent.com/u/25906221?v=4)](https://github.com/samtroll "samtroll (13 commits)")[![mntzrr](https://avatars.githubusercontent.com/u/26507935?v=4)](https://github.com/mntzrr "mntzrr (5 commits)")[![mikhail-shemelin](https://avatars.githubusercontent.com/u/6575997?v=4)](https://github.com/mikhail-shemelin "mikhail-shemelin (3 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (3 commits)")[![rmilesson](https://avatars.githubusercontent.com/u/1110411?v=4)](https://github.com/rmilesson "rmilesson (3 commits)")[![trieutran91](https://avatars.githubusercontent.com/u/55382785?v=4)](https://github.com/trieutran91 "trieutran91 (3 commits)")[![dependabot-support](https://avatars.githubusercontent.com/u/112581971?v=4)](https://github.com/dependabot-support "dependabot-support (2 commits)")[![umbarov](https://avatars.githubusercontent.com/u/28846397?v=4)](https://github.com/umbarov "umbarov (1 commits)")[![hanimayahi](https://avatars.githubusercontent.com/u/4244349?v=4)](https://github.com/hanimayahi "hanimayahi (1 commits)")[![marcelOptimist](https://avatars.githubusercontent.com/u/98654247?v=4)](https://github.com/marcelOptimist "marcelOptimist (1 commits)")

---

Tags

apicomposerecomecommercepackagistpaymentpaymentsphpsdkswedbank-payswedbank-pay-sdkswedbankpayweb-apisdkpaymentsecommerceSwedbankPay

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/swedbank-pay-swedbank-pay-sdk-php/health.svg)

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

###  Alternatives

[transbank/transbank-sdk

Transbank SDK

62676.5k14](/packages/transbank-transbank-sdk)

PHPackages © 2026

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