picios/dlocksdk

php sdk for DLock API

Installs: 5

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/picios/dlocksdk

v1.0.2 2025-12-30 10:06 UTC

This package is auto-updated.

Last update: 2025-12-30 10:07:28 UTC


README

This library helps to connect to DLock API with PHP

Installation

Install with composer

composer require picios/dlocksdk

Usage

Creating a new token

You need to create a connection object first and then use it in request

<?php

use Picios\DlockSDK\DlockSDKConnection;
use Picios\DlockSDK\Request\DlockSDKAuth;

require_once __DIR__ . '/vendor/autoload.php';
$connection = new DlockSDKConnection(
        'https://example.com',
        'partner_address_123'
);

$auth = new DlockSDKAuth($connection);
$response = $auth->getQRcodeImage(
    'session_id',
    'https://example.com/webhook/123'
);

if ($response->isSuccess()) {
    die($response->getContent());
}

Testing

To test the class, run:

phpunit test