30 "TS080501_500_30_EUR" => array(
"GBP" =>
"TS100629_500_30_GBP",
"CHF" =>
"TS100629_500_30_CHF",
"USD" =>
"TS080501_500_30_USD" ),
31 "TS080501_1500_30_EUR" => array(
"GBP" =>
"TS100629_1500_30_GBP",
"CHF" =>
"TS100629_1500_30_CHF",
"USD" =>
"TS100629_1500_30_USD" ),
32 "TS080501_2500_30_EUR" => array(
"GBP" =>
"TS100629_2500_30_GBP",
"CHF" =>
"TS100629_2500_30_CHF",
"USD" =>
"TS100629_2500_30_USD" ),
33 "TS080501_5000_30_EUR" => array(
"GBP" =>
"TS100629_5000_30_GBP",
"CHF" =>
"TS100629_5000_30_CHF",
"USD" =>
"TS100629_5000_30_USD" ),
34 "TS080501_10000_30_EUR" => array(
"GBP" =>
"TS100629_1000_30_GBP",
"CHF" =>
"TS100629_10000_30_CHF",
"USD" =>
"TS100629_10000_30_USD" ),
35 "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 ) {
90 $oProduct =
oxNew(
"oxTsProduct");
91 $oProduct->setTsId($sTsId);
107 $blTsTestMode = $oConfig->getConfigParam(
'tsTestMode' );
108 $aTsUser = $oConfig->getConfigParam(
'aTsUser' );
109 $aTsPassword = $oConfig->getConfigParam(
'aTsPassword' );
110 $aTrustedShopIds = $oConfig->getConfigParam(
'iShopID_TrustedShops' );
111 if ( $aTrustedShopIds && $aTrustedShopIds[$iLangId] ) {
113 if ( $blTsTestMode ) {
114 $sSoapUrl = $oConfig->getConfigParam(
'sTsTestProtectionUrl' );
116 $sSoapUrl = $oConfig->getConfigParam(
'sTsProtectionUrl' );
118 $sFunction =
'requestForProtectionV2';
119 $sVersion = $this->
getConfig()->getVersion();
120 $sEdition = $this->
getConfig()->getFullEdition();
123 $aValues[
'tsId'] = $aTrustedShopIds[$iLangId];
124 $aValues[
'paymentType'] = $sTsPaymentId;
125 $aValues[
'shopSystemVersion'] = $sEdition .
" " . $sVersion;
126 $aValues[
'wsUser'] = $aTsUser[$iLangId];
127 $aValues[
'wsPassword'] = $aTsPassword[$iLangId];
128 $aValues[
'orderDate'] = str_replace(
" ",
"T", $aValues[
'orderDate']);
129 $oSoap =
new SoapClient($sSoapUrl);
130 $aResults = $oSoap->{$sFunction}($aValues[
'tsId'],$tsProductId,$aValues[
'amount'],$aValues[
'currency'],$aValues[
'paymentType'],
131 $aValues[
'buyerEmail'],$aValues[
'shopCustomerID'],$aValues[
'shopOrderID'],$aValues[
'orderDate'],$aValues[
'shopSystemVersion'],
132 $aValues[
'wsUser'],$aValues[
'wsPassword']);
134 if ( isset($aResults) &&
"" != $aResults ) {
135 if ( $aResults ==
"-10001" ) {
139 if ( $aResults ==
"-11111" ) {
162 public function checkCertificate( $iTrustedShopId, $blTsTestMode )
164 if ( $iTrustedShopId ) {
165 if ( $blTsTestMode ==
"true" ) {
166 $sSoapUrl =
'https://qa.trustedshops.de/ts/services/TsProtection?wsdl';
168 $sSoapUrl =
'https://www.trustedshops.de/ts/services/TsProtection?wsdl';
170 $sFunction =
'checkCertificate';
171 $aValues[
'tsId'] = $iTrustedShopId;
172 $aResults = $this->executeSoap( $sSoapUrl, $sFunction, $aValues[
'tsId']);
188 public function executeSoap( $sSoapUrl, $sFunction, $sValues )
191 $oSoap =
new SoapClient($sSoapUrl);
192 $aResults = $oSoap->{$sFunction}($sValues);
193 if ( isset($aResults) ) {
211 protected function _getTsPaymentId( $sPaymentId )
215 $aPayment =
oxNew(
"oxPayment");
216 if ( $aPayment->load($sPaymentId) ) {
217 $sTsPaymentId = $aPayment->oxpayments__oxtspaymentid->value;
219 return $sTsPaymentId;
227 protected function _getTsAllProducts()
229 if ($this->_aAllProducts == null) {
230 $this->_aAllProducts =
false;
231 $oTsProduct =
oxNew(
"oxTsProduct");
232 if ( $aTsProducts = $oTsProduct->getAllTsProducts()) {
233 foreach ( $aTsProducts as $sId => $aTsProduct ) {
234 $oProduct =
oxNew(
"oxTsProduct");
235 $oProduct->setTsId($sId);
236 $oProduct->setVat( $this->getVat() );
237 $this->_aAllProducts[] = $oProduct;
241 return $this->_aAllProducts;
252 protected function _getTsProductCurrId( $sTsId, $sCurr )
255 if ($sCurr !=
'EUR') {
256 $aTsCurrId = $this->_sTsCurrencyProducts[$sTsId];
257 $sTsCurrId = $aTsCurrId[$sCurr];