32 "TS080501_500_30_EUR" => array(
"GBP" =>
"TS100629_500_30_GBP",
"CHF" =>
"TS100629_500_30_CHF",
"USD" =>
"TS080501_500_30_USD"),
33 "TS080501_1500_30_EUR" => array(
"GBP" =>
"TS100629_1500_30_GBP",
"CHF" =>
"TS100629_1500_30_CHF",
"USD" =>
"TS100629_1500_30_USD"),
34 "TS080501_2500_30_EUR" => array(
"GBP" =>
"TS100629_2500_30_GBP",
"CHF" =>
"TS100629_2500_30_CHF",
"USD" =>
"TS100629_2500_30_USD"),
35 "TS080501_5000_30_EUR" => array(
"GBP" =>
"TS100629_5000_30_GBP",
"CHF" =>
"TS100629_5000_30_CHF",
"USD" =>
"TS100629_5000_30_USD"),
36 "TS080501_10000_30_EUR" => array(
"GBP" =>
"TS100629_1000_30_GBP",
"CHF" =>
"TS100629_10000_30_CHF",
"USD" =>
"TS100629_10000_30_USD"),
37 "TS080501_20000_30_EUR" => array(
"GBP" =>
"TS100629_2000_30_GBP",
"CHF" =>
"TS100629_20000_30_CHF",
"USD" =>
"TS100629_20000_30_USD")
71 foreach ($aTsProducts as $oProduct) {
72 $aProducts[] = $oProduct;
73 if ($oProduct->getAmount() > $dPrice) {
91 $oProduct =
oxNew(
"oxTsProduct");
92 $oProduct->setTsId($sTsId);
109 $blTsTestMode = $oConfig->getConfigParam(
'tsTestMode');
110 $aTsUser = $oConfig->getConfigParam(
'aTsUser');
111 $aTsPassword = $oConfig->getConfigParam(
'aTsPassword');
112 $aTrustedShopIds = $oConfig->getConfigParam(
'iShopID_TrustedShops');
113 if ($aTrustedShopIds && $aTrustedShopIds[$iLangId]) {
116 $sSoapUrl = $oConfig->getConfigParam(
'sTsTestProtectionUrl');
118 $sSoapUrl = $oConfig->getConfigParam(
'sTsProtectionUrl');
120 $sFunction =
'requestForProtectionV2';
121 $sVersion = $this->
getConfig()->getVersion();
122 $sEdition = $this->
getConfig()->getFullEdition();
125 $aValues[
'tsId'] = $aTrustedShopIds[$iLangId];
126 $aValues[
'paymentType'] = $sTsPaymentId;
127 $aValues[
'shopSystemVersion'] = $sEdition .
" " . $sVersion;
128 $aValues[
'wsUser'] = $aTsUser[$iLangId];
129 $aValues[
'wsPassword'] = $aTsPassword[$iLangId];
130 $aValues[
'orderDate'] = str_replace(
" ",
"T", $aValues[
'orderDate']);
131 $oSoap =
new SoapClient($sSoapUrl);
132 $aResults = $oSoap->{$sFunction}(
133 $aValues[
'tsId'], $tsProductId, $aValues[
'amount'], $aValues[
'currency'], $aValues[
'paymentType'],
134 $aValues[
'buyerEmail'], $aValues[
'shopCustomerID'], $aValues[
'shopOrderID'], $aValues[
'orderDate'], $aValues[
'shopSystemVersion'],
135 $aValues[
'wsUser'], $aValues[
'wsPassword']
138 if (isset($aResults) &&
"" != $aResults) {
139 if ($aResults ==
"-10001") {
144 if ($aResults ==
"-11111") {
171 public function checkCertificate($iTrustedShopId, $blTsTestMode)
173 if ($iTrustedShopId) {
174 if ($blTsTestMode ==
"true") {
175 $sSoapUrl =
'https://qa.trustedshops.de/ts/services/TsProtection?wsdl';
177 $sSoapUrl =
'https://www.trustedshops.de/ts/services/TsProtection?wsdl';
179 $sFunction =
'checkCertificate';
180 $aValues[
'tsId'] = $iTrustedShopId;
181 $aResults = $this->executeSoap($sSoapUrl, $sFunction, $aValues[
'tsId']);
199 public function executeSoap($sSoapUrl, $sFunction, $sValues)
202 $oSoap =
new SoapClient($sSoapUrl);
203 $aResults = $oSoap->{$sFunction}($sValues);
204 if (isset($aResults)) {
224 protected function _getTsPaymentId($sPaymentId)
228 $aPayment =
oxNew(
"oxPayment");
229 if ($aPayment->load($sPaymentId)) {
230 $sTsPaymentId = $aPayment->oxpayments__oxtspaymentid->value;
233 return $sTsPaymentId;
241 protected function _getTsAllProducts()
243 if ($this->_aAllProducts == null) {
244 $this->_aAllProducts =
false;
245 $oTsProduct =
oxNew(
"oxTsProduct");
246 if ($aTsProducts = $oTsProduct->getAllTsProducts()) {
247 foreach ($aTsProducts as $sId => $aTsProduct) {
248 $oProduct =
oxNew(
"oxTsProduct");
249 $oProduct->setTsId($sId);
250 $oProduct->setVat($this->getVat());
251 $this->_aAllProducts[] = $oProduct;
256 return $this->_aAllProducts;
267 protected function _getTsProductCurrId($sTsId, $sCurr)
270 if ($sCurr !=
'EUR') {
271 $aTsCurrId = $this->_sTsCurrencyProducts[$sTsId];
272 $sTsCurrId = $aTsCurrId[$sCurr];