<?php
namespace PhpOffice\PhpSpreadsheet\Calculation\Web;
use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
use PhpOffice\PhpSpreadsheet\Settings;
use Psr\Http\Client\ClientExceptionInterface;
class Service
{
/**
* WEBSERVICE.
*
* Returns data from a web service on the Internet or Intranet.
*
* Excel Function:
* Webservice(url)
*
* @return string the output resulting from a call to the webservice
*/
public static function webService(string $url)
{
$url = trim($url);
if (strlen($url) > 2048) {
return ExcelError::VALUE(); // Invalid URL length
}
if (!preg_match('/^http[s]?:\/\//', $url)) {
return ExcelError::VALUE(); // Invalid protocol
}
// Get results from the the webservice
$client = Settings::getHttpClient();
$requestFactory = Settings::getRequestFactory();
$request = $requestFactory->createRequest('GET', $url);
try {
$response = $client->sendRequest($request);
} catch (ClientExceptionInterface $e) {
return ExcelError::VALUE(); // cURL error
}
if ($response->getStatusCode() != 200) {
return ExcelError::VALUE(); // cURL error
}
$output = $response->getBody()->getContents();
if (strlen($output) > 32767) {
return ExcelError::VALUE(); // Output not a string or too long
}
return $output;
}
/**
* URLENCODE.
*
* Returns data from a web service on the Internet or Intranet.
*
* Excel Function:
* urlEncode(text)
*
* @param mixed $text
*
* @return string the url encoded output
*/
public static function urlEncode($text)
{
if (!is_string($text)) {
return ExcelError::VALUE();
}
return str_replace('+', '%20', urlencode($text));
}
}
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.