<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Uid;
/**
* A v1 UUID contains a 60-bit timestamp and 62 extra unique bits.
*
* @author Grégoire Pineau <lyrixx@lyrixx.info>
*/
class UuidV1 extends Uuid
{
protected const TYPE = 1;
private static ?string $clockSeq = null;
public function __construct(string $uuid = null)
{
if (null === $uuid) {
$this->uid = uuid_create(static::TYPE);
} else {
parent::__construct($uuid, true);
}
}
public function getDateTime(): \DateTimeImmutable
{
return BinaryUtil::hexToDateTime('0'.substr($this->uid, 15, 3).substr($this->uid, 9, 4).substr($this->uid, 0, 8));
}
public function getNode(): string
{
return uuid_mac($this->uid);
}
public static function generate(\DateTimeInterface $time = null, Uuid $node = null): string
{
$uuid = !$time || !$node ? uuid_create(static::TYPE) : parent::NIL;
if ($time) {
if ($node) {
// use clock_seq from the node
$seq = substr($node->uid, 19, 4);
} else {
// generate a static random clock_seq to prevent any collisions with the real one
$seq = substr($uuid, 19, 4);
while (null === self::$clockSeq || $seq === self::$clockSeq) {
self::$clockSeq = sprintf('%04x', random_int(0, 0x3FFF) | 0x8000);
}
$seq = self::$clockSeq;
}
$time = BinaryUtil::dateTimeToHex($time);
$uuid = substr($time, 8).'-'.substr($time, 4, 4).'-1'.substr($time, 1, 3).'-'.$seq.substr($uuid, 23);
}
if ($node) {
$uuid = substr($uuid, 0, 24).substr($node->uid, 24);
}
return $uuid;
}
}
Welcome to the Kueue Pay Payment Gateway Solutions Developer API Documentation. This comprehensive guide will empower you to seamlessly integrate our advanced payment gateway into your website, enhancing your customers’ payment experience and enabling efficient transaction processing. The Kueue Pay Developer API is designed for developers and entrepreneurs who seek simplicity, security, and reliability in their payment processing solutions.
The Kueue Pay Developer API allows you to seamlessly integrate Kueue Pay’s Payment Gateway Solutions into your website, enabling secure and efficient debit and credit card transactions. With our API, you can initiate payments, check payment statuses, and even process refunds, all while ensuring a smooth and streamlined payment experience for your customers.