Nuevas Características: • Visualizador de pagos mensuales con gráfica de dona (Chart.js) • Tarjetas estadísticas: clientes activos, pagados y pendientes • Tabla de clientes pendientes con saldos en tiempo real • Microservicio Node.js para metadata de Stripe (acceso directo a BD) Mejoras: • Fix crítico: Sincronización automática de saldo en CallBell al agregar facturas • Categorización mejorada de pagos OXXO y Transferencias Stripe • Normalización de valores: "OXXO" → "OXXO Pay" para evitar errores 422 • Configuración .env para credenciales de base de datos Correcciones: • Saldo y estado ahora se actualizan correctamente en CallBell • Fix networking Docker (ECONNREFUSED resuelto) • Fix validación de atributos en API de UCRM • Actualización automática de userId en pagos Stripe Archivos principales: public.php (visualizador de pagos) AbstractMessageNotifierFacade.php (logging sync) ClientCallBellAPI.php (comparación de campos) AbstractStripeOperationsFacade.php (normalización) manifest.json, README.md, CHANGELOG.md (docs)
120 lines
2.4 KiB
PHP
Executable File
120 lines
2.4 KiB
PHP
Executable File
<?php
|
|
namespace Aws\Crypto;
|
|
|
|
use GuzzleHttp\Psr7;
|
|
use GuzzleHttp\Psr7\StreamDecoratorTrait;
|
|
use Psr\Http\Message\StreamInterface;
|
|
|
|
/**
|
|
* @internal Represents a stream of data to be gcm encrypted.
|
|
*/
|
|
class AesGcmEncryptingStream implements AesStreamInterface, AesStreamInterfaceV2
|
|
{
|
|
use StreamDecoratorTrait;
|
|
|
|
private $aad;
|
|
|
|
private $initializationVector;
|
|
|
|
private $key;
|
|
|
|
private $keySize;
|
|
|
|
private $plaintext;
|
|
|
|
private $tag = '';
|
|
|
|
private $tagLength;
|
|
|
|
/**
|
|
* @var StreamInterface
|
|
*/
|
|
private $stream;
|
|
|
|
/**
|
|
* Same as non-static 'getAesName' method, allowing calls in a static
|
|
* context.
|
|
*
|
|
* @return string
|
|
*/
|
|
public static function getStaticAesName()
|
|
{
|
|
return 'AES/GCM/NoPadding';
|
|
}
|
|
|
|
/**
|
|
* @param StreamInterface $plaintext
|
|
* @param string $key
|
|
* @param string $initializationVector
|
|
* @param string $aad
|
|
* @param int $tagLength
|
|
* @param int $keySize
|
|
*/
|
|
public function __construct(
|
|
StreamInterface $plaintext,
|
|
$key,
|
|
$initializationVector,
|
|
$aad = '',
|
|
$tagLength = 16,
|
|
$keySize = 256
|
|
) {
|
|
|
|
$this->plaintext = $plaintext;
|
|
$this->key = $key;
|
|
$this->initializationVector = $initializationVector;
|
|
$this->aad = $aad;
|
|
$this->tagLength = $tagLength;
|
|
$this->keySize = $keySize;
|
|
// unsetting the property forces the first access to go through
|
|
// __get().
|
|
unset($this->stream);
|
|
}
|
|
|
|
public function getOpenSslName()
|
|
{
|
|
return "aes-{$this->keySize}-gcm";
|
|
}
|
|
|
|
/**
|
|
* Same as static method and retained for backwards compatibility
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getAesName()
|
|
{
|
|
return self::getStaticAesName();
|
|
}
|
|
|
|
public function getCurrentIv()
|
|
{
|
|
return $this->initializationVector;
|
|
}
|
|
|
|
public function createStream()
|
|
{
|
|
return Psr7\Utils::streamFor(\openssl_encrypt(
|
|
(string)$this->plaintext,
|
|
$this->getOpenSslName(),
|
|
$this->key,
|
|
OPENSSL_RAW_DATA,
|
|
$this->initializationVector,
|
|
$this->tag,
|
|
$this->aad,
|
|
$this->tagLength
|
|
));
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getTag()
|
|
{
|
|
return $this->tag;
|
|
}
|
|
|
|
public function isWritable(): bool
|
|
{
|
|
return false;
|
|
}
|
|
}
|