1 2 try { 3 if (window.eComEventTarget) { 4 window.eComEventTarget.addEventListener('cart:add', function (event) { 5 if (XMLHttpRequest) { 6 var xhr = new XMLHttpRequest(), 7 registerUrl = event.detail.cart.registerSessionUrl; 8 xhr.open('GET', registerUrl, true); 9 10 xhr.addEventListener('load', function () { 11 if (xhr.status > 200 || xhr.status >= 300) { 12 console.warn(xhr.statusText, xhr.responseText); 13 } 14 }); 15 16 xhr.send(); 17 } 18 }) 19 } 20} catch (ex) { 21 console.log(ex); 22} 23 24 try { 25 if (window.eComEventTarget) { 26 window.eComEventTarget.addEventListener('wishlist:add', function (event) { 27 if (XMLHttpRequest) { 28 var xhr = new XMLHttpRequest(), 29 product = event.detail.product, 30 targetUrl = 'https://www.zeltsauna-rudolstadt.de/epages/79019478.sf' + '?ViewAction=JSONViewResponse&ChangeAction=JSONAddItemToShoppingList', 31 data = { 32 'ProductGUID': product.productId, 33 'Quantity': product.quantity, 34 'LineItemGUID': event.detail.lineItemId, 35 'CustomizedText': product.customizedText, 36 'LocaleID': event.detail.locale 37 }; 38 39 xhr.open('POST', targetUrl, true); 40 xhr.setRequestHeader('Content-Type', 'application/json') 41 42 xhr.addEventListener('load', function () { 43 if (xhr.status < 200 || xhr.status >= 300) { 44 console.warn(xhr.statusText, xhr.responseText); 45 } else { 46 var response = JSON.parse(xhr.responseText) 47 48 49 if (response.success) { 50 window.eComEventTarget.dispatchEvent(new CustomEvent('wishlist:success-' + response.productId, { 'detail': response })); 51 window.eComEventTarget.dispatchEvent(new CustomEvent('wishlist:success-' + response.lineItemId, { 'detail': response })); 52 } else if (response.reason === 'nouser') { 53 window.eComEventTarget.dispatchEvent(new CustomEvent('wishlist:nouser-' + response.productId, { 'detail': response })); 54 window.eComEventTarget.dispatchEvent(new CustomEvent('wishlist:nouser-' + response.lineItemId, { 'detail': response })); 55 } else { 56 console.warn(xhr.statusText, xhr.responseText); 57 } 58 59 60 } 61 }); 62 xhr.send(JSON.stringify(data)); 63 } 64 }) 65 } 66} catch (ex) { 67 console.log(ex); 68} 69 70 71 72try { 73(function () { 74 var initPayPalIntID, 75 minMaxAllowed, 76 inCompatibleShippingMethods, 77 shippingMethodLandRestrictions, 78 paymentMethodRegionRestrictions, 79 buttonContainer = 'div#paypal-button-container'; 80 81 82 try { 83 minMaxAllowed = JSON.parse('{"EUR":{"MaxPriceValue":null,"MinPriceValue":null}}'); 84 } catch (ex) { 85 } 86 try { 87 inCompatibleShippingMethods = JSON.parse('{}'); 88 shippingMethodLandRestrictions = JSON.parse('{}'); 89 90 } catch (ex) { 91 } 92 93 var initPayPal = function() { 94 var isOk = 1; 95 96 if (window.paypal) { 97 try { 98 var FUNDING_SOURCES = [ 99 100 ]; 101 102 FUNDING_SOURCES.forEach(function(fundingSource) { 103 var button = paypal.Buttons({ 104 style: { 105 layout: 'vertical', 106 color: fundingSource === paypal.FUNDING.PAYPAL || fundingSource === paypal.FUNDING.PAYLATER ? 'gold' : 'white', 107 shape: 'rect', 108 label: 'checkout', 109 height: 55, 110 }, 111 fundingSource: fundingSource, 112 createOrder: function (data, actions) { 113 return xhrRequest(); 114 }, 115 onApprove: function (data, actions) { 116 xhrRequestApprove(fundingSource); 117 }, 118 onCancel: function (data, actions) { 119 console.log("Customer cancelled the PayPal Checkout Flow"); 120 }, 121 onError: function () { 122 console.log("An Error occurred as part of the PayPal JS SDK"); 123 }, 124 onShippingChange: function(data, actions) { 125 var selectedShippingOptionId, 126 shippingAddressCountryCode; 127 128 try { 129 selectedShippingOptionId = data.selected_shipping_option.id; 130 shippingAddressCountryCode = data.shipping_address.country_code; 131 } catch (ex) { 132 return actions.resolve(); 133 } 134 135 if ( paymentMethodRegionRestrictions && ! paymentMethodRegionRestrictions.includes(shippingAddressCountryCode) ) { 136 return actions.reject(); 137 } 138 139 if ( shippingMethodLandRestrictions && shippingMethodLandRestrictions[selectedShippingOptionId] ) { 140 if ( ! shippingMethodLandRestrictions[selectedShippingOptionId][shippingAddressCountryCode] ) { 141 return actions.reject(); 142 } 143 } 144 145 return actions.resolve(); 146 } 147 }); 148 149 if ( button.isEligible() ) { 150 button.render(buttonContainer); 151 } 152 }); 153 154 /* */ 155 156 157 } catch (e) { 158 isOk = 0; 159 console.log(e); 160 } 161 } else { 162 isOk = 0; 163 } 164 165 if ( typeof initPayPalIntID == 'number' ) { 166 clearInterval(initPayPalIntID); 167 } 168 }, 169 170 xhrRequest = function() { 171 return new Promise(function(resolve, reject) { 172 if (XMLHttpRequest && cart) { 173 var xhr = new XMLHttpRequest(), 174 targetUrl = 'https://www.zeltsauna-rudolstadt.de/epages/79019478.sf?ViewAction=JSONViewResponse&ChangeAction=JSONCreatePayPalPPCPOrder', 175 data = { 176 'BasketGUID': cart.cartId, 177 }; 178 179 xhr.open('POST', targetUrl, true); 180 xhr.setRequestHeader('Content-Type', 'application/json'); 181 182 xhr.addEventListener('load', function () { 183 if (xhr.status < 200 || xhr.status >= 300) { 184 reject(new Error(xhr.responseText + xhr.statusText)); 185 } else { 186 try { 187 var response = JSON.parse(xhr.responseText); 188 189 if (response.success) { 190 resolve(response.orderID); 191 } else { 192 reject(new Error(xhr.responseText + xhr.statusText)); 193 } 194 } catch (e) { 195 reject(e); 196 } 197 } 198 }); 199 200 xhr.send(JSON.stringify(data)); 201 } 202 }) 203 }, 204 205 xhrRequestApprove = function(fundingSource) { 206 if (XMLHttpRequest && cart) { 207 var xhr = new XMLHttpRequest(), 208 targetUrl = 'https://www.zeltsauna-rudolstadt.de/epages/79019478.sf?ViewAction=JSONViewResponse&ChangeAction=JSONApprovePayPalPPCPOrder', 209 data = { 210 'PickupToken': 'ZDZjNzRjZDNkNzE5ODVlYjg5NGQ3N2U1ZWQ3ZDJjZjllM2ZmMDUzZWUxODQ0MWY3OWIyOTYzNTkxODE3ZmM5OF8xNzkxNTk4ODAx', 211 'BasketGUID': cart.cartId, 212 'FundingSource': fundingSource, 213 }; 214 215 xhr.open('POST', targetUrl, true); 216 xhr.setRequestHeader('Content-Type', 'application/json'); 217 218 xhr.addEventListener('load', function () { 219 if (xhr.status < 200 || xhr.status >= 300) { 220 console.warn(new Error(xhr.responseText + xhr.statusText)); 221 } else { 222 try { 223 var response = JSON.parse(xhr.responseText); 224 225 if (response.success) { 226 window.location = response.redirect; 227 } else { 228 console.warn(new Error(xhr.responseText + xhr.statusText)); 229 } 230 } catch (e) { 231 console.log(e); 232 } 233 } 234 }); 235 236 xhr.send(JSON.stringify(data)); 237 } 238 }; 239 240 var cart, 241 script; 242 243 244 245 script = document.createElement('script'); 246 script.src = 'https://www.paypal.com/sdk/js?integration-date=2022-03-24&client-id=BAAPb096mFYgmQKfqU2usrJwLnM_iHIQcGWfzmqg7xnGAxzgp_jCX-BoSL2D5xtWkJXtiCgt6Xs0IbzsmE¤cy=EUR&intent=capture&components=buttons,funding-eligibility,messages&enable-funding=paylater&commit=false'; 247 script.setAttribute("defer", true); 248 script.setAttribute('data-partner-attribution-id', 'ePages_Strato_PPCP'); 249 document.body.appendChild(script); 250 251 var ppcpUpdateCart = function (e) { 252 var container = document.querySelector(buttonContainer), 253 timeout = 500, 254 compatibleWithCurrentShipping = 1; 255 256 if ( container && typeof paypal !== 'undefined' ) { 257 timeout = 0; 258 } 259 260 /* */ 261 setTimeout(function(){ 262 263 if ( ! container ) { 264 container = document.querySelector(buttonContainer); 265 } 266 var cartHasItems = typeof cart.productLineItems === 'object' && cart.productLineItems.length > 0 ? true : false;
267 268 if ( container && cartHasItems ) { 269 /* */ 270 var cartCurrencyId = cart.grandTotal.currency; 271 272 container.setAttribute('data-pp-amount', cart.grandTotal.amount); 273 274 /* */ 275 if ( cart.shippingLineItem.shippingMethod.name ) { 276 try { 277 var shippingNameEncoded = btoa(encodeURIComponent(cart.shippingLineItem.shippingMethod.name)); 278 if ( inCompatibleShippingMethods[shippingNameEncoded] ) { 279 compatibleWithCurrentShipping = 0; 280 } 281 } catch (ex) { 282 } 283 } 284 285 var regionCompatible = 1; 286 287 288 if ( ! compatibleWithCurrentShipping ) { 289 container.style.display = 'none'; 290 } else if ( typeof minMaxAllowed === 'object' && minMaxAllowed[cartCurrencyId]['MinPriceValue'] && cart.grandTotal.amount < minMaxAllowed[cartCurrencyId]['MinPriceValue'] ) { 291 container.style.display = 'none'; 292 } else if ( typeof minMaxAllowed === 'object' && minMaxAllowed[cartCurrencyId]['MaxPriceValue'] && cart.grandTotal.amount > minMaxAllowed[cartCurrencyId]['MaxPriceValue'] ) { 293 container.style.display = 'none'; 294 } else if ( ! regionCompatible ) { 295 container.style.display = 'none'; 296 } else { 297 container.style.display = ''; 298 } 299 300 if (window.paypal && e.type === 'cart:view') { 301 initPayPal(); 302 } 303 } 304 305 }, timeout); 306 }; 307 308 /* */ 309 310 311 window.eComEventTarget && window.eComEventTarget.addEventListener('cart:view', function(event) { 312 cart = event.detail.cart; 313 314 ppcpUpdateCart(event); 315 }); 316 317 window.eComEventTarget && window.eComEventTarget.addEventListener('cart:update', function(event) { 318 cart = event.detail.cart; 319 320 ppcpUpdateCart(event); 321 }); 322 323 /* */ 324 window.eComEventTarget && document.head.insertAdjacentHTML('beforeend', '<style>div#paypal-button-container span[id*="zoid-paypal-message"]{display: block;}</style>'); 325 326 327 328 329 330})(); 331} catch (ex) { 332 console.log(ex); 333} 334 335 336 337 338 339 340 341 342 343 344 345 346 347
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.