siip-stripe-payment_intents/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php
DANYDHSV c43bb924d7 feat: lanzamiento inicial del plugin Generador de Payment Intents
- Implementado servicio backend [PaymentIntentService](cci:2://file:///home/unms/data/ucrm/ucrm/data/plugins/siip-stripe-payment_intents/src/PaymentIntentService.php:8:0-152:1) para manejar interacciones con API de UCRM y Stripe.
- Creado frontend moderno y responsivo en HTML/JS dentro de [public.php](cci:7://file:///home/unms/data/ucrm/ucrm/data/plugins/siip-stripe-payment_intents/public.php:0:0-0:0).
- Agregada búsqueda con autocompletado para clientes.
- Agregada validación para Stripe Customer ID y monto mínimo.
- Integrada la creación de Payment Intents de Stripe para fondos tipo `customer_balance`.
- Agregada documentación (README.md, CHANGELOG.md) y limpieza de archivos legado.
2025-12-16 13:56:31 -06:00

52 lines
2.0 KiB
PHP

<?php
namespace GuzzleHttp\Handler;
use GuzzleHttp\Promise\PromiseInterface;
use GuzzleHttp\RequestOptions;
use Psr\Http\Message\RequestInterface;
/**
* Provides basic proxies for handlers.
*
* @final
*/
class Proxy
{
/**
* Sends synchronous requests to a specific handler while sending all other
* requests to another handler.
*
* @param callable(RequestInterface, array): PromiseInterface $default Handler used for normal responses
* @param callable(RequestInterface, array): PromiseInterface $sync Handler used for synchronous responses.
*
* @return callable(RequestInterface, array): PromiseInterface Returns the composed handler.
*/
public static function wrapSync(callable $default, callable $sync): callable
{
return static function (RequestInterface $request, array $options) use ($default, $sync): PromiseInterface {
return empty($options[RequestOptions::SYNCHRONOUS]) ? $default($request, $options) : $sync($request, $options);
};
}
/**
* Sends streaming requests to a streaming compatible handler while sending
* all other requests to a default handler.
*
* This, for example, could be useful for taking advantage of the
* performance benefits of curl while still supporting true streaming
* through the StreamHandler.
*
* @param callable(RequestInterface, array): PromiseInterface $default Handler used for non-streaming responses
* @param callable(RequestInterface, array): PromiseInterface $streaming Handler used for streaming responses
*
* @return callable(RequestInterface, array): PromiseInterface Returns the composed handler.
*/
public static function wrapStreaming(callable $default, callable $streaming): callable
{
return static function (RequestInterface $request, array $options) use ($default, $streaming): PromiseInterface {
return empty($options['stream']) ? $default($request, $options) : $streaming($request, $options);
};
}
}