# fluent-cart/1.5.3/app/Modules/PaymentMethods/StripeGateway/API/RequestProcessor.php

FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler, version 1.5.3. 37 lines.

- Page: https://pluginprobe.com/plugins/fluent-cart/1.5.3/code/app/Modules/PaymentMethods/StripeGateway/API/RequestProcessor.php
- Raw: https://pluginprobe.com/plugins/fluent-cart/1.5.3/raw/app/Modules/PaymentMethods/StripeGateway/API/RequestProcessor.php
- Modified: 2025-10-14T16:36:46+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-cart/1.5.3/code/app/Modules/PaymentMethods/StripeGateway/API/RequestProcessor.php#L10-L20`.

```php
<?php

namespace FluentCart\App\Modules\PaymentMethods\StripeGateway\API;

trait RequestProcessor
{
	private static function processResponse($response)
	{
		if (!empty($response->error)) {
			$errorType = 'general';

			if (!empty($response->error->type)) {
				$errorType = $response->error->type;
			}

			$errorCode = '';

			if (!empty($response->error->code)) {
				$errorCode = $response->error->code . ' : ';
			}

			return static::errorHandler($errorType, $errorCode . $response->error->message);
		}

		if (false !== $response) {
			return $response;
		}
		
		return false;
	}

	private static function errorHandler($code, $message, $data = [])
	{
		return new \WP_Error($code, $message, $data);
	}
}

```
