# monei/7.1.3/src/Services/sdk/MoneiSdkClientFactory.php

MONEI Payments for WooCommerce, version 7.1.3. 35 lines.

- Page: https://pluginprobe.com/plugins/monei/7.1.3/code/src/Services/sdk/MoneiSdkClientFactory.php
- Raw: https://pluginprobe.com/plugins/monei/7.1.3/raw/src/Services/sdk/MoneiSdkClientFactory.php
- Modified: 2025-10-01T14:06:00+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/monei/7.1.3/code/src/Services/sdk/MoneiSdkClientFactory.php#L10-L20`.

```php
<?php

namespace Monei\Services\sdk;

use Monei\Configuration;
use Monei\MoneiClient;
use Monei\Services\ApiKeyService;

class MoneiSdkClientFactory {
	private ApiKeyService $apiKeyService;
	private $client;

	public function __construct( ApiKeyService $apiKeyService ) {
		$this->apiKeyService = $apiKeyService;
		$this->client        = null;
	}

	/**
	 * @return MoneiClient
	 */
	public function get_client() {
		if ( $this->client === null ) {
			include_once WC_Monei()->plugin_path() . '/vendor/autoload.php';
			$config       = Configuration::getDefaultConfiguration();
			$this->client = new MoneiClient( $this->apiKeyService->get_api_key(), $config );
			$this->client->setUserAgent(
				'MONEI/WooCommerce/' . WC_Monei()->version .
				' (WordPress v' . get_bloginfo( 'version' ) .
				'; Woo v' . WC()->version .
				'; PHP v' . phpversion() . ')'
			);      }
		return $this->client;
	}
}

```
