vipkwd / qrcdr-sdk
The SDK for VK-Qrcdr system.
dev-master
2024-10-17 05:13 UTC
Requires
- php: >=7.4
This package is not auto-updated.
Last update: 2025-03-10 04:21:49 UTC
README
The SDK for VK-Qrcdr system.
Installing.
Install library via composer:
composer require vipkwd/qrcdr-sdk
Usage.
一. 初始化 SDK
use \Vipkwd\SDK\Qrcdr;
// $appId = "fd206e5bdd860d44";
// $appKey = "21a7888c50dbf1e4b30900f4c59eb0f1";
// $api = 'http://qrcode.hosts.run/v1/api/generator';
$sdk = new Qrcdr(string $appId, string $appKey, ?string $api = null):Object;
二、生成 qrcode
$params = [
'level' => 'M' // L|M|Q|H
'style' => 'default' // 3d|plus|default|circle
'size' => 4 // min( max( ?? , 4 ), 32)
];
$response = $sdk->url('https://www.demo.com?query_string', array $params = []):array;
$response = $sdk->text('some text...', array $params = []):array;
// $emailData = [
// 'to' => 'admin@admin.com',
// 'subject' => 'test',
// 'body' => 'This is a test email.',
// ];
$response = $sdk->email(array $emailData, array $params = []):array;
// $wifiData = [
// 'ssid' => 'ssid',
// 'pass' => 'pass',
// 'network' => '', // WPA/WEP/空
// 'hide' => 1,
// ];
$response = $sdk->wifi(array $wifiData, array $params = []):array;
// $telData = [
// 'countrycode' => '86',
// 'tel' => '123456789'
// ];
$response = $sdk->tel(array $telData, array $params = []):array;
// $smsData = [
// 'countrycode' => '86',
// 'number' => '123456789'
// 'body' => 'This is a test sms.',
// ];
$response = $sdk->sms(array $smsData, array $params = []):array;
$whatsData = [
'countrycode' => '1',
'number' => '123456789'
'message' => 'This is a test sms.',
];
$response = $sdk->whatsapp(array $whatsData, array $params = []):array;
// $locationData = [
// 'lat' => 'bala bala',
// 'lng' => 'laba laba'
// ];
$response = $sdk->location(array $locationData, array $params = []):array;
// $bitcoinData = [
// 'account' => '',
// 'amount' => '',
// 'label' => '',
// 'message' => 'This is a test.',
// ];
$response = $sdk->bitcoin(array $bitcoinData, array $params = []):array;
三 Response
Array (
[png] => 1
[svg] => 0
[eps] => 0
[section] => text
[key] => 03ac1c879c39d261d66dd322b0e96e16
[size] => 285
[height] => 116
[width] => 116
[type] => png
[base64] => iVBORw0KGgoAAAAN****************************************
[fid] => 5
)