PHPackages                             scanpay/scanpay - 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. scanpay/scanpay

ActiveLibrary[Payment Processing](/categories/payments)

scanpay/scanpay
===============

PHP client for the Scanpay API

v2.1.1(2y ago)15.3k↓28.1%MITPHPPHP &gt;=7.4

Since Feb 2Pushed 2y ago3 watchersCompare

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

READMEChangelog (10)DependenciesVersions (15)Used By (0)

Scanpay PHP client
==================

[](#scanpay-php-client)

[![Latest Stable Version](https://camo.githubusercontent.com/fa4214238cb7f15857c73a05378efdd84c23f6c38f76ee5f396adb262e681237/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f7363616e7061792f7068702d7363616e7061793f63616368655365636f6e64733d363030)](https://packagist.org/packages/scanpay/scanpay)[![License](https://camo.githubusercontent.com/ceed66b8ae318891a2fa195ef8a21575e86d739ddfd199a42c5e269e277ff4f3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7363616e7061792f7068702d7363616e7061793f63616368655365636f6e64733d36303030)](https://github.com/scanpay/php-scanpay/blob/master/LICENSE)[![CodeFactor](https://camo.githubusercontent.com/abe00f1f66b4b95bb2ad7b29f8eb599eddc4cf3d5cae7b937f82d915ec9927f9/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f7363616e7061792f7068702d7363616e7061792f6261646765)](https://www.codefactor.io/repository/github/scanpay/php-scanpay)

The Scanpay PHP client library provides convenient and simplified access to the Scanpay API from programs written in PHP. The library is developed and maintained by Scanpay in Denmark.

If you have any questions, concerns or ideas, please do not hesitate to e-mail us at . Feel free to join our IRC server `irc.scanpay.dev:6697 #support` or chat with us at [chat.scanpay.dev](https://chat.scanpay.dev).

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

[](#requirements)

PHP version &gt;= 7.4 with php-curl (libcurl &gt;= 7.60.0). See [compatibility table](#compatibility-table).

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

[](#installation)

The package is published at [Packagist](https://packagist.org/packages/scanpay/scanpay). You can install the library via [Composer](http://getcomposer.org/):

```
composer require scanpay/scanpay
```

You can then include it in your project with:

```
require 'vendor/autoload.php'; // composer autoload
$scanpay = new Scanpay\Scanpay('API key');
```

### Manual installation

[](#manual-installation)

If you do not wish to use Composer, you can download the [latest release](https://github.com/scanpay/php-scanpay/releases) and include it in your project:

```
require 'lib/Scanpay.php';
$scanpay = new Scanpay\Scanpay('API key');
```

Usage
-----

[](#usage)

The API documentation is available [here](https://docs.scanpay.dev/). Most methods accept an optional per-request array with [options](#options), referred to as `$options`.

#### newURL(Array, $options): String

[](#newurlarray-options-string)

Create a link to our hosted payment window ([docs](https://docs.scanpay.dev/payment-link) | [example](tests/newURL.php)).

```
$order = [
    'orderid'    => 'order_184',
    'items' => [
        [
            'name'     => 'Pink Floyd: The Dark Side Of The Moon',
            'total'    => '199.99 DKK'
        ]
    ]
];
$paymentLink = $scanpay->newURL($order, $options);
```

#### seq(Integer, $options): Array

[](#seqinteger-options-array)

Fetch changes after a specified sequence number ([docs](https://docs.scanpay.dev/synchronization#sequence-request) | [example](tests/seq.php)).

```
$localSeq = (int) $yourDB['seq']; // Locally stored sequence number
$arr = $scanpay->seq($localSeq, $options);
foreach ($arr['changes'] as $change) {
    print_r($change); // Apply change in your DB
}
$localSeq = (int) $arr.seq;
```

#### parsePing(String, String): Array

[](#parsepingstring-string-array)

Validate and parse scanpay pings ([docs](https://docs.scanpay.dev/synchronization#ping-service) | [example](tests/parsePing.php)).

```
$ping = $scanpay->parsePing(
    file_get_contents('php://input', false, null, 0, 512),
    $_SERVER['HTTP_X_SIGNATURE'] // X-Signature HTTP header
);
```

#### capture(Integer, Array, $options): Array

[](#captureinteger-array-options-array)

Capture an authorized amount from a transaction ([docs](https://docs.scanpay.dev/transactions) | [example](tests/charge.php#L66-L69)).
The `index` is the number of actions recorded by your system, and it's a security measure against double captures.

```
$order = (arr) $yourDB.getOrder('order_184');
$trnID = (int) $order['scanpay']['id'];
$nActs = count($order['scanpay']['acts']); // $change['acts'] from seq()
$data = [
    'total' => $order['amount'], // e.g. '199,99 DKK'
    'index' => $nActs,
];
$scanpay->capture($trnID, $data, $options);
```

#### charge(Integer, Array, $options): Array

[](#chargeinteger-array-options-array)

Charge a subscriber ([docs](https://docs.scanpay.dev/subscriptions/charge-subscriber) | [example](tests/charge.php)).

```
$subscriberid = 2;
$charge = [
    'orderid'    => 'charge_1023',
    'items'    => [
        [
            'name'     => 'Pink Floyd: The Dark Side Of The Moon',
            'total'    => '199.99 DKK',
        ]
    ]
];
$scanpay->charge($subscriberid, $charge, $options);
```

#### renew(Integer, Array, $options): String

[](#renewinteger-array-options-string)

Create a link to renew the payment method for a subscriber. ([docs](https://docs.scanpay.dev/subscriptions/renew-subscriber) | [example](tests/renew.php)).

```
$subcriptionLink = $scanpay->renew($subscriberid, [], $options);
```

Options
-------

[](#options)

All methods, except `parsePing`, accept an optional per-request `$options` array. You can use this to:

- Set HTTP headers, e.g. the highly recommended `X-Cardholder-IP` ([example](tests/options.php#L17-L22))
- Override API key ([example](tests/options.php#L19))
- Change the hostname to use our test environment `api.scanpay.dev` ([example](tests/options.php#L14))
- Enable debugging mode ([example](tests/options.php#L25))
- Override cURL options with [`CURLOPT_*`](https://php.net/manual/en/function.curl-setopt.php) parameters ([example](tests/options.php#L28-L31)).

Compatibility table
-------------------

[](#compatibility-table)

PHPVersionCurlHandle class (polyfilled)8.0Typed class properties7.4Type declarations7.4Null coalescing operator7.4hash\_equals5.6curl\_strerror5.5License
-------

[](#license)

Everything in this repository is licensed under the [MIT license](LICENSE).

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 77.1% of commits — single point of failure

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

Recently: every ~372 days

Total

14

Last Release

931d ago

Major Versions

v1.5.3 → v2.0.02023-10-06

PHP version history (3 changes)v1.0.0PHP &gt;5.3.2

v1.2.0PHP &gt;=5.6.0

v2.0.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/57f5e666ece8abf8984946303eedd88849dcb83376db9ae290c9c9594ca2fafa?d=identicon)[scanpay](/maintainers/scanpay)

![](https://avatars.githubusercontent.com/u/1418021?v=4)[Ulrik Moe](/maintainers/ulrikmoe)[@ulrikmoe](https://github.com/ulrikmoe)

---

Top Contributors

[![ulrikmoe](https://avatars.githubusercontent.com/u/1418021?v=4)](https://github.com/ulrikmoe "ulrikmoe (74 commits)")[![cblach](https://avatars.githubusercontent.com/u/5312687?v=4)](https://github.com/cblach "cblach (22 commits)")

---

Tags

paymentsphpscanpaypaymentspayment gatewaypayment service provider

### Embed Badge

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

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

###  Alternatives

[cybersource/rest-client-php

Client SDK for CyberSource REST APIs

39881.3k6](/packages/cybersource-rest-client-php)[razorpay/magento

Razorpay Magento 2.0 plugin for accepting payments.

3076.5k1](/packages/razorpay-magento)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)

PHPackages © 2026

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