{"version":3,"sources":["webpack:///./src/views/Account/Components/PaymentsComponents/ConfirmPlan.vue","webpack:///./src/views/Account/Components/PaymentsComponents/ConfirmPlan.vue?36f5","webpack:///./src/views/Account/Components/PaymentsComponents/ConfirmPlan.vue?ea4d","webpack:///./src/views/Account/Components/PaymentsComponents/ConfirmPlan.vue?1986","webpack:///./src/services/api/subscription-plan.service.ts"],"names":["staticClass","attrs","on","_c","text","path","_vm","href","current","duration","_v","promotionPlanOld","parseFloat","_e","month","_s","price","$tc","subscriptionExpired","domProps","model","value","radioButton","callback","expression","downgrade","addMonths","Date","toFormat","slotText","downgradeConfirmation","type","icon","action","$event","authModule","getModule","AuthModule","store","overlayModule","OverlayModule","ConfirmPlan","Vue","offertID","nameOffert","descrOffert","monthlyBeneficiaries","totalSubjects","firstSupport","secondSupport","freeTrial","expiration","roleId","priceMonthID","priceYearID","yearPrice","this","promotionPlanNew","update","newExpiration","showOverlay","subscriptionPlansService","GetById","profileRoleID","data","GetExpiration","userService","SubscriptionDuration","paymentsService","RemainingDaysUp","parse","split","getTime","back","$router","push","name","params","context","payments","backToPayments","checkOut","checkOutUpgrade","UpdatePlan","billingAddress","GetBillingAddressByID","companyName","companyAddress","city","postalCode","province","countryID","url","payment","durationMonth","priceId","upgradeSubYear","upgrade","CreateSession","window","open","UpdateSubscriptionYear","upgradeYear","$emit","__decorate","Prop","required","default","Number","Boolean","Component","component","staticRenderFns","controller","SubscriptionPlansService","ApiService","constructor","super","process","GetAllOffert","getAll"],"mappings":"8KAAyF,MAAU,KAAuCA,IAAW,MAAC,GAAa,oB,OAAA,8BAAnC,YAAsD,OAAkBC,MAAM,CAAC,KAAO,OAAf,qBAA8CC,MAAG,CAAC,kBAAD,gBAAwFF,IAA0BG,MAAG,SAAmCF,GAAK,GAAC,sD,YAAC,a,GAE3YG,eAAc,C,YACR,O,MAAEC,C,WAAF,EAHkZ,KAK1Z,wBACED,KAAME,CACNC,KAAM,4BAPkZ,KAS1Z,qCAAEH,KAAME,CAA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,iBAAiBL,OAC9C4C,EAAeD,QAAUvC,KAAKC,iBAAiBH,YAC/C0C,EAAeF,cAAgB,SACzB1B,OAAgBiC,uBAAuBL,GAC7CxC,KAAKkB,QAAQC,KAAK,CAChBC,KAAM,mBACNC,OAAQ,CAAEyB,YAAa,aAU7B9C,KAAK+C,MAAM,eAAgB/C,KAAKJ,QAChCI,KAAKkB,QAAQC,KAAK,CAChBC,KAAM,UACNC,OAAQ,CACNC,QAAS,WACTC,SAAU,sBA1NlByB,gBADCC,eAAK,CAAEC,UAAU,EAAMC,QAAS,KAAM5E,KAAM6E,UAC7C,6BAGAJ,gBADCC,eAAK,CAAEC,UAAU,EAAMC,QAAS,KAAM5E,KAAM8E,WAC7C,4BALmBpE,EAAW,gBAD/BqE,QACoBrE,WCnBua,I,YCOxbsE,EAAY,eACd,EACA,EACAC,GACA,EACA,KACA,KACA,MAIa,aAAAD,E,2CCjBf,kDAEA,MAAME,EAAa,oBAEnB,MAAMC,UAAiCC,gBACrCC,cACEC,MAAMC,SAGRC,eACE,OAAO/D,KAAKgE,OAA4BP,EAAH,WAGvCnD,QAAQV,GACN,OAAOI,KAAKgE,OACV,GAAGP,oBAA6B7D,KAIpCa,gBACE,OAAOT,KAAKgE,OAAkBP,EAAH,mBAIxB,MAAMpD,EAA2B,IAAIqD","file":"js/chunk-348bcb8a.e07f21c2.js","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('v-container',[_c('v-row',[_c('v-col',{staticClass:\"pb-0\",attrs:{\"cols\":\"12\"}},[_c('z-plain-button',{attrs:{\"icon\":\"arrow-left\",\"type\":\"neutral\"},on:{\"click\":_vm.back}},[_vm._v(\" \"+_vm._s(_vm.$tc(\"payments.Back\"))+\" \")])],1),_c('v-col',{staticClass:\"pt-0 pl-0\"},[_c('z-breadcrumb',{staticClass:\"pt-0\",attrs:{\"breadcrumb\":[\n {\n text: _vm.$tc('payments.Title'),\n href: { path: '/account/payments/home' },\n },\n {\n text: _vm.$tc('payments.ChangeSubscription'),\n href: { path: '/account/payments/overview' },\n },\n { text: _vm.$tc('payments.Confirm'), current: true },\n ]}})],1)],1),_c('v-row',[_c('v-col',{staticClass:\"z-heading-h4 text-on-background-medium notranslate\"},[_vm._v(\" \"+_vm._s(_vm.$tc(\"payments.ConfirmNewPlanTitle\"))+\" \")])],1),_c('v-row',[(_vm.duration != 3 && _vm.duration != 0 && !_vm.subscriptionExpired)?_c('v-col',{staticStyle:{\"max-width\":\"230px\"}},[_c('v-row',[_c('v-col',{staticClass:\"pb-0 text-on-background z-body-bold\"},[_vm._v(\" \"+_vm._s(_vm.$tc(\"payments.Old\"))+\" \")]),_c('v-col',{staticClass:\"text-on-background z-heading-h4 pb-0\",attrs:{\"cols\":\"12\"}},[_vm._v(\" \"+_vm._s(_vm.$tc(\"payments.Plan\") + _vm.promotionPlanOld.nameOffert)+\" \")]),_c('v-col',{staticClass:\"pt-0\"},[(_vm.duration == 1)?_c('span',{staticClass:\"text-on-background z-heading-h4 notranslate\"},[_vm._v(_vm._s(\"€ \" + _vm.promotionPlanOld.price)+\" \")]):_c('span',{staticClass:\"text-on-background z-heading-h4\"},[_vm._v(\" \"+_vm._s(\"€ \" + ( parseFloat(_vm.promotionPlanOld.price.replace(\",\", \".\")) * 10 ).toFixed(2))+\" \")]),_c('span',{staticClass:\"text-title-subscription-plan text-on-background\"},[_vm._v(\" \"+_vm._s(_vm.duration == 1 ? _vm.$tc(\"payments.Month\") : _vm.$tc(\"payments.Year\"))+\" \"+_vm._s(_vm.$tc(\"payments.IVA\"))+\" \")])]),_c('v-col',{staticClass:\"text-on-background z-label-regular pb-0 pt-0\",attrs:{\"cols\":\"12\"}},[_vm._v(\" \"+_vm._s(_vm.promotionPlanOld.monthlyBeneficiaries == \"-1\" ? _vm.$tc(\"payments.UnlimitedBeneficiaries\") : _vm.promotionPlanOld.monthlyBeneficiaries + _vm.$tc(\"payments.DescrSubscriptionPlan1\"))+\" \"+_vm._s(_vm.promotionPlanOld.totalSubjects == \"-1\" ? _vm.$tc(\"payments.UnlimitedBeneficiaries\") : _vm.promotionPlanOld.totalSubjects + _vm.$tc(\"payments.DescrSubscriptionPlan2\"))+\" \")]),_c('v-col',{staticClass:\"text-on-background z-label-regular pt-0\",attrs:{\"cols\":\"12\"}},[_vm._v(\" \"+_vm._s(!_vm.promotionPlanOld.firstSupport && !_vm.promotionPlanOld.secondSupport ? _vm.$tc(\"payments.Help\") : \"\")+\" \"+_vm._s(_vm.promotionPlanOld.firstSupport ? _vm.$tc(\"payments.Help2\") : \"\")+\" \"+_vm._s(_vm.promotionPlanOld.secondSupport ? _vm.$tc(\"payments.Help3\") : \"\")+\" \")])],1)],1):_vm._e(),(_vm.duration != 3 && _vm.duration != 0 && !_vm.subscriptionExpired)?_c('v-col',{staticClass:\"pr-10\",attrs:{\"cols\":\"auto\",\"align-self\":\"center\"}},[_c('z-icon',{attrs:{\"width\":\"32px\",\"height\":\"32px\",\"name\":\"chevron-right\",\"fill\":\"var(--z-text-neutral-default)\"}})],1):_vm._e(),_c('v-col',{attrs:{\"cols\":\"4\"}},[_c('v-row',{attrs:{\"align\":\"center\"}},[(_vm.duration != 3 && !_vm.subscriptionExpired)?_c('v-col',{staticClass:\"pb-0 text-on-background z-body-bold\"},[_vm._v(\" \"+_vm._s(_vm.$tc(\"payments.New\"))+\" \")]):_vm._e(),_c('v-col',{staticClass:\"text-on-background z-heading-h4 pb-0\",attrs:{\"cols\":\"12\"}},[_vm._v(\" \"+_vm._s(_vm.$tc(\"payments.Plan\") + _vm.promotionPlanNew.nameOffert)+\" \")]),_c('v-col',{staticClass:\"pt-0\"},[(_vm.month)?_c('span',{staticClass:\"text-on-background z-heading-h4\"},[_vm._v(\" \"+_vm._s(\"€ \" + _vm.promotionPlanNew.price)+\" \")]):_c('span',{staticClass:\"text-on-background z-heading-h4\"},[_vm._v(\" \"+_vm._s(\"€ \" + (parseFloat(_vm.promotionPlanNew.price.replace(\",\", \".\")) * 10) .toFixed(2) .replace(\".\", \",\"))+\" \")]),_c('span',{staticClass:\"text-title-subscription-plan text-on-background\"},[_vm._v(\" \"+_vm._s(_vm.month ? _vm.$tc(\"payments.Month\") : _vm.$tc(\"payments.Year\"))+\" \"+_vm._s(_vm.$tc(\"payments.IVA\"))+\" \")])]),_c('v-col',{staticClass:\"text-on-background z-label-regular pb-0 pt-0\",attrs:{\"cols\":\"12\"}},[_vm._v(\" \"+_vm._s(_vm.promotionPlanNew.monthlyBeneficiaries == \"-1\" ? _vm.$tc(\"payments.UnlimitedBeneficiaries\") : _vm.promotionPlanNew.monthlyBeneficiaries + _vm.$tc(\"payments.DescrSubscriptionPlan1\"))+\" \"+_vm._s(_vm.promotionPlanNew.totalSubjects == \"-1\" ? _vm.$tc(\"payments.UnlimitedOrderingSubjects\") : _vm.promotionPlanNew.totalSubjects + _vm.$tc(\"payments.DescrSubscriptionPlan2\"))+\" \")]),_c('v-col',{staticClass:\"text-on-background z-label-regular pt-0\",attrs:{\"cols\":\"12\"}},[_vm._v(\" \"+_vm._s(!_vm.promotionPlanNew.firstSupport && !_vm.promotionPlanNew.secondSupport ? _vm.$tc(\"payments.Help\") : \"\")+\" \"+_vm._s(_vm.promotionPlanNew.firstSupport ? _vm.$tc(\"payments.Help2\") : \"\")+_vm._s(_vm.promotionPlanNew.secondSupport ? _vm.$tc(\"payments.Help3\") : \"\")+\" \")])],1)],1)],1),_c('v-row',[(_vm.duration != 12 || _vm.downgrade)?_c('v-col',{attrs:{\"cols\":\"6\"}},[(\n _vm.duration != 0 &&\n _vm.duration != 3 &&\n _vm.subscriptionExpired == false &&\n _vm.downgrade == false\n )?_c('span',{staticClass:\"z-body-regular text-on-background\",domProps:{\"innerHTML\":_vm._s(\n '
' +\n '
' +\n _vm.$tc('payments.UpgradeDate') +\n _vm.promotionPlanNew.nameOffert +\n '?'\n )}}):_vm._e(),(\n _vm.duration != 0 &&\n _vm.duration != 3 &&\n _vm.subscriptionExpired == false &&\n _vm.downgrade == false\n )?_c('z-radio-group',{staticClass:\"pb-6\"},[_c('z-radio',{attrs:{\"label\":_vm.$tc('payments.UpgradeNow'),\"itemValue\":\"upgradeNow\"},model:{value:(_vm.radioButton),callback:function ($$v) {_vm.radioButton=$$v},expression:\"radioButton\"}}),_c('z-radio',{attrs:{\"label\":_vm.$tc('payments.UpgradeLater'),\"itemValue\":\"upgradeLater\"},model:{value:(_vm.radioButton),callback:function ($$v) {_vm.radioButton=$$v},expression:\"radioButton\"}})],1):_vm._e(),_c('span',{domProps:{\"innerHTML\":_vm._s(\n _vm.duration == 3 || _vm.subscriptionExpired || _vm.duration == 0\n ? _vm.$tc('payments.SubscribeConditions')\n : _vm.downgrade == true\n ? _vm.$tc('payments.DowngradeConditions') +\n '' +\n _vm.expiration +\n '' +\n '.' +\n _vm.$tc('payments.DowngradeConditions2')\n : _vm.radioButton == 'upgradeNow'\n ? _vm.$tc('payments.UpgradeConditions')\n : _vm.$tc('payments.UpgradeLaterDescr')\n )}}),(\n (!_vm.downgrade || _vm.subscriptionExpired || _vm.duration == 0) &&\n _vm.radioButton != 'upgradeLater'\n )?_c('span',{staticClass:\"z-body-regular text-on-background\"},[_vm._v(\" \"+_vm._s(new Date().addMonths(_vm.month ? 1 : 12).toFormat(\"dd/MM/yy\") + \".\")+\" \")]):_vm._e(),_c('br'),_c('span',{staticClass:\"z-label-regular text-on-background\"},[_vm._v(\" \"+_vm._s(_vm.$tc(\"payments.PaymentByTransfer\"))+\" \"),_c('a',{attrs:{\"href\":\"https://www.cbifast.it/contacts\",\"target\":\"_blank\"}},[_vm._v(\" \"+_vm._s(_vm.$tc(\"payments.ContactUs\"))+\" \")])])],1):_c('v-col',{attrs:{\"cols\":\"6\"}},[_c('span',{staticClass:\"z-body-regular text-on-background\",domProps:{\"innerHTML\":_vm._s(_vm.upgradeString)}}),_c('br'),_c('span',{staticClass:\"z-label-regular text-on-background\"},[_vm._v(\" \"+_vm._s(_vm.$tc(\"payments.PaymentByTransfer\"))+\" \"),_c('a',{attrs:{\"href\":\"https://www.cbifast.it/contacts\"}},[_vm._v(\" \"+_vm._s(_vm.$tc(\"payments.ContactUs\"))+\" \")])])]),_c('v-col',{staticClass:\"d-flex\",attrs:{\"cols\":\"12\"}},[_c('z-plain-button',{staticClass:\"mr-6\",attrs:{\"type\":\"neutral\"},on:{\"click\":_vm.backToPayments}},[_vm._v(\" \"+_vm._s(_vm.$tc(\"payments.Cancel\"))+\" \")]),_c('z-basic-button',{attrs:{\"type\":\"primary-color\",\"icon\":\"check\"},on:{\"click\":_vm.checkOut}},[_vm._v(\" \"+_vm._s(_vm.$tc(\"payments.Confirm\"))+\" \")])],1)],1),_c('z-dialog',{attrs:{\"title\":this.$tc('payments.Downgrade') + _vm.promotionPlanNew.nameOffert + '?',\"maxWidth\":\"400px\",\"description\":this.$tc('payments.DowngradeDescr'),\"actions\":[\n {\n slotText: _vm.$tc('payments.Cancel'),\n plainType: 'primary',\n action: () => (_vm.downgradeConfirmation = false),\n },\n {\n slotText: _vm.$tc('payments.Confirm'),\n type: 'primary-color',\n icon: 'check',\n action: () => _vm.checkOutDowngrade(),\n },\n ]},on:{\"undo\":function($event){_vm.downgradeConfirmation = false}},model:{value:(_vm.downgradeConfirmation),callback:function ($$v) {_vm.downgradeConfirmation=$$v},expression:\"downgradeConfirmation\"}})],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\nimport { Component, Prop, Vue } from \"vue-property-decorator\";\r\nimport { getModule } from \"vuex-module-decorators\";\r\nimport AuthModule from \"@/store/modules/auth.module\";\r\nimport store from \"@/store\";\r\nimport { BillingAddress } from \"@/models/entities/billing-address.interface\";\r\nimport { paymentsService } from \"@/services/api/payments.service\";\r\nimport OverlayModule from \"@/store/modules/overlay.module\";\r\nimport { subscriptionPlansService } from \"@/services/api/subscription-plan.service\";\r\nimport { PromotionPlans } from \"@/models/entities/subscription-plan.interface\";\r\nimport { userService } from \"@/services/api/user.service\";\r\nimport { Downgrade } from \"@/models/entities/downgrade.interface\";\r\nimport { UpgradePayment } from \"@/models/entities/upgrade-payment\";\r\nimport { UpgradeSubYear } from \"@/models/entities/upgrade-sub-year.interface\";\r\n\r\nconst authModule = getModule(AuthModule, store);\r\nconst overlayModule = getModule(OverlayModule, store);\r\n\r\n@Component\r\nexport default class ConfirmPlan extends Vue {\r\n @Prop({ required: true, default: null, type: Number })\r\n private roleId: number;\r\n\r\n @Prop({ required: true, default: null, type: Boolean })\r\n private month: boolean;\r\n\r\n private expiration = \"\";\r\n private duration = 0;\r\n private downgradeConfirmation = false;\r\n private subscriptionExpired = false;\r\n private newExpiration = \"\";\r\n private radioButton = \"upgradeNow\";\r\n\r\n private promotionPlanOld: PromotionPlans = {\r\n offertID: 0,\r\n nameOffert: \"\",\r\n descrOffert: \"\",\r\n price: \"\",\r\n monthlyBeneficiaries: \"\",\r\n totalSubjects: \"\",\r\n firstSupport: false,\r\n secondSupport: false,\r\n freeTrial: \"\",\r\n expiration: \"\",\r\n roleId: 0,\r\n priceMonthID: \"\",\r\n priceYearID: \"\",\r\n yearPrice: \"\",\r\n };\r\n\r\n private promotionPlanNew: PromotionPlans = {\r\n offertID: 0,\r\n nameOffert: \"\",\r\n descrOffert: \"\",\r\n price: \"\",\r\n monthlyBeneficiaries: \"\",\r\n totalSubjects: \"\",\r\n firstSupport: false,\r\n secondSupport: false,\r\n freeTrial: \"\",\r\n expiration: \"\",\r\n roleId: 0,\r\n priceMonthID: \"\",\r\n priceYearID: \"\",\r\n yearPrice: \"\",\r\n };\r\n\r\n private get downgrade(): boolean {\r\n return this.promotionPlanNew.roleId < this.promotionPlanOld.roleId;\r\n }\r\n\r\n private get upgradeString(): string {\r\n var update =\r\n this.$tc(\"payments.UpgradeYearSubscription1\") +\r\n \"\" +\r\n this.promotionPlanOld.nameOffert +\r\n \"\";\r\n update += this.month\r\n ? this.$tc(\"payments.UpgradeMonthSubscription\")\r\n : this.$tc(\"payments.UpgradeYearSubscription2\");\r\n update +=\r\n \"\" +\r\n this.promotionPlanNew.nameOffert +\r\n \"\" +\r\n this.$tc(\"payments.UpgradeYearSubscription3\") +\r\n \"\" +\r\n this.newExpiration +\r\n \"\" +\r\n \".\";\r\n return update;\r\n }\r\n\r\n private async created() {\r\n overlayModule.showOverlay();\r\n this.promotionPlanOld = (\r\n await subscriptionPlansService.GetById(authModule.profileRoleID)\r\n ).data;\r\n overlayModule.showOverlay();\r\n this.promotionPlanNew = (\r\n await subscriptionPlansService.GetById(this.roleId)\r\n ).data;\r\n overlayModule.showOverlay();\r\n this.expiration = (await subscriptionPlansService.GetExpiration()).data;\r\n overlayModule.showOverlay();\r\n this.duration = (await userService.SubscriptionDuration()).data;\r\n this.newExpiration = (\r\n await paymentsService.RemainingDaysUp(this.promotionPlanNew.priceYearID)\r\n ).data;\r\n\r\n var parse = this.expiration.split(\"/\");\r\n this.subscriptionExpired =\r\n new Date(parse[1] + \"/\" + parse[0] + \"/\" + parse[2]).getTime() <\r\n new Date().getTime();\r\n }\r\n\r\n private back() {\r\n this.$router.push({\r\n name: \"account\",\r\n params: {\r\n context: \"payments\",\r\n payments: \"overview\",\r\n },\r\n });\r\n }\r\n\r\n private backToPayments() {\r\n this.$router.push({\r\n name: \"account\",\r\n params: {\r\n context: \"payments\",\r\n payments: \"home\",\r\n },\r\n });\r\n }\r\n\r\n private checkOut() {\r\n if (this.downgrade && this.duration != 0 && !this.subscriptionExpired) {\r\n this.downgradeConfirmation = true;\r\n } else {\r\n this.checkOutUpgrade();\r\n }\r\n }\r\n\r\n private async checkOutDowngrade() {\r\n overlayModule.showOverlay();\r\n const downgrade: Downgrade = {\r\n roleId: this.promotionPlanNew.roleId,\r\n month: this.month ? \"1\" : \"12\",\r\n };\r\n await paymentsService.UpdatePlan(downgrade);\r\n this.downgradeConfirmation = false;\r\n this.$router.push({\r\n name: \"confirmationpage\",\r\n });\r\n }\r\n\r\n private async checkOutUpgrade() {\r\n overlayModule.showOverlay();\r\n const billingAddress: BillingAddress =\r\n (await userService.GetBillingAddressByID())?.data ?? null;\r\n if (\r\n billingAddress.companyName != \"\" &&\r\n billingAddress.companyAddress != \"\" &&\r\n billingAddress.city != \"\" &&\r\n billingAddress.postalCode != \"\" &&\r\n billingAddress.province != \"\" &&\r\n billingAddress.countryID != 0\r\n ) {\r\n let url = \"\";\r\n let payment: UpgradePayment = {\r\n durationMonth: 0,\r\n priceId: \"\",\r\n };\r\n let upgradeSubYear: UpgradeSubYear = {\r\n roleId: 0,\r\n priceId: \"\",\r\n durationMonth: 0,\r\n };\r\n let upgrade: Downgrade = {\r\n roleId: 0,\r\n month: \"\",\r\n };\r\n if (this.subscriptionExpired) {\r\n // ------> Rinnovo\r\n // BN: tentativo di bypass della logica contorta di pagamento\r\n payment.durationMonth = this.month ? 1 : 12;\r\n payment.priceId = this.month\r\n ? this.promotionPlanNew.priceMonthID\r\n : this.promotionPlanNew.priceYearID;\r\n url = (await paymentsService.CreateSession(payment)).data;\r\n window.open(url, \"_self\");\r\n } else if (this.month) {\r\n if (this.duration != 12) {\r\n if (this.radioButton == \"upgradeNow\" || this.duration == 3) {\r\n payment.durationMonth = 1;\r\n payment.priceId = this.promotionPlanNew.priceMonthID;\r\n url = (await paymentsService.CreateSession(payment)).data;\r\n window.open(url, \"_self\");\r\n } else {\r\n upgrade.roleId = this.promotionPlanNew.roleId;\r\n upgrade.month = \"1\";\r\n await paymentsService.UpdatePlan(upgrade);\r\n this.$router.push({\r\n name: \"confirmationpage\",\r\n });\r\n }\r\n } else {\r\n upgradeSubYear.roleId = this.promotionPlanNew.roleId;\r\n upgradeSubYear.priceId = this.promotionPlanNew.priceMonthID;\r\n upgradeSubYear.durationMonth = 1;\r\n await paymentsService.UpdateSubscriptionYear(upgradeSubYear);\r\n this.$router.push({\r\n name: \"confirmationpage\",\r\n params: { upgradeYear: \"1\" },\r\n });\r\n }\r\n } else {\r\n if (this.duration == 12 && !this.downgrade) {\r\n upgradeSubYear.roleId = this.promotionPlanNew.roleId;\r\n upgradeSubYear.priceId = this.promotionPlanNew.priceYearID;\r\n upgradeSubYear.durationMonth = 12;\r\n await paymentsService.UpdateSubscriptionYear(upgradeSubYear);\r\n this.$router.push({\r\n name: \"confirmationpage\",\r\n params: { upgradeYear: \"1\" },\r\n });\r\n } else {\r\n payment.durationMonth = 12;\r\n payment.priceId = this.promotionPlanNew.priceYearID;\r\n url = (await paymentsService.CreateSession(payment)).data;\r\n window.open(url, \"_self\");\r\n }\r\n }\r\n } else {\r\n this.$emit(\"previousPage\", this.roleId);\r\n this.$router.push({\r\n name: \"account\",\r\n params: {\r\n context: \"payments\",\r\n payments: \"billingaddress\",\r\n },\r\n });\r\n }\r\n }\r\n}\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/ts-loader/index.js??ref--15-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ConfirmPlan.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/ts-loader/index.js??ref--15-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ConfirmPlan.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./ConfirmPlan.vue?vue&type=template&id=60e8d586&\"\nimport script from \"./ConfirmPlan.vue?vue&type=script&lang=ts&\"\nexport * from \"./ConfirmPlan.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import { PromotionPlans } from \"@/models/entities/subscription-plan.interface\";\r\nimport { ApiService } from \"@zelando/vuelando\";\r\n\r\nconst controller = \"subscriptionplans\";\r\n\r\nclass SubscriptionPlansService extends ApiService {\r\n constructor() {\r\n super(process.env.VUE_APP_API_ENDPOINT);\r\n }\r\n\r\n GetAllOffert() {\r\n return this.getAll(`${controller}/getall`);\r\n }\r\n\r\n GetById(roleId: number) {\r\n return this.getAll(\r\n `${controller}/getbyid?roleId=${roleId}`\r\n );\r\n }\r\n\r\n GetExpiration() {\r\n return this.getAll(`${controller}/getexpiration`);\r\n }\r\n}\r\n\r\nexport const subscriptionPlansService = new SubscriptionPlansService();\r\n"],"sourceRoot":""}