function customRequest($methodUrl, $inputPayload, $expectedOutputFields = array(), $extensions = array(), $method = "POST", $logOutput = false, $ignoreInvalidReturnSignature = false) {

		if (array_key_exists('dttm', $inputPayload) and !$inputPayload['dttm']) {
			$inputPayload['dttm'] = $this->getDTTM();
		}

		if (array_key_exists('merchantId', $inputPayload) and !$inputPayload['merchantId']) {
			$inputPayload['merchantId'] = $this->config->merchantId;
		}

		$signature = $this->signRequest($inputPayload);
		$inputPayload['signature'] = $signature;

		$this->writeToLog("custom request to $methodUrl - start");

		try {

			$ret = $this->sendRequest(
				$methodUrl,
				$inputPayload,
				$method,
				$expectedOutputFields,
				array_keys($inputPayload),
				false,
				$ignoreInvalidReturnSignature,
				$extensions
			);

		} catch (Exception $e) {
			$this->writeToLog("Fail, got exception: " . $e->getCode().", " . $e->getMessage());
			throw $e;
		}

		$this->writeToLog("custom request to $methodUrl - OK");

		if ($logOutput) {
			$this->writeToTraceLog(print_r($ret, true));
		}

		return $ret;

	}
function customRequest($methodUrl, $inputPayload, $expectedOutputFields = array(), $extensions = array(), $method = "POST", $logOutput = false, $ignoreInvalidReturnSignature = false) {

		if (array_key_exists('dttm', $inputPayload) and !$inputPayload['dttm']) {
			$inputPayload['dttm'] = $this->getDTTM();
		}

		if (array_key_exists('merchantId', $inputPayload) and !$inputPayload['merchantId']) {
			$inputPayload['merchantId'] = $this->config->merchantId;
		}

		$signature = $this->signRequest($inputPayload);
		$inputPayload['signature'] = $signature;

		$this->writeToLog("custom request to $methodUrl - start");

		try {

			$ret = $this->sendRequest(
				$methodUrl,
				$inputPayload,
				$method,
				$expectedOutputFields,
				array_keys($inputPayload),
				false,
				$ignoreInvalidReturnSignature,
				$extensions
			);

		} catch (Exception $e) {
			$this->writeToLog("Fail, got exception: " . $e->getCode().", " . $e->getMessage());
			throw $e;
		}

		$this->writeToLog("custom request to $methodUrl - OK");

		if ($logOutput) {
			$this->writeToTraceLog(print_r($ret, true));
		}

		return $ret;

	}
function customRequest ( $ methodUrl , $ inputPayload , $ expectedOutputFields = array ( ) , $ extensions = array ( ) , $ method = "POST" , $ logOutput = false , $ ignoreInvalidReturnSignature = false ) { if ( array_key_exists ( 'dttm' , $ inputPayload ) and ! $ inputPayload [ 'dttm' ] ) { $ inputPayload [ 'dttm' ] = $ this -> getDTTM ( ) ; } if ( array_key_exists ( 'merchantId' , $ inputPayload ) and ! $ inputPayload [ 'merchantId' ] ) { $ inputPayload [ 'merchantId' ] = $ this -> config -> merchantId ; } $ signature = $ this -> signRequest ( $ inputPayload ) ; $ inputPayload [ 'signature' ] = $ signature ; $ this -> writeToLog ( "custom request to $methodUrl - start" ) ; try { $ ret = $ this -> sendRequest ( $ methodUrl , $ inputPayload , $ method , $ expectedOutputFields , array_keys ( $ inputPayload ) , false , $ ignoreInvalidReturnSignature , $ extensions ) ; } catch ( Exception $ e ) { $ this -> writeToLog ( "Fail, got exception: " . $ e -> getCode ( ) . ", " . $ e -> getMessage ( ) ) ; throw $ e ; } $ this -> writeToLog ( "custom request to $methodUrl - OK" ) ; if ( $ logOutput ) { $ this -> writeToTraceLog ( print_r ( $ ret , true ) ) ; } return $ ret ; }
Sends an arbitrary request to bank's API with any parameters.

Use this method to call various masterpass/* API methods or any methods of
API versions that may come in future and are not implemented in this library yet.

$inputPayload is an associative array with data in order in which they should be signed.
You can leave *dttm* and *merchantId* empty or null, their values will be filled automatically,
however you can't omit them completely, since they are required in the signature.
Signature field will be added automatically.

$expectedOutputFields should be ordinary array of field names in order they appear in the response.
Their order in the array is important to verify response signature. You can leave this empty, the
base string will be created on order as the keys appear in the response. However, it can't be guaranteed
it is the correct order. If you want it to be more reliable, I recommend to define it.

Example - testing post connection:

```php
$client->customRequest(
'echo',
array(
'merchantId' => null,
'dttm' => null
)
);
```

@param string $methodUrl API method name, without leading slash, ie. "payment/init"
@param array $inputPayload Input payload in form of associative array. Order of items is significant.
@param array $expectedOutputFields Expected field names of response in order in which they should be returned.
@param Extension[]|Extension $extensions
@param string $method HTTP method
@param bool $logOutput Should be the complete output logged into debug log?
@param bool $ignoreInvalidReturnSignature If set to true, then in case of invalid signature of returned data,
no exception will be thrown and method will return received data as usual. Then, you should handle the situation by yourself.
Do not use this option on regular basis, it is intended only as workaround for cases when returned data or its signature is more complex
and its verification fails for some reason.

@return array|string
Sends an arbitrary request to bank s API with any parameters .