src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php
private function _calculateStringToSignV2(array $parameters) {
        $data = 'POST';
        $data .= "\n";
        $endpoint = parse_url ($this->_config['ServiceURL']);
        $data .= $endpoint['host'];
        $data .= "\n";
        $uri = array_key_exists('path', $endpoint) ? $endpoint['path'] : null;
        if (!isset ($uri)) {
        	$uri = "/";
        }
		$uriencoded = implode("/", array_map(array($this, "_urlencode"), explode("/", $uri)));
        $data .= $uriencoded;
        $data .= "\n";
        uksort($parameters, 'strcmp');
        $data .= $this->_getParametersAsString($parameters);
        return $data;
    }
private function _calculateStringToSignV2(array $parameters) {
        $data = 'POST';
        $data .= "\n";
        $endpoint = parse_url ($this->_config['ServiceURL']);
        $data .= $endpoint['host'];
        $data .= "\n";
        $uri = array_key_exists('path', $endpoint) ? $endpoint['path'] : null;
        if (!isset ($uri)) {
        	$uri = "/";
        }
		$uriencoded = implode("/", array_map(array($this, "_urlencode"), explode("/", $uri)));
        $data .= $uriencoded;
        $data .= "\n";
        uksort($parameters, 'strcmp');
        $data .= $this->_getParametersAsString($parameters);
        return $data;
    }
private function _calculateStringToSignV2 ( array $ parameters ) { $ data = 'POST' ; $ data .= "\n" ; $ endpoint = parse_url ( $ this -> _config [ 'ServiceURL' ] ) ; $ data .= $ endpoint [ 'host' ] ; $ data .= "\n" ; $ uri = array_key_exists ( 'path' , $ endpoint ) ? $ endpoint [ 'path' ] : null ; if ( ! isset ( $ uri ) ) { $ uri = "/" ; } $ uriencoded = implode ( "/" , array_map ( array ( $ this , "_urlencode" ) , explode ( "/" , $ uri ) ) ) ; $ data .= $ uriencoded ; $ data .= "\n" ; uksort ( $ parameters , 'strcmp' ) ; $ data .= $ this -> _getParametersAsString ( $ parameters ) ; return $ data ; }
Calculate String to Sign for SignatureVersion 2
@param array $parameters request parameters
@return String to Sign
Calculate String to Sign for SignatureVersion 2