{"version":3,"sources":["webpack:///./src/views/bankaccounts/BankAccountPurchaseFunds.vue?a219","webpack:///./src/models/bankaccounts/BankAccountPurchaseFundsRequestModel.ts","webpack:///./src/views/bankaccounts/BankAccountPurchaseFunds.vue","webpack:///./src/views/bankaccounts/BankAccountPurchaseFunds.vue?deb2","webpack:///./src/views/bankaccounts/BankAccountPurchaseFunds.vue?1682","webpack:///./src/models/products/ProductResponseModel.ts","webpack:///./src/apis/ProductsApi.ts"],"names":["render","_vm","this","_h","$createElement","_c","_self","attrs","staticClass","name","_v","params","bankAccountId","authorized","_e","ref","_s","product","description","_f","price","on","$event","subtractQuantity","addQuantity","quantity","total","cardError","disablePurchaseButton","processing","purchaseClick","_l","e","index","key","staticRenderFns","paymentToken","stripe","Stripe","elements","card","create","cardComplete","isFormValid","resetProcessingValues","createToken","token","error","message","request","id","api","BankAccountsApi","purchaseFundsAsync","$store","state","member","jwt","commit","$router","push","toString","handleProcessingErrorAsync","selectedBankAccount","authorizedOperations","BankAccountOperations","PURCHASE_FUNDS","resetInitializationValues","ProductsApi","getProductAsync","handleInitializationErrorAsync","initializing","showProduct","$nextTick","mount","addEventListener","complete","form","$refs","purchaseFundsForm","validate","initializationError","ViewBase","default","required","component","VAlert","VBtn","VCard","VCardText","VCardTitle","VCol","VContainer","VForm","VIcon","VList","VListItem","VListItemContent","VListItemSubtitle","VListItemTitle","VProgressCircular","VRow","productId","httpClient","CashTamerHttpClient","url","getAsync","httpResponse","data","handleApiError","CashTamerApiBase"],"mappings":"yHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,cAAc,CAACA,EAAG,QAAQ,CAACE,MAAM,CAAC,QAAU,WAAW,CAACF,EAAG,QAAQ,CAACE,MAAM,CAAC,KAAO,KAAK,GAAK,KAAK,GAAK,IAAI,GAAK,IAAI,GAAK,MAAM,CAACF,EAAG,cAAc,CAACG,Y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cyF,EAAaC,KAAK1F,YACxCD,EAAQG,MAAQuF,EAAaC,KAAKxF,M,kBAE3BH,G,8DAGAf,KAAK2G,eAAL,O,yHAnBsBC,EAAA","file":"js/chunk-61894af0.885001c3.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-container',[_c('v-row',{attrs:{\"justify\":\"center\"}},[_c('v-col',{attrs:{\"cols\":\"12\",\"xs\":\"12\",\"sm\":\"9\",\"md\":\"9\",\"lg\":\"6\"}},[_c('router-link',{staticClass:\"mr-2\",attrs:{\"to\":{name: 'memberbankaccounts'}}},[_vm._v(\"Bank Accounts\")]),_c('v-icon',{attrs:{\"small\":\"\"}},[_vm._v(\"mdi-forward\")]),_c('router-link',{staticClass:\"ml-2\",attrs:{\"to\":{name: 'bankaccountdashboard', params:{bankAccountId: _vm.bankAccountId}}}},[_vm._v(\"Bank Account\")])],1)],1),_c('v-row',{attrs:{\"justify\":\"center\"}},[_c('v-col',{attrs:{\"cols\":\"12\",\"xs\":\"12\",\"sm\":\"9\",\"md\":\"9\",\"lg\":\"6\"}},[_c('v-card',[_c('v-card-title',{staticClass:\"headline justify-center\"},[_vm._v(\"PURCHASE FUNDS\")]),_c('v-card-text',{staticClass:\"mt-2 black--text\"},[(!_vm.authorized)?_c('div',{staticClass:\"text-center\"},[_c('v-alert',{attrs:{\"type\":\"error\",\"outlined\":\"\"}},[_vm._v(\"Purchasing funds is not authorized.\")])],1):_vm._e(),(_vm.authorized)?_c('div',[(_vm.initializing)?_c('div',{staticClass:\"text-center\"},[_c('v-progress-circular',{attrs:{\"indeterminate\":\"\",\"color\":\"primary\"}})],1):_vm._e(),(_vm.initializationError)?_c('div',{staticClass:\"text-center\"},[_c('v-alert',{attrs:{\"type\":\"error\",\"outlined\":\"\"}},[_vm._v(\"An error occurred while processing the request.\")])],1):_vm._e(),(_vm.showProduct)?_c('div',[_c('v-form',{ref:\"purchaseFundsForm\",staticClass:\"px-3\"},[_c('v-list',{staticClass:\"mt-0 pa-0\"},[_c('v-list-item',{staticClass:\"mb-2\"},[_c('v-list-item-content',[_c('v-list-item-title',{staticClass:\"mb-4\"},[_vm._v(\"Product Name\")]),_c('v-list-item-subtitle',{staticClass:\"ml-2\"},[_vm._v(_vm._s(_vm.product.name))])],1)],1),_c('v-list-item',{staticClass:\"mb-2\"},[_c('v-list-item-content',[_c('v-list-item-title',{staticClass:\"mb-4\"},[_vm._v(\"Product Description\")]),_c('v-list-item-subtitle',{staticClass:\"ml-2 text-wrap\"},[_vm._v(_vm._s(_vm.product.description))])],1)],1),_c('v-list-item',{staticClass:\"mb-2\"},[_c('v-list-item-content',[_c('v-list-item-title',{staticClass:\"mb-4\"},[_vm._v(\"Product Price\")]),_c('v-list-item-subtitle',{staticClass:\"ml-2\"},[_vm._v(_vm._s(_vm._f(\"formatCurrency\")(_vm.product.price))+\" \"),_c('span',{staticClass:\"caption ml-4 text-wrap\"},[_vm._v(\"Prices are in US Dollars and are subject to change at any time.\")])])],1)],1),_c('v-list-item',{staticClass:\"mb-2\"},[_c('v-list-item-content',[_c('v-list-item-title',{staticClass:\"mb-4\"},[_vm._v(\"Quantity\")]),_c('v-list-item-subtitle',{staticClass:\"ml-2\"},[_c('v-icon',{staticClass:\"mr-1\",attrs:{\"large\":\"\"},on:{\"click\":function($event){return _vm.subtractQuantity()}}},[_vm._v(\"mdi-minus-box\")]),_c('v-icon',{staticClass:\"ml-1 mr-4\",attrs:{\"large\":\"\"},on:{\"click\":function($event){return _vm.addQuantity()}}},[_vm._v(\"mdi-plus-box\")]),_vm._v(\" \"+_vm._s(_vm.quantity)+\" \")],1)],1)],1),_c('v-list-item',{staticClass:\"mb-2\"},[_c('v-list-item-content',[_c('v-list-item-title',{staticClass:\"mb-4\"},[_vm._v(\"Total\")]),_c('v-list-item-subtitle',{staticClass:\"ml-2\"},[_vm._v(_vm._s(_vm._f(\"formatCurrency\")(_vm.total)))])],1)],1),_c('v-list-item',{staticClass:\"mb-2\"},[_c('v-list-item-content',[_c('v-list-item-title',{staticClass:\"mb-4\"},[_vm._v(\"Payment Information\")]),_c('v-list-item-subtitle',{staticClass:\"ml-2\"},[_c('div',{attrs:{\"id\":\"card-element\"}}),_c('div',{staticClass:\"red--text mt-4\"},[_vm._v(_vm._s(_vm.cardError))])])],1)],1)],1),_c('div',{staticClass:\"text-center mt-4\"},[_c('v-btn',{staticClass:\"primary\",attrs:{\"disabled\":_vm.disablePurchaseButton,\"loading\":_vm.processing},on:{\"click\":_vm.purchaseClick}},[_vm._v(\"PURCHASE\")])],1),(_vm.processingError)?_c('div',{staticClass:\"text-center mt-4\"},_vm._l((_vm.processingErrors),function(e,index){return _c('div',{key:index},[_c('v-alert',{attrs:{\"value\":true,\"type\":\"error\",\"outlined\":\"\"}},[_vm._v(_vm._s(e))])],1)}),0):_vm._e()],1)],1):_vm._e()]):_vm._e()])],1)],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\nexport default class BankAccountPurchaseFundsRequestModel {\r\n public quantity: number = 0;\r\n public paymentToken: string = '';\r\n}\r\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\n\n\n\n\n\n\n\n\n\n\r\nimport {Component, Prop, Vue} from 'vue-property-decorator';\r\nimport ViewBase from '@/views/ViewBase';\r\nimport {BankAccountOperations} from '@/enums/BankAccountOperations';\r\nimport BankAccountsApi from '@/apis/BankAccountsApi';\r\nimport ProductsApi from '@/apis/ProductsApi';\r\nimport ProductResponseModel from '@/models/products/ProductResponseModel';\r\nimport BankAccountPurchaseFundsRequestModel from '@/models/bankaccounts/BankAccountPurchaseFundsRequestModel';\r\n\r\ndeclare var Stripe: any;\r\nconst stripe = Stripe(process.env.VUE_APP_STRIPE_PUBLISH_KEY);\r\nconst elements = stripe.elements();\r\nconst card = elements.create('card');\r\n\r\n@Component({\r\n name: 'BankAccountPurchaseFunds',\r\n },\r\n)\r\nexport default class BankAccountPurchaseFunds extends ViewBase {\r\n @Prop({default: 0, required: true})\r\n public bankAccountId!: number;\r\n\r\n public product?: ProductResponseModel;\r\n public authorized: boolean = false;\r\n\r\n public quantity: number = 0;\r\n public cardError: string = '';\r\n public cardComplete: boolean = false;\r\n\r\n public get showProduct(): boolean {\r\n if ( !this.initializing && !this.initializationError ) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public get total(): number {\r\n if ( this.product ) {\r\n return this.quantity * this.product.price;\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n public addQuantity() {\r\n this.quantity = this.quantity + 1;\r\n }\r\n\r\n public subtractQuantity() {\r\n if ( this.quantity > 0 ) {\r\n this.quantity = this.quantity - 1;\r\n }\r\n }\r\n\r\n public get disablePurchaseButton(): boolean {\r\n if ( this.quantity === 0 ) {\r\n return true;\r\n }\r\n\r\n if ( !this.cardComplete ) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public async purchaseClick() {\r\n\r\n if ( this.isFormValid() ) {\r\n try {\r\n this.resetProcessingValues();\r\n\r\n const {token, error} = await stripe.createToken(card);\r\n\r\n if ( error ) {\r\n this.cardError = error.message;\r\n }\r\n else {\r\n const request = new BankAccountPurchaseFundsRequestModel();\r\n request.quantity = this.quantity;\r\n request.paymentToken = token.id;\r\n\r\n const api = new BankAccountsApi();\r\n const response = await api.purchaseFundsAsync(this.bankAccountId, this.$store.state.member.jwt, request);\r\n\r\n this.$store.commit('mutateSnackbarText', 'Thank you for your purchase.');\r\n this.$store.commit('mutateShowSnackbar', true);\r\n\r\n await this.$router.push({name: 'bankaccountdashboard', params: { bankAccountId: this.bankAccountId.toString(10)}});\r\n }\r\n }\r\n catch ( err ) {\r\n await this.handleProcessingErrorAsync(err);\r\n }\r\n finally {\r\n this.processing = false;\r\n }\r\n }\r\n }\r\n\r\n public async created() {\r\n if ( this.$store.state.selectedBankAccount.authorizedOperations & BankAccountOperations.PURCHASE_FUNDS )\r\n {\r\n this.authorized = true;\r\n\r\n try {\r\n this.resetInitializationValues();\r\n\r\n const api = new ProductsApi();\r\n this.product = await api.getProductAsync(2);\r\n }\r\n catch ( err ) {\r\n await this.handleInitializationErrorAsync(err);\r\n }\r\n finally {\r\n this.initializing = false;\r\n }\r\n\r\n if ( this.showProduct ) {\r\n\r\n this.$nextTick(() => {\r\n card.mount('#card-element');\r\n card.addEventListener('change', (e: any) => {\r\n if (e.error) {\r\n this.cardError = e.error.message;\r\n }\r\n else {\r\n this.cardError = '';\r\n }\r\n this.cardComplete = e.complete;\r\n });\r\n });\r\n }\r\n\r\n }\r\n }\r\n\r\n private isFormValid(): boolean {\r\n const form: any = this.$refs.purchaseFundsForm;\r\n\r\n return form.validate();\r\n }\r\n\r\n}\r\n\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./BankAccountPurchaseFunds.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./BankAccountPurchaseFunds.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./BankAccountPurchaseFunds.vue?vue&type=template&id=054e4e61&\"\nimport script from \"./BankAccountPurchaseFunds.vue?vue&type=script&lang=ts&\"\nexport * from \"./BankAccountPurchaseFunds.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\n\n/* vuetify-loader */\nimport installComponents from \"!../../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VAlert } from 'vuetify/lib/components/VAlert';\nimport { VBtn } from 'vuetify/lib/components/VBtn';\nimport { VCard } from 'vuetify/lib/components/VCard';\nimport { VCardText } from 'vuetify/lib/components/VCard';\nimport { VCardTitle } from 'vuetify/lib/components/VCard';\nimport { VCol } from 'vuetify/lib/components/VGrid';\nimport { VContainer } from 'vuetify/lib/components/VGrid';\nimport { VForm } from 'vuetify/lib/components/VForm';\nimport { VIcon } from 'vuetify/lib/components/VIcon';\nimport { VList } from 'vuetify/lib/components/VList';\nimport { VListItem } from 'vuetify/lib/components/VList';\nimport { VListItemContent } from 'vuetify/lib/components/VList';\nimport { VListItemSubtitle } from 'vuetify/lib/components/VList';\nimport { VListItemTitle } from 'vuetify/lib/components/VList';\nimport { VProgressCircular } from 'vuetify/lib/components/VProgressCircular';\nimport { VRow } from 'vuetify/lib/components/VGrid';\ninstallComponents(component, {VAlert,VBtn,VCard,VCardText,VCardTitle,VCol,VContainer,VForm,VIcon,VList,VListItem,VListItemContent,VListItemSubtitle,VListItemTitle,VProgressCircular,VRow})\n","\r\nexport default class ProductResponseModel {\r\n public id: number = 0;\r\n public name: string = '';\r\n public description: string = '';\r\n public price: number = 0;\r\n}\r\n","import CashTamerHttpClient from './CashTamerHttpClient';\r\nimport CashTamerApiBase from './CashTamerApiBase';\r\nimport ProductResponseModel from '@/models/products/ProductResponseModel';\r\n\r\nexport default class ProductsApi extends CashTamerApiBase {\r\n public async getProductAsync(productId: number): Promise {\r\n\r\n try {\r\n const httpClient = new CashTamerHttpClient();\r\n\r\n const url: string = 'products/' + productId;\r\n\r\n const httpResponse = await httpClient.getAsync(url);\r\n\r\n const product = new ProductResponseModel();\r\n product.id = httpResponse.data.id;\r\n product.name = httpResponse.data.name;\r\n product.description = httpResponse.data.description;\r\n product.price = httpResponse.data.price;\r\n\r\n return product;\r\n }\r\n catch (err) {\r\n return this.handleApiError(err);\r\n }\r\n }\r\n}\r\n"],"sourceRoot":""}