HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/vhost/disk-apps/pwa.sports-crowd.com/www/2788.cdff38beb6283b2d.js
"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[2788],{2788:(F,f,r)=>{r.r(f),r.d(f,{PaymentGatewaySelectionModule:()=>O});var y=r(56610),v=r(36075),d=r(73308),l=r(27504),P=r(22126),t=r(2978),b=r(26409),w=r(3366),x=r(57291);let G=(()=>{class i{constructor(a,e,n){this.http=a,this.api=e,this.storage=n}goToGateway(a){this.getGatewayInfo(a.id).then(e=>{this.post_url=e.gw.is_productive?e.gw.gw_url_prd:e.gw.gw_url_sandbox,this.merchant_id=e.gw.merchant_id,this.account_id=e.gw.account_id,this.code=a.code,this.amount=a.total_price,this.currency=e.gw.currency,this.buyerEmail=e.u.email,this.response_url=e.gw.page_confirm_user,this.confirmation_url=e.gw.page_response_for_gateway,this.signature=e.signature,this.paymentString=`\n      <html>\n      <body>\n      <form action="${this.post_url}" method="post" id="payu_form">\n      <input name="merchantId"    type="hidden"  value="${this.merchant_id}"   >\n      <input name="accountId"     type="hidden"  value="${this.account_id}" >\n      <input name="description"   type="hidden"  value="Pago pedido codigo: ${this.code}"  >\n      <input name="referenceCode" type="hidden"  value="${this.code}" >\n      <input name="amount"        type="hidden"  value="${this.amount}"   >\n      <input name="tax"           type="hidden"  value="0"  >\n      <input name="taxReturnBase" type="hidden"  value="0" >\n      <input name="currency"      type="hidden"  value="${this.currency}" >\n      <input name="signature"     type="hidden"  value="${this.signature}"  >\n      <input name="test"          type="hidden"  value="1" >\n      <input name="buyerEmail"    type="hidden"  value="${this.buyerEmail}" >\n      <input name="responseUrl"    type="hidden"  value="${this.response_url}" >\n      <input name="confirmationUrl"    type="hidden"  value="${this.confirmation_url}" >\n      <input name="Submit"        type="submit"  value="Enviar" >\n      <button type="submit" value="submit" #submitBtn></button>\n      </form>\n      <script type="text/javascript">\n      document.getElementById("payu_form").submit();\n      <\/script>\n      </body>\n      </html>`,this.paymentString="data:text/html;base64,"+btoa(this.paymentString)})}getGatewayInfo(a){var e=this;return new Promise((n,s)=>{this.storage.get("token").then(function(){var m=(0,d.A)(function*(p){p&&(yield e.api.get("cart/gw/"+a,p.access_token)).subscribe(h=>{"success"==h.status&&n(h)},h=>{s(),console.error("Error provider gateway-payment getGatewayInfo",h)})});return function(p){return m.apply(this,arguments)}}())})}paymentSuccess(){}paymentFailure(){}getActivatedPaymentGateways(a,e){return this.api.getFree("paymentGateway/getActived/"+a+"/"+e)}static#t=this.\u0275fac=function(e){return new(e||i)(t.KVO(b.Qq),t.KVO(w.G),t.KVO(x.n))};static#e=this.\u0275prov=t.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var C=r(7125),_=r(46868),u=r(22882);let S=(()=>{class i{constructor(a,e){this.api=a,this.translateService=e}goToPayment(a,e){var n=this;return(0,d.A)(function*(){let s=n.api.getUrl();s=`${s}/store/webcheckout?paymentGatewayId=`+e+a,P.Ii.isNativePlatform()?(s+="&appOrigin=app",l.Nb.openWebView({url:s,isInspectable:!1,toolbarType:l.Kk.DEFAULT,title:n.translateService.instant("academy.segment_1")})):(s+="&appOrigin=pwa",window.open(s))})()}static#t=this.\u0275fac=function(e){return new(e||i)(t.KVO(w.G),t.KVO(u.c$))};static#e=this.\u0275prov=t.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var o=r(77897),T=r(54171);function U(i,g){if(1&i&&t.nrm(0,"img",11),2&i){const a=t.XpG().$implicit,e=t.XpG();t.FCK("src","",a.image,"?_dc=",e.time,"",t.B4B)}}function k(i,g){if(1&i&&t.nrm(0,"img",12),2&i){const a=t.XpG().$implicit,e=t.XpG();t.yjJ("src","",e.cityProvider._urlGallery,"paymentGateway/",a.image,"?_dc=",e.time,"",t.B4B)}}function A(i,g){if(1&i){const a=t.RV6();t.j41(0,"div",6),t.bIt("click",function(){const s=t.eBV(a).$implicit,m=t.XpG();return t.Njj(m.goToPaymentGateway(s.id))}),t.DNE(1,U,1,2,"img",7),t.DNE(2,k,1,3,"img",8),t.j41(3,"ion-item",9)(4,"ion-label",10),t.EFF(5),t.k0s()()()}if(2&i){const a=g.$implicit;t.R7$(1),t.Y8G("ngIf",a.image.includes("http")),t.R7$(1),t.Y8G("ngIf",!a.image.includes("http")),t.R7$(3),t.SpI("",a.name," \u279c ")}}const $=[{path:"",component:(()=>{class i{constructor(a,e,n,s,m,p,I,h,D,N){var c=this;this.gatewayPaymentService=a,this.cityProvider=e,this.router=n,this.cartProvider=s,this.onlinePaymentService=m,this.alertController=p,this.translateService=I,this.utilsService=h,this.alertCtrl=D,this.location=N,this.paymentGateways=[],this.extraParam="",this.validateClose=!0,this.openedPaymentGateway=!1,this.handleVisibilityChange=(0,d.A)(function*(){"visible"===document.visibilityState&&c.openedPaymentGateway&&!P.Ii.isNativePlatform()&&!c.finishPaymentAlert&&(c.finishPaymentAlert=yield c.alertController.create({header:c.translateService.instant("payment_gateway.finish_payment_question"),buttons:[{text:c.translateService.instant("all.alertLogOutNot"),role:"cancel",cssClass:"secondary",handler:()=>{c.finishPaymentAlert=null}},{text:c.translateService.instant("all.alertLogOutYes"),handler:()=>{c.openList()}}]}),yield c.finishPaymentAlert.present())}),document.addEventListener("visibilitychange",this.handleVisibilityChange)}ngOnInit(){this.time=(new Date).getTime(),this.paymentData=this.router.getCurrentNavigation().extras.state,this.orderId=this.paymentData.orderId,this.orderId&&(this.cartProvider.deleteAllProductsCart(),this.extraParam="&uid="+this.orderId,this.type="order"),this.ticketId=this.paymentData.ticketId,this.ticketId&&(this.extraParam="&ticketId="+this.ticketId,this.type="ticket"),this.academyPurchaseId=this.paymentData.academyPurchaseId,this.academyPurchaseId&&(this.extraParam="&academyPurchaseId="+this.academyPurchaseId,this.type="academy"),this.academyTournamentPaymentId=this.paymentData.academyTournamentPaymentId,this.academyTournamentPaymentId&&(this.extraParam="&academyTournamentPaymentId="+this.academyTournamentPaymentId,this.type="academy"),this.experiencePaymentId=this.paymentData.experiencePaymentId,this.experiencePaymentId&&(this.extraParam="&experiencePaymentId="+this.experiencePaymentId,this.type="experience"),this.membershipId=this.paymentData.membershipId,this.membershipId&&(this.extraParam="&membershipId="+this.membershipId,this.type="membership"),this.paymentData.hasOwnProperty("validateClose")&&(this.validateClose=this.paymentData.validateClose),this.paymentData.hasOwnProperty("academyUserId")&&(this.academyUserId=this.paymentData.academyUserId),this.getPaymentGateways(this.type,this.paymentData.assignedPaymentGateway)}ngOnDestroy(){l.Nb.removeAllListeners(),document.removeEventListener("visibilitychange",this.handleVisibilityChange)}getPaymentGateways(a,e){var n=this;return(0,d.A)(function*(){(yield n.gatewayPaymentService.getActivatedPaymentGateways(a,e)).subscribe(s=>{n.paymentGateways=s.data,0===n.paymentGateways.length&&(n.utilsService.presentToast(4e3,"success","top",n.translateService.instant("PAYMENT_GATEWAY_NOT_AVAILABLE")),n.location.back()),1===n.paymentGateways.length&&n.goToPaymentGateway(n.paymentGateways[0].id)},s=>{console.error("Error provider Paymet Gateways",s)})})()}goToPaymentGateway(a){this.utilsService.closeToast(this.utilsService.toast),this.onlinePaymentService.goToPayment(this.extraParam,a);var e=this;l.Nb.addListener("urlChangeEvent",n=>{-1!=n.url.indexOf("/close")&&l.Nb.close(),-1!=n.url.indexOf("/web_ticketing")&&l.Nb.close(),-1!=n.url.indexOf("/memberships")&&l.Nb.close()}),l.Nb.addListener("closeEvent",n=>{this.router.url.includes("payment-gateway-selection")&&e.openList()}),this.openedPaymentGateway=!0}close(){if(this.validateClose){let a=this.translateService.instant("payment_gateway.msg_cancel_buy_orders");this.ticketId&&(a=this.translateService.instant("payment_gateway.msg_cancel_buy_tickets")),this.presentAlertConfirmExit(a)}else this.router.navigate(["/app/tabs/settings/user-orders"])}openList(){this.orderId?this.router.navigateByUrl("/app/tabs/settings/order/"+this.orderId+"/confirmOrder",{replaceUrl:!0}):this.ticketId?this.router.navigateByUrl("/app/tabs/settings/tickets-list",{replaceUrl:!0}):this.experiencePaymentId?this.router.navigateByUrl("/experience/children/true",{replaceUrl:!0}):this.membershipId?this.router.navigateByUrl("/memberships/true",{replaceUrl:!0}):this.academyPurchaseId?this.router.navigateByUrl("/academy-payments/"+this.academyUserId,{replaceUrl:!0}):this.academyTournamentPaymentId?this.router.navigateByUrl("/academy-tournaments/"+this.academyUserId,{replaceUrl:!0}):this.location.back()}presentAlertConfirmExit(a){var e=this;return(0,d.A)(function*(){yield(yield e.alertController.create({header:e.translateService.instant("error.alert"),message:a,buttons:[{text:e.translateService.instant("payment_gateway.msg_continue_shopping"),role:"cancel",cssClass:"secondary",handler:()=>{}},{text:e.translateService.instant("payment_gateway.msg_abandon_purchase"),handler:()=>{e.location.back()}}]})).present()})()}doRefresh(a){setTimeout(()=>{this.getPaymentGateways(this.type),a.target.complete()},500)}static#t=this.\u0275fac=function(e){return new(e||i)(t.rXU(G),t.rXU(C.h),t.rXU(v.Ix),t.rXU(_.m),t.rXU(S),t.rXU(o.hG),t.rXU(u.c$),t.rXU(T.T),t.rXU(o.hG),t.rXU(y.aZ))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["app-payment-gateway-selection"]],decls:14,vars:7,consts:[[1,"ion-no-border"],["slot","start","name","chevron-back-outline",1,"back-icon",3,"click"],[1,"ion-text-center"],["slot","fixed",3,"ionRefresh"],[1,"xc"],["detail","true","class","sectionNewsContent",3,"click",4,"ngFor","ngForOf"],["detail","true",1,"sectionNewsContent",3,"click"],["onerror","this.style.display='none';","class","paymentGatewayImage",3,"src",4,"ngIf"],["class","paymentGatewayImage",3,"src",4,"ngIf"],["lines","none"],["color","medium",1,"name"],["onerror","this.style.display='none';",1,"paymentGatewayImage",3,"src"],[1,"paymentGatewayImage",3,"src"]],template:function(e,n){1&e&&(t.j41(0,"ion-header",0)(1,"ion-toolbar")(2,"ion-icon",1),t.bIt("click",function(){return n.close()}),t.k0s(),t.j41(3,"ion-title",2),t.EFF(4),t.nI1(5,"translate"),t.k0s()()(),t.j41(6,"ion-content")(7,"ion-refresher",3),t.bIt("ionRefresh",function(m){return n.doRefresh(m)}),t.nrm(8,"ion-refresher-content"),t.k0s(),t.j41(9,"div",4)(10,"h2"),t.EFF(11),t.nI1(12,"translate"),t.k0s(),t.DNE(13,A,6,3,"div",5),t.k0s()()),2&e&&(t.R7$(4),t.JRh(t.bMT(5,3,"PAYMENT_GATEWAY")),t.R7$(7),t.SpI("",t.bMT(12,5,"payment_gateway.title_select"),":"),t.R7$(2),t.Y8G("ngForOf",n.paymentGateways))},dependencies:[y.Sq,y.bT,o.W9,o.eU,o.iq,o.uz,o.he,o.To,o.Ki,o.BC,o.ai,u.D9],styles:[".xc[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;flex-flow:column;min-height:-webkit-fill-available}.sectionNewsContent[_ngcontent-%COMP%]{background-color:#fff;display:flex;margin-bottom:12px;border-radius:10px;margin-left:16px;margin-right:16px;overflow:hidden;box-shadow:0 1px 6px gray;max-width:640px;width:-webkit-fill-available;flex-direction:column;padding:10px}.name[_ngcontent-%COMP%]{font-size:1em;text-transform:uppercase;text-align:center}.paymentGatewayImage[_ngcontent-%COMP%]{height:110px}.back-icon[_ngcontent-%COMP%]{font-size:xx-large}"]})}return i})()}];let E=(()=>{class i{static#t=this.\u0275fac=function(e){return new(e||i)};static#e=this.\u0275mod=t.$C({type:i});static#a=this.\u0275inj=t.G2t({imports:[y.MD,v.iI.forChild($)]})}return i})(),O=(()=>{class i{static#t=this.\u0275fac=function(e){return new(e||i)};static#e=this.\u0275mod=t.$C({type:i});static#a=this.\u0275inj=t.G2t({imports:[y.MD,E,u.h.forChild(),o.bv]})}return i})()}}]);