public function signResponse(RequestMerchInfoWSResponse $wsResponse, $privateKeyPath) { $dataToBeHashed = $wsResponse->getToken() . $wsResponse->getPosUrl() . $wsResponse->getPosUid() . $wsResponse->getPosPwd() . $wsResponse->isS3Dauth() . $wsResponse->getMpiUrl() . $wsResponse->getMpiUid() . $wsResponse->getMpiPwd() . $wsResponse->getMd() . $wsResponse->getXid() . $wsResponse->isS3DFDec() . $wsResponse->getCIp() . $wsResponse->getExtra() . $wsResponse->getTimestamp(); return base64_encode(Certificate::sign($dataToBeHashed, $privateKeyPath)); }