34 "TS080501_500_30_EUR" => array(
"GBP" =>
"TS100629_500_30_GBP",
"CHF" =>
"TS100629_500_30_CHF",
"USD" =>
"TS080501_500_30_USD"),
35 "TS080501_1500_30_EUR" => array(
"GBP" =>
"TS100629_1500_30_GBP",
"CHF" =>
"TS100629_1500_30_CHF",
"USD" =>
"TS100629_1500_30_USD"),
36 "TS080501_2500_30_EUR" => array(
"GBP" =>
"TS100629_2500_30_GBP",
"CHF" =>
"TS100629_2500_30_CHF",
"USD" =>
"TS100629_2500_30_USD"),
37 "TS080501_5000_30_EUR" => array(
"GBP" =>
"TS100629_5000_30_GBP",
"CHF" =>
"TS100629_5000_30_CHF",
"USD" =>
"TS100629_5000_30_USD"),
38 "TS080501_10000_30_EUR" => array(
"GBP" =>
"TS100629_1000_30_GBP",
"CHF" =>
"TS100629_10000_30_CHF",
"USD" =>
"TS100629_10000_30_USD"),
39 "TS080501_20000_30_EUR" => array(
"GBP" =>
"TS100629_2000_30_GBP",
"CHF" =>
"TS100629_20000_30_CHF",
"USD" =>
"TS100629_20000_30_USD")
73 foreach ($aTsProducts as $oProduct) {
74 $aProducts[] = $oProduct;
75 if ($oProduct->getAmount() > $dPrice) {
93 $oProduct =
oxNew(
"oxTsProduct");
94 $oProduct->setTsId($sTsId);
112 $aTsUser = $oConfig->getConfigParam(
'aTsUser');
113 $aTsPassword = $oConfig->getConfigParam(
'aTsPassword');
114 $aTrustedShopIds = $oConfig->getConfigParam(
'iShopID_TrustedShops');
115 if ($aTrustedShopIds && $aTrustedShopIds[$iLangId]) {
118 $sSoapUrl = $oConfig->getConfigParam(
'sTsTestProtectionUrl');
120 $sSoapUrl = $oConfig->getConfigParam(
'sTsProtectionUrl');
122 $sFunction =
'requestForProtectionV2';
123 $sVersion = $this->
getConfig()->getVersion();
124 $sEdition = $this->
getConfig()->getFullEdition();
127 $aValues[
'tsId'] = $aTrustedShopIds[$iLangId];
128 $aValues[
'paymentType'] = $sTsPaymentId;
129 $aValues[
'shopSystemVersion'] = $sEdition .
" " . $sVersion;
130 $aValues[
'wsUser'] = $aTsUser[$iLangId];
131 $aValues[
'wsPassword'] = $aTsPassword[$iLangId];
132 $aValues[
'orderDate'] = str_replace(
" ",
"T", $aValues[
'orderDate']);
133 $oSoap =
new SoapClient($sSoapUrl);
134 $aResults = $oSoap->{$sFunction}(
135 $aValues[
'tsId'], $tsProductId, $aValues[
'amount'], $aValues[
'currency'], $aValues[
'paymentType'],
136 $aValues[
'buyerEmail'], $aValues[
'shopCustomerID'], $aValues[
'shopOrderID'], $aValues[
'orderDate'], $aValues[
'shopSystemVersion'],
137 $aValues[
'wsUser'], $aValues[
'wsPassword']
140 if (isset($aResults) &&
"" != $aResults) {
141 if ($aResults ==
"-10001") {
146 if ($aResults ==
"-11111") {
172 public function checkCertificate($iTrustedShopId, $blTsTestMode)
174 if ($iTrustedShopId) {
175 if ($blTsTestMode ==
"true") {
176 $this->blTsTestMode = $blTsTestMode;
178 $sSoapUrl =
'https://qa.trustedshops.de/ts/services/TsProtection?wsdl';
180 $sSoapUrl =
'https://www.trustedshops.de/ts/services/TsProtection?wsdl';
182 $sFunction =
'checkCertificate';
183 $aValues[
'tsId'] = $iTrustedShopId;
184 $aResults = $this->executeSoap($sSoapUrl, $sFunction, $aValues[
'tsId']);
201 public function executeSoap($sSoapUrl, $sFunction, $sValues)
203 $soapParameters = null;
204 if ($this->blTsTestMode) {
205 $soapParameters = $this->setNotCheckSSL();
209 $oSoap =
new SoapClient($sSoapUrl, $soapParameters);
210 $aResults = $oSoap->{$sFunction}($sValues);
211 if (isset($aResults)) {
231 protected function _getTsPaymentId($sPaymentId)
235 $aPayment =
oxNew(
"oxPayment");
236 if ($aPayment->load($sPaymentId)) {
237 $sTsPaymentId = $aPayment->oxpayments__oxtspaymentid->value;
240 return $sTsPaymentId;
248 protected function _getTsAllProducts()
250 if ($this->_aAllProducts == null) {
251 $this->_aAllProducts =
false;
252 $oTsProduct =
oxNew(
"oxTsProduct");
253 if ($aTsProducts = $oTsProduct->getAllTsProducts()) {
254 foreach ($aTsProducts as $sId => $aTsProduct) {
255 $oProduct =
oxNew(
"oxTsProduct");
256 $oProduct->setTsId($sId);
257 $oProduct->setVat($this->getVat());
258 $this->_aAllProducts[] = $oProduct;
263 return $this->_aAllProducts;
274 protected function _getTsProductCurrId($sTsId, $sCurr)
277 if ($sCurr !=
'EUR') {
278 $aTsCurrId = $this->_sTsCurrencyProducts[$sTsId];
279 $sTsCurrId = $aTsCurrId[$sCurr];
291 private function setNotCheckSSL()
293 $context = stream_context_create(
297 'verify_peer' =>
false,
298 'verify_peer_name' =>
false,
299 'allow_self_signed' =>
true
304 return array(
'stream_context' => $context);