31 "TS080501_500_30_EUR" => array(
"GBP" =>
"TS100629_500_30_GBP",
"CHF" =>
"TS100629_500_30_CHF",
"USD" =>
"TS080501_500_30_USD"),
32 "TS080501_1500_30_EUR" => array(
"GBP" =>
"TS100629_1500_30_GBP",
"CHF" =>
"TS100629_1500_30_CHF",
"USD" =>
"TS100629_1500_30_USD"),
33 "TS080501_2500_30_EUR" => array(
"GBP" =>
"TS100629_2500_30_GBP",
"CHF" =>
"TS100629_2500_30_CHF",
"USD" =>
"TS100629_2500_30_USD"),
34 "TS080501_5000_30_EUR" => array(
"GBP" =>
"TS100629_5000_30_GBP",
"CHF" =>
"TS100629_5000_30_CHF",
"USD" =>
"TS100629_5000_30_USD"),
35 "TS080501_10000_30_EUR" => array(
"GBP" =>
"TS100629_1000_30_GBP",
"CHF" =>
"TS100629_10000_30_CHF",
"USD" =>
"TS100629_10000_30_USD"),
36 "TS080501_20000_30_EUR" => array(
"GBP" =>
"TS100629_2000_30_GBP",
"CHF" =>
"TS100629_20000_30_CHF",
"USD" =>
"TS100629_20000_30_USD")
70 foreach ($aTsProducts as $oProduct) {
71 $aProducts[] = $oProduct;
72 if ($oProduct->getAmount() > $dPrice) {
90 $oProduct =
oxNew(
"oxTsProduct");
91 $oProduct->setTsId($sTsId);
108 $blTsTestMode = $oConfig->getConfigParam(
'tsTestMode');
109 $aTsUser = $oConfig->getConfigParam(
'aTsUser');
110 $aTsPassword = $oConfig->getConfigParam(
'aTsPassword');
111 $aTrustedShopIds = $oConfig->getConfigParam(
'iShopID_TrustedShops');
112 if ($aTrustedShopIds && $aTrustedShopIds[$iLangId]) {
115 $sSoapUrl = $oConfig->getConfigParam(
'sTsTestProtectionUrl');
117 $sSoapUrl = $oConfig->getConfigParam(
'sTsProtectionUrl');
119 $sFunction =
'requestForProtectionV2';
120 $sVersion = $this->
getConfig()->getVersion();
121 $sEdition = $this->
getConfig()->getFullEdition();
124 $aValues[
'tsId'] = $aTrustedShopIds[$iLangId];
125 $aValues[
'paymentType'] = $sTsPaymentId;
126 $aValues[
'shopSystemVersion'] = $sEdition .
" " . $sVersion;
127 $aValues[
'wsUser'] = $aTsUser[$iLangId];
128 $aValues[
'wsPassword'] = $aTsPassword[$iLangId];
129 $aValues[
'orderDate'] = str_replace(
" ",
"T", $aValues[
'orderDate']);
130 $oSoap =
new SoapClient($sSoapUrl);
131 $aResults = $oSoap->{$sFunction}(
132 $aValues[
'tsId'], $tsProductId, $aValues[
'amount'], $aValues[
'currency'], $aValues[
'paymentType'],
133 $aValues[
'buyerEmail'], $aValues[
'shopCustomerID'], $aValues[
'shopOrderID'], $aValues[
'orderDate'], $aValues[
'shopSystemVersion'],
134 $aValues[
'wsUser'], $aValues[
'wsPassword']
137 if (isset($aResults) &&
"" != $aResults) {
138 if ($aResults ==
"-10001") {
143 if ($aResults ==
"-11111") {
170 public function checkCertificate($iTrustedShopId, $blTsTestMode)
172 if ($iTrustedShopId) {
173 if ($blTsTestMode ==
"true") {
174 $sSoapUrl =
'https://qa.trustedshops.de/ts/services/TsProtection?wsdl';
176 $sSoapUrl =
'https://www.trustedshops.de/ts/services/TsProtection?wsdl';
178 $sFunction =
'checkCertificate';
179 $aValues[
'tsId'] = $iTrustedShopId;
180 $aResults = $this->executeSoap($sSoapUrl, $sFunction, $aValues[
'tsId']);
198 public function executeSoap($sSoapUrl, $sFunction, $sValues)
201 $oSoap =
new SoapClient($sSoapUrl);
202 $aResults = $oSoap->{$sFunction}($sValues);
203 if (isset($aResults)) {
223 protected function _getTsPaymentId($sPaymentId)
227 $aPayment =
oxNew(
"oxPayment");
228 if ($aPayment->load($sPaymentId)) {
229 $sTsPaymentId = $aPayment->oxpayments__oxtspaymentid->value;
232 return $sTsPaymentId;
240 protected function _getTsAllProducts()
242 if ($this->_aAllProducts == null) {
243 $this->_aAllProducts =
false;
244 $oTsProduct =
oxNew(
"oxTsProduct");
245 if ($aTsProducts = $oTsProduct->getAllTsProducts()) {
246 foreach ($aTsProducts as $sId => $aTsProduct) {
247 $oProduct =
oxNew(
"oxTsProduct");
248 $oProduct->setTsId($sId);
249 $oProduct->setVat($this->getVat());
250 $this->_aAllProducts[] = $oProduct;
255 return $this->_aAllProducts;
266 protected function _getTsProductCurrId($sTsId, $sCurr)
269 if ($sCurr !=
'EUR') {
270 $aTsCurrId = $this->_sTsCurrencyProducts[$sTsId];
271 $sTsCurrId = $aTsCurrId[$sCurr];