Scanpay PHP client library
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Scanpay PHP Client

PHP client library for the Scanpay API. You can always e-mail us at or chat with us on or #scanpay at Freenode (webchat)


You need PHP version >= 5.6 with php-curl enabled. The package is published at Packagist. You can install the client via Composer:

composer require scanpay/scanpay

And initiate it in your project with:

$scanpay = new Scanpay\Scanpay(' API-key ');

Manual installation

If you do not wish to use Composer, you can download the latest release and include in into your project:

$scanpay = new Scanpay\Scanpay(' API-key ');


Please note that all methods accept an optional per-request options object. You can read more about this here.

newURL(Object, Object)

Create a payment link by passing the order details (spec) through newURL:

$order = [
    'items' => [
            'name'     => 'Pink Floyd: The Dark Side Of The Moon',
            'total'    => '199.99 DKK'
print_r ($URL = $scanpay->newURL($order, $options)); // returns String

seq(Int, Object)

Get an array with a number of changes since the supplied sequence number:

$localSeq = 921;
$obj = $scanpay->seq($localSeq, $options);
print_r (obj.changes);
print_r ('New local seq after applying all changes: ' . obj.seq);


Securely and efficiently validate pings. This method accepts an optional object with the following arguments:

  • signature, ie. a string with the X-Signature header (String)
  • body, ie. the HTTP message body (String).
  • debug default is false. (Boolean)
print_r ($json = $scanpay->handlePing());
print_r ($json.seq);


All methods, except handlePing, accept an optional per-request options object. You can use this to:

  • Set the API key for this request (example)
  • Set HTTP headers, e.g. the highly recommended X-Cardholder-IP (example)
  • Change the hostname to use our test environment (example)
  • Enable debugging mode (example)
  • Override cURL options with CURLOPT_* parameters (example).

Compatibility table

Feature Version
hash_equals 5.6
curl_strerror 5.5
Array, short syntax 5.4
Namespaces 5.3.0
json_decode 5.2.0
curl_setopt_array 5.1.3
hash_hmac 5.1.2
Exception class 5.1.0
Default function parameters 5.0.0


Everything in this repository is licensed under the MIT license.