public static function validate($partener_package, $trusted_shops_id, $action = self::ACTIVATE) { $ini = ini_set('soap.wsdl_cache_enabled', 1); $result = self::RT_SOAP_ERROR; try { $wsdlUrl = 'https://' . self::TS_SERVER . '/ts/services/TsRating?wsdl'; $client = new SoapClient($wsdlUrl); $result = $client->updateRatingWidgetState($trusted_shops_id, $action, self::WS_USER, self::WS_PASSWORD, $partener_package); } catch (SoapFault $fault) { $errorText = 'SOAP Fault: (faultcode:{$fault->faultcode}, faultstring:{$fault->faultstring})'; /** Enable this line if you are experiencing issues with your Trusted Shops ID activation. die($errorText); */ } if ($result == self::RT_WRONG_LOGIN) { die('Wrong login/password'); } return $result; }
/** * Validates Ts language id and returns validatsion status message * * @param string $sId Trusted Shops Id * @param string $blActive Widget mode - active or not * @param string $sUser Trusted Shops User name * @param string $sPass Trusted Shops Password * @param string $sPkg Package Name * * @return string | bool */ protected function _validateId($sId, $blActive, $sUser, $sPass, $sPkg) { $sReturn = false; if ($sWsdl = $this->_getServiceWsdl()) { try { $oClient = new SoapClient($sWsdl); $sReturn = $oClient->updateRatingWidgetState($sId, (int) $blActive, $sUser, $sPass, $sPkg); } catch (SoapFault $oFault) { $sReturn = $oFault->faultstring; } } return $sReturn; }
/** * Call the SOAP API of Trusted Shops * * @param array $sendData data to send * @param array $soapUrl soap url * * @return string */ private function _callTrustedShopsApi($sendData, $soapUrl) { $returnValue = 'SOAP_ERROR'; try { $client = new SoapClient($soapUrl); $returnValue = $client->updateRatingWidgetState($sendData['tsId'], $sendData['activation'], $sendData['wsUser'], $sendData['wsPassword'], $sendData['partnerPackage']); } catch (SoapFault $fault) { $errorText = 'SOAP Fault: (faultcode: ' . $fault->faultcode; $errorText .= ', faultstring: ' . $fault->faultstring . ')'; Mage::log($errorText); } return $returnValue; }