{"version":3,"sources":["webpack:///./src/modules/profile/api/profile.ts","webpack:///./src/modules/payments/components/Payment.vue?ca0a","webpack:///./src/modules/payments/api/payments.ts","webpack:///./src/modules/payments/components/BillingInformation.vue?68f0","webpack:///./src/modules/payments/components/BillingInformation.vue?2c82","webpack:///./src/modules/payments/components/BillingInformation.vue?af30","webpack:///./src/modules/payments/components/BillingInformation.vue","webpack:///./src/modules/payments/components/Payment.vue?2ae4","webpack:///./src/modules/payments/components/Payment.vue?abc5","webpack:///./src/modules/payments/components/Payment.vue","webpack:///./src/modules/core/enums/languages.ts","webpack:///./src/modules/billing/api/billing.ts","webpack:///./src/modules/profile/classes/profile.ts","webpack:///./src/modules/payments/components/Payment.vue?9a11","webpack:///./src/modules/billing/classes/billing.ts","webpack:///./node_modules/@stripe/stripe-js/dist/stripe.esm.js","webpack:///./src/modules/payments/components/BillingInformation.vue?2b29"],"names":["this","MasterAccountId","state","auth","user","getProfile","Promise","get","response","Error","appResponse","data","IsSuccess","Result","ErrorCodes","join","getSubscription","updateProfile","profile","post","name","language","defaultPhoneNumberPrefix","marketingConsent","newsletterConsent","accountName","updatePassword","passwdChange","currentPassword","newPassword","confirmPassword","newPasswordRepeat","getSteps","render","_vm","_h","$createElement","_c","_self","directives","rawName","value","expression","staticClass","_v","_s","$t","subscription","subscriptionCode","amount","allowedDevices","allowedCallsDaily","isShopify","on","pay","installShopify","ref","cards","length","attrs","cardChanged","model","callback","$$v","selectedOption","_l","card","key","id","brand","last4","_e","cardError","staticRenderFns","store","getSubscriptionByCode","getCards","billingForm","billingFormRules","$set","item","label","loading","countries","phoneModel","phone","code","billingApi","created","Name","required","message","trigger","Address","Postcode","City","Country","mounted","getUser","Object","keys","push","validateForm","$refs","validate","submitForm","valid","updateUser","catch","error","show","msg","BillingInformation","components","PhoneInput","component","allowedCallsMonthly","externalSubscription","enabledFeatures","duration","Date","isDisplayed","hasShopifyIntegration","api","profileApi","$route","query","subCode","environment","stripeKey","stripe","stripeApi","stripeElements","elements","initCardPaymentOption","$nextTick","then","createCardPaymentOption","hadShopifyIntegration","selected","shopifyPay","defaultPay","billingInformation","isValid","billingData","paymentMethodId","billingDetails","paymentResponse","status","confirmCardPayment","clientSecret","createToken","token","cardToken","$router","result","window","location","href","subscriptionId","create","event","update","hidePostalCode","mount","Payment","Languages","UpdateStripeCustomer","Vatnr","email","EN","integrations","some","i","type","phoneNumber","V3_URL","V3_URL_REGEX","EXISTING_SCRIPT_MESSAGE","findScript","scripts","document","querySelectorAll","concat","script","test","src","injectScript","params","queryString","advancedFraudSignals","createElement","headOrBody","head","body","appendChild","registerWrapper","startTime","_registerWrapper","version","stripePromise","loadScript","resolve","reject","Stripe","console","warn","addEventListener","initStripe","maybeStripe","args","apply","undefined","stripePromise$1","loadCalled","err","loadStripe","_len","arguments","Array","_key","now"],"mappings":"wMASA,aAGE,aACEA,KAAKC,gBAAkB,OAAMC,MAAMC,MAAQ,OAAMD,MAAMC,KAAKC,KAC1D,OAAMF,MAAMC,KAAKC,KAAKH,gBACtB,KA8EN,OA3Ee,YAAAI,WAAb,W,kCAA2BC,SAAO,W,yEAC2B,SAAM,OAAoBC,IAAI,4B,OACzF,GADMC,EAAqD,UACvDA,EAEF,MAAM,IAAIC,MAGZ,GADMC,EAAyCF,EAASG,KACpDD,EAAYE,UAEd,OADMR,EAAqB,IAAI,OAAaM,EAAYG,QACjD,CAAP,EAAOT,GAEP,MAAM,IAAIK,MAAMC,EAAYI,WAAWC,KAAK,cAInC,YAAAC,gBAAb,W,kCAAgCV,SAAO,W,yEAEjC,SAAM,OAAoBC,IAAI,6B,OAGlC,GAJMC,EACF,SACEE,EAAyCF,EAASG,KAEpDD,EAAYE,UAEd,OADMR,EAAqBM,EAAYG,OAChC,CAAP,EAAOT,GAEP,MAAM,IAAIK,MAAMC,EAAYI,WAAWC,KAAK,cAInC,YAAAE,cAAb,SAA2BC,G,kCAAwBZ,SAAO,W,uEAGpD,SAAM,OAAoBa,KAAK,0BAA2B,CAC5DC,KAAMF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,gCAEnB,MAAOoG,GAEP,YADA8F,EAAO9F,QAjCP6F,EAAQ,UAPHF,GA8CPQ,EAAa,SAAoBC,EAAaC,EAAMb,GACtD,GAAoB,OAAhBY,EACF,OAAO,KAGT,IAAI/E,EAAS+E,EAAYE,WAAMC,EAAWF,GAE1C,OADAd,EAAgBlE,EAAQmE,GACjBnE,GAKLmF,EAAkB/M,QAAQoM,UAAUlE,MAAK,WAC3C,OAAOiE,EAAW,SAEhBa,GAAa,EACjBD,EAAgB,UAAS,SAAUE,GAC5BD,GACHT,QAAQC,KAAKS,MAGjB,IAAIC,EAAa,WACf,IAAK,IAAIC,EAAOC,UAAUhK,OAAQwJ,EAAO,IAAIS,MAAMF,GAAOG,EAAO,EAAGA,EAAOH,EAAMG,IAC/EV,EAAKU,GAAQF,UAAUE,GAGzBN,GAAa,EACb,IAAIjB,EAAY7E,KAAKqG,MACrB,OAAOR,EAAgB7E,MAAK,SAAUyE,GACpC,OAAOD,EAAWC,EAAaC,EAAMb,Q,kCC5HzC","file":"js/chunk-1783ed8f.e274b66c.js","sourcesContent":["import { PasswdChangeModel } from './../classes/passwdChange';\nimport { ProfileModel } from './../classes/profile';\nimport { Subscription } from './../classes/subscription';\nimport { AxiosResponse } from 'axios';\nimport AuthorizedApiClient from 'modules/auth/models/authorizedApiClient';\nimport { AppResponse } from 'modules/core/interfaces/appResponse';\nimport store from '@/store/index';\nimport { UserSteps } from '../classes/userSteps';\n\nexport class ProfileApi {\n public MasterAccountId: string;\n\n public constructor() {\n this.MasterAccountId = store.state.auth && store.state.auth.user\n ? store.state.auth.user.MasterAccountId\n : null;\n }\n\n public async getProfile(): Promise {\n const response: AxiosResponse> = await AuthorizedApiClient.get('/Account/GetProfileInfo');\n if(!response)\n {\n throw new Error();\n }\n const appResponse: AppResponse = response.data;\n if (appResponse.IsSuccess) {\n const user: ProfileModel = new ProfileModel(appResponse.Result);\n return user;\n } else {\n throw new Error(appResponse.ErrorCodes.join(','));\n }\n }\n\n public async getSubscription(): Promise {\n const response: AxiosResponse> =\n await AuthorizedApiClient.get('/Account/GetSubscription');\n const appResponse: AppResponse = response.data;\n\n if (appResponse.IsSuccess) {\n const user: Subscription = appResponse.Result;\n return user;\n } else {\n throw new Error(appResponse.ErrorCodes.join(','));\n }\n }\n\n public async updateProfile(profile: ProfileModel): Promise {\n const response: AxiosResponse<\n AppResponse\n > = await AuthorizedApiClient.post('/Account/SetProfileInfo', {\n name: profile.name,\n language: profile.language,\n defaultPhoneNumberPrefix: profile.defaultPhoneNumberPrefix,\n marketingConsent: profile.marketingConsent,\n newsletterConsent: profile.newsletterConsent,\n accountName: profile.accountName\n });\n const appResponse: AppResponse = response.data;\n if (appResponse.IsSuccess) {\n return true;\n } else {\n throw new Error(appResponse.ErrorCodes.join(','));\n }\n }\n\n public async updatePassword(passwdChange: PasswdChangeModel): Promise {\n const response: AxiosResponse<\n AppResponse\n > = await AuthorizedApiClient.post('/Account/ChangePassword', {\n currentPassword: passwdChange.currentPassword,\n newPassword: passwdChange.newPassword,\n confirmPassword: passwdChange.newPasswordRepeat,\n });\n const appResponse: AppResponse = response.data;\n if (appResponse.IsSuccess) {\n return true;\n } else {\n throw new Error(appResponse.ErrorCodes.join(','));\n }\n }\n\n public async getSteps() : Promise {\n const response : AxiosResponse> \n = await AuthorizedApiClient.get('/Account/UserSteps')\n const appResponse: AppResponse = response.data;\n if(appResponse.IsSuccess)\n {\n return appResponse.Result;\n }\n else {\n throw new Error(appResponse.ErrorCodes.join(','));\n }\n }\n}\n\ndeclare global {\n var tidioChatApi: any;\n}\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:\"loading\",rawName:\"v-loading\",value:(_vm.loading),expression:\"loading\"}],staticClass:\"page-payment\"},[_c('el-card',{staticClass:\"box-card\"},[_c('div',{staticClass:\"subscription\"},[_c('div',[_c('p',[_vm._v(\"\\n \"+_vm._s(_vm.$t('payments.subscriptionCode'))+\": \"),_c('b',[_vm._v(_vm._s(_vm.$t('plan.plans.' + _vm.subscription.subscriptionCode)))])]),_c('p',[_vm._v(\"\\n \"+_vm._s(_vm.$t('payments.amount'))+\": \"),_c('b',[_vm._v(\"$\"+_vm._s(_vm.subscription.amount))])]),_c('p',[_vm._v(\"\\n \"+_vm._s(_vm.$t('payments.allowedDevices'))+\": \"),_c('b',[_vm._v(_vm._s(_vm.subscription.allowedDevices))])]),((_vm.subscription.allowedCallsDaily !== -1))?_c('p',[_vm._v(\"\\n \"+_vm._s(_vm.$t('payments.allowedCallsDaily'))+\": \"),_c('b',[_vm._v(_vm._s(_vm.subscription.allowedCallsDaily))])]):_c('p',[_vm._v(\"\\n \"+_vm._s(_vm.$t('payments.allowedCallsDaily'))+\": \"),_c('b',[_vm._v(_vm._s(_vm.$t('payments.allowedCallsDailyUnlimited')))])])])]),(!_vm.isShopify)?_c('div',[_c('billing-information',{ref:\"billingInformation\"}),(_vm.cards.length !== 0)?_c('div',[_c('div',{staticClass:\"label\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('payments.payment.selectCard'))+\"\\n \")]),_c('el-select',{attrs:{\"placeholder\":_vm.$t('payments.payment.selectCard')},on:{\"change\":_vm.cardChanged},model:{value:(_vm.selectedOption),callback:function ($$v) {_vm.selectedOption=$$v},expression:\"selectedOption\"}},[_vm._l((_vm.cards),function(card){return _c('el-option',{key:card.id,attrs:{\"label\":card.brand + ' **** ' + card.last4,\"value\":card.id}})}),_c('el-option',{attrs:{\"label\":_vm.$t('payments.payment.addNewCard'),\"value\":\"addNewCard\"}})],2)],1):_vm._e(),(_vm.selectedOption == 'addNewCard')?_c('div',{staticClass:\"credit-card\"},[_c('div',{staticClass:\"label\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('payments.payment.creditOrDebitCard'))+\"\\n \")]),_c('div',{attrs:{\"id\":\"card-element\"}}),_c('div',{staticClass:\"error\",attrs:{\"role\":\"alert\"}},[_vm._v(\"\\n \"+_vm._s(_vm.cardError)+\"\\n \")])]):_vm._e(),_c('div',{staticClass:\"payment-button\"},[_c('el-button',{staticClass:\"payment el-button\",on:{\"click\":_vm.pay}},[_vm._v(_vm._s(_vm.$t('payments.payment.pay')))])],1)],1):_c('div',[(_vm.hasShopifyIntegration)?_c('div',[_c('div',[_c('p',[_vm._v(_vm._s(_vm.$t('payments.payment.shopifyInfo')))])]),_c('div',{staticClass:\"payment-button\"},[_c('el-button',{staticClass:\"payment el-button\",on:{\"click\":_vm.pay}},[_vm._v(_vm._s(_vm.$t('payments.payment.goToShopify')))])],1)]):_c('div',[_c('div',[_c('p',[_vm._v(_vm._s(_vm.$t('payments.payment.shopifyRemovedIntegrationInfo')))])]),_c('div',{staticClass:\"payment-button\"},[_c('el-button',{staticClass:\"payment el-button\",on:{\"click\":_vm.installShopify}},[_vm._v(_vm._s(_vm.$t('payments.payment.goToShopify')))])],1)])])])],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { PaymentOptionsVm } from '../../payment-settings/classes/paymentOptions';\nimport { PaymentData } from './../classes/paymentData';\nimport { AppResponse } from 'modules/core/interfaces/appResponse';\nimport AuthorizedApiClient from 'modules/auth/models/authorizedApiClient';\nimport { AxiosResponse } from 'axios';\nimport { SubscriptionVm } from '../classes/subscriptionVm';\nimport store from '@/store/index';\nimport { CreatePaymentResponse } from '../classes/createPaymentResponse';\nimport { loadStripe, Stripe } from '@stripe/stripe-js';\n\nexport class PaymentsApi {\n public MasterAccountId: string;\n\n public constructor() {\n this.MasterAccountId = store.state.auth && store.state.auth.user\n ? store.state.auth.user.MasterAccountId\n : null;\n }\n\n public async getSubscriptionByCode(subscriptionCode: string): Promise {\n const response: AxiosResponse<\n AppResponse\n > = await AuthorizedApiClient.get('/subscription/GetSubscription?subscriptionCode=' + subscriptionCode);\n\n const appResponse: AppResponse = response.data;\n if (appResponse.IsSuccess) {\n return appResponse.Result;\n } else {\n throw new Error(appResponse.ErrorCodes.join(','));\n }\n }\n\n public async pay(data: PaymentData): Promise {\n const response: AxiosResponse<\n AppResponse\n > = await AuthorizedApiClient.post('/payment/Create', data);\n\n const appResponse = response.data;\n \n if (appResponse.IsSuccess) {\n return appResponse.Result;\n } else {\n throw new Error(appResponse.ErrorCodes.join(','));\n }\n }\n\n public async getCards(): Promise {\n const response: AxiosResponse<\n AppResponse\n > = await AuthorizedApiClient.get('/payment/GetUserCards');\n\n const appResponse: AppResponse = response.data;\n if (appResponse.IsSuccess) {\n return appResponse.Result;\n } else {\n throw new Error(appResponse.ErrorCodes.join(','));\n }\n }\n}\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:\"loading\",rawName:\"v-loading\",value:(_vm.loading),expression:\"loading\"}],staticClass:\"billing-information\"},[_c('div',{staticClass:\"billing-form\"},[_c('el-form',{ref:\"billingForm\",staticClass:\"login-form\",attrs:{\"model\":_vm.billingForm,\"rules\":_vm.billingFormRules,\"label-position\":\"right\",\"label-width\":\"120px\"}},[_c('el-form-item',{attrs:{\"label\":_vm.$t('billing.name'),\"prop\":\"Name\"}},[_c('el-input',{attrs:{\"type\":\"text\",\"placeholder\":_vm.$t('billing.name')},model:{value:(_vm.billingForm.Name),callback:function ($$v) {_vm.$set(_vm.billingForm, \"Name\", $$v)},expression:\"billingForm.Name\"}})],1),_c('el-form-item',{attrs:{\"label\":_vm.$t('billing.address'),\"prop\":\"Address\"}},[_c('el-input',{attrs:{\"type\":\"text\",\"placeholder\":_vm.$t('billing.address')},model:{value:(_vm.billingForm.Address),callback:function ($$v) {_vm.$set(_vm.billingForm, \"Address\", $$v)},expression:\"billingForm.Address\"}})],1),_c('el-form-item',{attrs:{\"label\":_vm.$t('billing.postcode'),\"prop\":\"Postcode\"}},[_c('el-input',{attrs:{\"type\":\"text\",\"placeholder\":_vm.$t('billing.postcode')},model:{value:(_vm.billingForm.Postcode),callback:function ($$v) {_vm.$set(_vm.billingForm, \"Postcode\", $$v)},expression:\"billingForm.Postcode\"}})],1),_c('el-form-item',{attrs:{\"label\":_vm.$t('billing.city'),\"prop\":\"City\"}},[_c('el-input',{attrs:{\"type\":\"text\",\"placeholder\":_vm.$t('billing.city')},model:{value:(_vm.billingForm.City),callback:function ($$v) {_vm.$set(_vm.billingForm, \"City\", $$v)},expression:\"billingForm.City\"}})],1),_c('el-form-item',{attrs:{\"label\":_vm.$t('billing.country'),\"prop\":\"Country\"}},[_c('el-select',{attrs:{\"filterable\":\"\",\"placeholder\":_vm.$t('billing.country')},model:{value:(_vm.billingForm.Country),callback:function ($$v) {_vm.$set(_vm.billingForm, \"Country\", $$v)},expression:\"billingForm.Country\"}},_vm._l((_vm.countries),function(item){return _c('el-option',{key:item.value,attrs:{\"label\":item.label,\"value\":item.value}})}),1)],1),_c('el-form-item',{attrs:{\"label\":_vm.$t('billing.vatnr'),\"prop\":\"Vatnr\"}},[_c('el-input',{attrs:{\"type\":\"text\",\"placeholder\":_vm.$t('billing.vatnr')},model:{value:(_vm.billingForm.Vatnr),callback:function ($$v) {_vm.$set(_vm.billingForm, \"Vatnr\", $$v)},expression:\"billingForm.Vatnr\"}})],1)],1)],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Component, Vue, Watch } from 'vue-property-decorator';\nimport { BillingApi } from 'modules/billing/api/billing';\nimport { BillingModel } from 'modules/billing/classes/billing';\nimport { SelectOptions } from 'modules/core/interfaces/selectOptions';\nimport { ElForm } from 'element-ui/types/form';\nimport AppMessage from 'modules/core/models/appMessage';\nimport Countries from '@/i18n/en/countries';\nimport PhoneInput from 'modules/core/components/forms/PhoneInput.vue';\n\n@Component({\n components : {\n PhoneInput,\n },\n})\nexport default class BillingInformation extends Vue {\n public loading: boolean = false;\n public billingFormRules!: any;\n public countries: Array> = [];\n\n private billingApi: BillingApi;\n private billingForm: BillingModel;\n private phoneModel = {\n phone: '',\n code: '',\n };\n\n constructor() {\n super();\n this.billingApi = new BillingApi();\n this.billingForm = new BillingModel();\n }\n\n public created() {\n this.billingFormRules = {\n Name: [\n { required: true, message: this.$t('forms.required'), trigger: 'blur' },\n ],\n Address: [\n { required: true, message: this.$t('forms.required'), trigger: 'blur' },\n ],\n Postcode: [\n { required: true, message: this.$t('forms.required'), trigger: 'blur' },\n ],\n City: [\n { required: true, message: this.$t('forms.required'), trigger: 'blur' },\n ],\n Country: [\n { required: true, message: this.$t('forms.required'), trigger: 'blur' },\n ],\n // PhoneNumber: [\n // {\n // trigger: 'blur',\n // validator: (rule: any, value: string, callback: (error?: Error) => void) => {\n // if ((this.$refs.phoneInput as PhoneInput).validate()) {\n // callback();\n // } else {\n // callback(new Error(this.$t('forms.wrongPhone') as string));\n // }\n // },\n // },\n // ],\n };\n }\n\n public async mounted() {\n this.loading = true;\n\n const user: BillingModel = await this.billingApi.getUser();\n\n this.billingForm = user;\n // if (user.PhoneNumber) {\n // this.insertPhoneNumber();\n // }\n\n for (const item of Object.keys(Countries)) {\n this.countries.push({\n value: item,\n label: this.$t('forms.options.langs.' + item) as string,\n });\n }\n\n this.loading = false;\n }\n\n public validateForm() {\n return (this.$refs.billingForm as ElForm).validate();\n }\n\n public submitForm() {\n (this.$refs.billingForm as ElForm).validate((valid: boolean) => {\n if (valid) {\n this.billingApi.updateUser(this.billingForm, false).catch((error: Error) => {\n AppMessage.show(this.$t('forms.error', { msg: error }), 'error');\n });\n } else {\n return false;\n }\n });\n }\n\n // public updatePhoneNumber(val: any) {\n // this.billingForm.PhoneNumber = val.code + val.phone;\n // this.phoneModel = val;\n // }\n\n // public insertPhoneNumber() {\n // const phoneNumberLenght = this.billingForm.PhoneNumber.length;\n // this.phoneModel = {\n // phone: this.billingForm.PhoneNumber.substr(-9),\n // code: this.billingForm.PhoneNumber.slice(0, phoneNumberLenght - 9),\n // };\n // }\n}\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/ts-loader/index.js??ref--12-2!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./BillingInformation.vue?vue&type=script&lang=ts\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/ts-loader/index.js??ref--12-2!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./BillingInformation.vue?vue&type=script&lang=ts\"","import { render, staticRenderFns } from \"./BillingInformation.vue?vue&type=template&id=2786bb4c\"\nimport script from \"./BillingInformation.vue?vue&type=script&lang=ts\"\nexport * from \"./BillingInformation.vue?vue&type=script&lang=ts\"\nimport style0 from \"./BillingInformation.vue?vue&type=style&index=0&id=2786bb4c&prod&lang=scss\"\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","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Component, Vue, Prop } from 'vue-property-decorator';\nimport { SubscriptionVm } from '../classes/subscriptionVm';\nimport { PaymentsApi } from '../api/payments';\nimport { loadStripe, Stripe, StripeElements, StripeElement, Card, StripeCardElement } from '@stripe/stripe-js';\nimport environment from '@/environment';\nimport BillingInformation from './BillingInformation.vue';\nimport { BillingModel } from '../../billing/classes/billing';\nimport AppMessage from '../../core/models/appMessage';\nimport { PaymentOptionsVm } from '../../payment-settings/classes/paymentOptions';\nimport { ProfileApi } from '../../profile/api/profile';\n\n@Component({\n components: {\n BillingInformation,\n },\n})\n\nexport default class Payment extends Vue {\n public loading: boolean = false;\n public key!: string;\n public subscription: SubscriptionVm = {\n subscriptionCode: '',\n allowedDevices: 0,\n allowedCallsMonthly: 0,\n externalSubscription: false,\n enabledFeatures: [],\n duration: new Date(),\n isDisplayed: false,\n amount: 0,\n };\n public cardError: string = '';\n public card!: StripeCardElement;\n public cards: Card[] = [];\n public selectedOption: string = '';\n private api!: PaymentsApi;\n private stripeApi!: Stripe;\n private stripeElements!: StripeElements;\n private billingData?: BillingModel;\n private isShopify: boolean = false;\n private hasShopifyIntegration: boolean = false;\n private profileApi: ProfileApi;\n\n constructor() {\n super();\n this.api = new PaymentsApi();\n this.profileApi = new ProfileApi();\n }\n\n public async created() {\n this.loading = true;\n this.key = this.$route.query.key as string;\n this.subscription = await this.api.getSubscriptionByCode(this.$route.query.subCode as string);\n const cards = await this.api.getCards();\n if (cards.data) {\n this.cards = cards.data;\n }\n\n const stripe = await loadStripe(environment.stripeKey);\n if (stripe) {\n this.stripeApi = stripe;\n } else {\n throw Error('failed to load stripe');\n }\n this.stripeElements = this.stripeApi.elements();\n\n this.initCardPaymentOption();\n if (this.cards.length === 0) {\n this.selectedOption = 'addNewCard';\n this.$nextTick().then(() => {\n this.createCardPaymentOption();\n });\n }\n\n const profile = await this.profileApi.getProfile();\n\n this.isShopify = profile.hadShopifyIntegration;\n this.hasShopifyIntegration = profile.hasShopifyIntegration;\n\n this.loading = false;\n }\n\n public cardChanged(selected: string) {\n if (selected === 'addNewCard') {\n this.$nextTick().then(() => {\n this.createCardPaymentOption();\n });\n }\n }\n\n public async pay() {\n this.loading = true;\n\n try {\n if (this.isShopify) {\n await this.shopifyPay();\n } else {\n await this.defaultPay();\n }\n } catch (error) {\n AppMessage.show(this.$t('payments.payment.error'), 'error');\n }\n\n this.loading = false;\n }\n\n public async defaultPay() {\n try {\n const isValid = await (this.$refs.billingInformation as BillingInformation).validateForm();\n\n if (isValid === false) {\n return;\n }\n } catch (error) {\n return false;\n }\n\n if (this.selectedOption === '') {\n AppMessage.show(this.$t('payments.payment.selectCardError'), 'error');\n return false;\n }\n\n (this.$refs.billingInformation as Vue & { submitForm: () => {}}).submitForm();\n this.billingData = (this.$refs.billingInformation as Vue & { billingForm: BillingModel }).billingForm;\n\n if (this.selectedOption !== 'addNewCard') {\n var paymentResponse = await this.api.pay({\n paymentMethodId: this.selectedOption,\n subscriptionCode: this.subscription.subscriptionCode,\n billingDetails: this.billingData!,\n });\n if(paymentResponse.status == 'use_stripe_sdk')\n {\n await this.stripeApi.confirmCardPayment(paymentResponse.clientSecret);\n }\n } else {\n const token = await this.stripeApi.createToken(this.card);\n\n var paymentResponse = await this.api.pay({\n cardToken: token.token!.id,\n subscriptionCode: this.subscription.subscriptionCode,\n billingDetails: this.billingData!,\n });\n if(paymentResponse.status == 'use_stripe_sdk')\n {\n await this.stripeApi.confirmCardPayment(paymentResponse.clientSecret);\n }\n }\n\n AppMessage.show(this.$t('payments.payment.success'), 'success');\n this.$router.push('/plan?currentPlan=' + this.subscription.subscriptionCode);\n }\n\n public async shopifyPay() {\n const result = await this.api.pay({\n paymentMethodId: 'shopify',\n subscriptionCode: this.subscription.subscriptionCode,\n });\n\n window.location.href = result.subscriptionId;\n }\n\n public installShopify() {\n window.location.href = 'https://shopify.com/';\n }\n\n public initCardPaymentOption() {\n this.card = this.stripeElements.create('card');\n this.card.on('change', (event) => {\n if (event.error) {\n this.cardError = event.error.message;\n } else {\n this.cardError = '';\n }\n });\n }\n\n public createCardPaymentOption() {\n this.card.update({ hidePostalCode : true });\n this.card.mount('#card-element');\n }\n}\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/ts-loader/index.js??ref--12-2!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Payment.vue?vue&type=script&lang=ts\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/ts-loader/index.js??ref--12-2!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Payment.vue?vue&type=script&lang=ts\"","import { render, staticRenderFns } from \"./Payment.vue?vue&type=template&id=21183672\"\nimport script from \"./Payment.vue?vue&type=script&lang=ts\"\nexport * from \"./Payment.vue?vue&type=script&lang=ts\"\nimport style0 from \"./Payment.vue?vue&type=style&index=0&id=21183672&prod&lang=scss\"\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","export enum Languages {\n PL = 'pl',\n EN = 'en',\n}\n","import { BillingModel } from '../classes/billing';\nimport { AxiosResponse } from 'axios';\nimport AuthorizedApiClient from 'modules/auth/models/authorizedApiClient';\nimport { AppResponse } from 'modules/core/interfaces/appResponse';\nimport store from '@/store/index';\n\nexport class BillingApi {\n public MasterAccountId: string;\n\n public constructor() {\n this.MasterAccountId = store.state.auth && store.state.auth.user\n ? store.state.auth.user.MasterAccountId\n : null;\n }\n\n public async getUser(): Promise {\n const MasterAccountId = this.MasterAccountId;\n const response: AxiosResponse> = await AuthorizedApiClient.get('/AccountBillingDetails/Get');\n const appResponse: AppResponse = response.data;\n\n if (appResponse.IsSuccess) {\n const user: BillingModel = appResponse.Result;\n return user;\n } else {\n throw new Error(appResponse.ErrorCodes.join(','));\n }\n }\n\n public async updateUser(profile: BillingModel, UpdateStripeCustomer: boolean): Promise {\n const MasterAccountId = this.MasterAccountId;\n const response: AxiosResponse<\n AppResponse\n > = await AuthorizedApiClient.post('/AccountBillingDetails/Save', {\n Name: profile.Name,\n // PhoneNumber: profile.PhoneNumber,\n Vatnr: profile.Vatnr,\n Address: profile.Address,\n Postcode: profile.Postcode,\n City: profile.City,\n Country: profile.Country,\n MasterAccountId,\n UpdateStripeCustomer,\n });\n const appResponse: AppResponse = response.data;\n if (appResponse.IsSuccess) {\n return true;\n } else {\n throw new Error(appResponse.ErrorCodes.join(','));\n }\n }\n}\n","import { Languages } from '@/modules/core/enums/languages';\nimport { IntegrationDefinition } from './integrationDefinition';\n\nexport class ProfileModel {\n public email: string;\n public name: string;\n public accountName: string;\n public language: Languages;\n public integrations: IntegrationDefinition[];\n public hasShopifyIntegration: boolean = false;\n public hadShopifyIntegration: boolean = false;\n public defaultPhoneNumberPrefix: string;\n public phoneNumber: string;\n public marketingConsent: boolean;\n public newsletterConsent: boolean;\n public constructor(data?: ProfileModel) {\n this.email = (data && data.email) ? data.email : '';\n this.name = (data && data.name) ? data.name : '';\n this.accountName = (data && data.accountName) ? data.accountName : '';\n this.language = (data && data.language) ? data.language : Languages.EN;\n this.integrations = (data && data.integrations) ? data.integrations : [];\n this.hadShopifyIntegration = (data && data.hadShopifyIntegration) ? data.hadShopifyIntegration : false;\n this.hasShopifyIntegration = this.integrations.some((i) => i.type === 'shopify');\n this.defaultPhoneNumberPrefix = (data && data.defaultPhoneNumberPrefix) ? data.defaultPhoneNumberPrefix : '+48';\n this.phoneNumber = (data && data.phoneNumber) ? data.phoneNumber : '+48';\n this.marketingConsent = (data && data.marketingConsent) ? data.marketingConsent : false;\n this.newsletterConsent = (data && data.newsletterConsent) ? data.newsletterConsent : false;\n }\n}\n","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Payment.vue?vue&type=style&index=0&id=21183672&prod&lang=scss\"","export class BillingModel {\n public Name: string;\n public Vatnr: string;\n // public PhoneNumber: string;\n public Address: string;\n public Postcode: string;\n public City: string;\n public Country: string;\n\n public constructor(data?: BillingModel) {\n this.Name = (data && data.Name) ? data.Name : '';\n this.Vatnr = (data && data.Vatnr) ? data.Vatnr : '';\n // this.PhoneNumber = (data && data.PhoneNumber) ? data.PhoneNumber : '';\n this.Address = (data && data.Address) ? data.Address : '';\n this.Postcode = (data && data.Postcode) ? data.Postcode : '';\n this.City = (data && data.City) ? data.City : '';\n this.Country = (data && data.Country) ? data.Country : '';\n }\n}\n","var V3_URL = 'https://js.stripe.com/v3';\nvar V3_URL_REGEX = /^https:\\/\\/js\\.stripe\\.com\\/v3\\/?(\\?.*)?$/;\nvar EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';\nvar findScript = function findScript() {\n var scripts = document.querySelectorAll(\"script[src^=\\\"\".concat(V3_URL, \"\\\"]\"));\n\n for (var i = 0; i < scripts.length; i++) {\n var script = scripts[i];\n\n if (!V3_URL_REGEX.test(script.src)) {\n continue;\n }\n\n return script;\n }\n\n return null;\n};\n\nvar injectScript = function injectScript(params) {\n var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : '';\n var script = document.createElement('script');\n script.src = \"\".concat(V3_URL).concat(queryString);\n var headOrBody = document.head || document.body;\n\n if (!headOrBody) {\n throw new Error('Expected document.body not to be null. Stripe.js requires a element.');\n }\n\n headOrBody.appendChild(script);\n return script;\n};\n\nvar registerWrapper = function registerWrapper(stripe, startTime) {\n if (!stripe || !stripe._registerWrapper) {\n return;\n }\n\n stripe._registerWrapper({\n name: 'stripe-js',\n version: \"1.54.2\",\n startTime: startTime\n });\n};\n\nvar stripePromise = null;\nvar loadScript = function loadScript(params) {\n // Ensure that we only attempt to load Stripe.js at most once\n if (stripePromise !== null) {\n return stripePromise;\n }\n\n stripePromise = new Promise(function (resolve, reject) {\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n // Resolve to null when imported server side. This makes the module\n // safe to import in an isomorphic code base.\n resolve(null);\n return;\n }\n\n if (window.Stripe && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n }\n\n if (window.Stripe) {\n resolve(window.Stripe);\n return;\n }\n\n try {\n var script = findScript();\n\n if (script && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n } else if (!script) {\n script = injectScript(params);\n }\n\n script.addEventListener('load', function () {\n if (window.Stripe) {\n resolve(window.Stripe);\n } else {\n reject(new Error('Stripe.js not available'));\n }\n });\n script.addEventListener('error', function () {\n reject(new Error('Failed to load Stripe.js'));\n });\n } catch (error) {\n reject(error);\n return;\n }\n });\n return stripePromise;\n};\nvar initStripe = function initStripe(maybeStripe, args, startTime) {\n if (maybeStripe === null) {\n return null;\n }\n\n var stripe = maybeStripe.apply(undefined, args);\n registerWrapper(stripe, startTime);\n return stripe;\n}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\n// own script injection.\n\nvar stripePromise$1 = Promise.resolve().then(function () {\n return loadScript(null);\n});\nvar loadCalled = false;\nstripePromise$1[\"catch\"](function (err) {\n if (!loadCalled) {\n console.warn(err);\n }\n});\nvar loadStripe = function loadStripe() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n loadCalled = true;\n var startTime = Date.now();\n return stripePromise$1.then(function (maybeStripe) {\n return initStripe(maybeStripe, args, startTime);\n });\n};\n\nexport { loadStripe };\n","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./BillingInformation.vue?vue&type=style&index=0&id=2786bb4c&prod&lang=scss\""],"sourceRoot":""}