PHPackages                             shahmarasy/swish-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. [Payment Processing](/categories/payments)
4. /
5. shahmarasy/swish-php

ActiveLibrary[Payment Processing](/categories/payments)

shahmarasy/swish-php
====================

Production-grade PHP SDK for the Swish Payment Gateway with mTLS support

v1.0.1(4mo ago)07MITPHPPHP ^8.2

Since Feb 14Pushed 4mo agoCompare

[ Source](https://github.com/shahmarasy/swish-php)[ Packagist](https://packagist.org/packages/shahmarasy/swish-php)[ Docs](https://github.com/shahmarasy/swish-php)[ RSS](/packages/shahmarasy-swish-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (3)Used By (0)

Swish PHP SDK
=============

[](#swish-php-sdk)

A **production-grade PHP SDK** for the [Swish Payment Gateway](https://developer.swish.nu/) with full mTLS support, comprehensive API coverage, and clean architecture.

[![PHP Version](https://camo.githubusercontent.com/187240af044d09d5b14a1d9d9ebdf3f7a993e4c7bc09bdb46b4ba661a891bf5b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d626c7565)](https://www.php.net/)[![License: MIT](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](LICENSE)

---

Features
--------

[](#features)

- **Full API Coverage** — Payment Requests (v2), Refunds (v2), Payouts (v1)
- **mTLS Security** — Client certificate authentication with TLS 1.2+
- **Immutable DTOs** — Type-safe, readonly data objects
- **Typed Enums** — `PaymentStatus`, `RefundStatus`, `PayoutStatus`, `Currency`, `Environment`
- **Robust Error Handling** — Exception hierarchy mapping HTTP codes to meaningful errors
- **Retry Strategy** — Configurable exponential backoff for transient failures
- **PSR-3 Logging** — Inject any PSR-3 logger
- **DI Friendly** — Interface-driven, no static anti-patterns
- **Idempotency** — Auto-generated instruction UUIDs (or bring your own)
- **Callback Parsing** — Parse Swish webhooks into typed DTOs
- **Payout Signing** — SHA-512 + RSA payload signing built-in

---

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

[](#installation)

```
composer require shahmarasy/swish-php
```

Requires **PHP 8.2+** and the following extensions: `curl`, `openssl`, `json`.

---

Quick Start
-----------

[](#quick-start)

```
