paynl/unifiedqr

Library to encode and decode payment UUID

v1.1.0 2023-07-06 11:33 UTC

This package is auto-updated.

Last update: 2024-05-06 14:08:27 UTC


README

Library to encode and decode payment UUID

Installation

This library uses composer.

Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.

For more information on how to use/install composer, please visit: https://github.com/composer/composer

To install the Pay.nl PHP sdk into your project, simply

$ composer require paynl/unifiedQR

Quick start and examples

Encode dynamic QR

require __DIR__ . '/vendor/autoload.php';

$UUID = \Paynl\QR\UUID::encode(\Paynl\QR\UUID::QR_TYPE_DYNAMIC, [
    'serviceId'     => 'SL-1234-5678',
    'secret'        => '0e8debc04c0dce170a1de4205053bd3ed6fd132f',
    'reference'     => '0123456',
    'referenceType' => \Paynl\QR\UUID::REFERENCE_TYPE_STRING
]);

var_dump($UUID);

Decode dynamic QR

require __DIR__ . '/vendor/autoload.php';

$UUID = \Paynl\QR\UUID::decode([
    'secret' => '0e8debc04c0dce170a1de4205053bd3ed6fd132f',
    'uuid'   => $UUID
]);

var_dump($UUID);