{"version":3,"sources":["webpack:///./src/components/billing/FortisCardPayment.vue?d00e","webpack:///src/components/billing/FortisCardPayment.vue","webpack:///./src/components/billing/FortisCardPayment.vue?8173","webpack:///./src/components/billing/FortisCardPayment.vue"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","_v","_e","attrs","staticRenderFns","data","pubNubMsg","channel","msg","fortisPaymentResult","close","computed","mapGetters","methods","mapActions","elements","Commerce","getFortisPaymentViaUrl","clientToken","create","container","environment","theme","digitalWallets","fields","billing","name","required","on","console","log","result","api","patient","request","UpdateFortisTransactionApiId","facilityId","currentPatientAssociated","facilityID","posId","id","transactionId","completeResponse","fortisTransactionComplete","email","getFortisPaymentForm","taskId","patientId","patientID","value","$swal","text","reason","position","title","showConfirmButton","timerProgressBar","timer","icon","$pnPublish","message","Date","now","status","response","ex","component"],"mappings":"yHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,uBAAuB,CAACF,EAAG,MAAM,CAACE,YAAY,uBAAuB,CAAEN,EAAS,MAAEI,EAAG,KAAK,CAACE,YAAY,eAAe,CAACN,EAAIO,GAAG,oDAAoDP,EAAIQ,KAAKJ,EAAG,MAAM,CAACK,MAAM,CAAC,GAAK,kBACnUC,EAAkB,G,wBCgBP,GACfC,OACA,OACAC,UAAA,CACAC,QAAA,GACAC,IAAA,IAEAC,oBAAA,KACAC,OAAA,IAGAC,SAAA,IACAC,eAAA,CACA,2BACA,0BACA,qBACA,kBACA,uBACA,yBACA,4BAGAC,QAAA,IACAC,eAAA,mBAEA,gBAEA,IAAAC,EAAA,IAAAC,SAAAD,SACA,KAAAE,uBAAAC,aAEAH,EAAAI,OAAA,CACAC,UAAA,WACAC,YAAA,KAAAJ,uBAAAI,YACAC,MAAA,UACAC,eAAA,GACAC,OAAA,CACAC,QAAA,CACA,CAAAC,KAAA,UAAAC,UAAA,GACA,CAAAD,KAAA,cAAAC,UAAA,OAIAZ,EAAAa,GAAA,iBACAC,QAAAC,IAAA,gBACAD,QAAAC,IAAA,SAAAC,GAEA,IACA,KAAAzB,UAAAC,QAAA,KAAAU,uBAAAV,QAEA,KAAAE,oBAAAsB,QAGAC,OAAAC,QAAAC,QAAAC,6BAAA,CACAC,WAAA,KAAAC,yBAAAC,WACAC,MAAA,KAAAtB,uBAAAuB,GACAC,cAAAV,EAAA1B,KAAAmC,KAGA,IAAAE,QAAAV,OAAAC,QAAAC,QAAAS,0BACA,CACAP,WAAA,KAAAC,yBAAAC,WACAM,MAAA,KAAAC,qBAAAD,MACAL,MAAA,KAAAtB,uBAAAuB,GACAC,cAAA,KAAAhC,oBAAAJ,KAAAmC,GACAM,OAAA,KAAAD,qBAAAC,OACAC,UAAA,KAAAV,yBAAAW,YAIA,IAAAN,EAAArC,KAAA4C,MAUA,YATA,KAAAC,MAAA,CACAC,KAAAT,EAAArC,KAAA+C,OACAC,SAAA,aACAC,MAAA,yCACAC,mBAAA,EACAC,kBAAA,EACAC,MAAA,IACAC,KAAA,UAKA,KAAAR,MAAA,CACAC,KAAAT,EAAArC,KAAA+C,OACAC,SAAA,aACAC,MAAA,UACAC,mBAAA,EACAC,kBAAA,EACAC,MAAA,IACAC,KAAA,YAEA,KAAAC,WACA,CACApD,QAAA,KAAAU,uBAAAV,QAAA,QACAqD,QAAAC,KAAAC,OAEA,CAAAC,EAAAC,KACAnC,QAAAC,IACA,gBAAAb,uBAAAV,QAAA,SAEAsB,QAAAC,IAAAiC,EAAAC,KAGA,KAAAtD,OAAA,EACA,MAAAuD,SCzHuY,I,YCOnYC,EAAY,eACd,EACAzE,EACAW,GACA,EACA,KACA,KACA,MAIa,aAAA8D,E","file":"js/chunk-2d0a3cbb.dbe035e9.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"container mt-5 pt-5\"},[_c('div',{staticClass:\"col-lg-12 mb-5 mt-5\"},[(_vm.close)?_c('h4',{staticClass:\"text-center\"},[_vm._v(\" Payment complete. You may now close the page \")]):_vm._e(),_c('div',{attrs:{\"id\":\"payment\"}})])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n  <div class=\"container mt-5 pt-5\">\n    <div class=\"col-lg-12 mb-5 mt-5\">\n      <h4 class=\"text-center\" v-if=\"close\">\n        Payment complete. You may now close the page\n      </h4>\n      <div id=\"payment\">\n        <!-- Elements will create input elements here -->\n      </div>\n    </div>\n  </div>\n</template>\n<script>\nimport { mapGetters, mapActions } from 'vuex'\n// eslint-disable-next-line no-unused-vars\nimport api from '../../api/http-common.js'\n\nexport default {\n  data() {\n    return {\n      pubNubMsg: {\n        channel: '',\n        msg: []\n      },\n      fortisPaymentResult: null,\n      close: false\n    }\n  },\n  computed: {\n    ...mapGetters([\n      'currentPatientAssociated',\n      'getBillingTaskStatement',\n      'getProfileAuthInfo',\n      'getFacilityInfo',\n      'getFortisPaymentForm',\n      'getFortisStatementInfo',\n      'getFortisPaymentViaUrl'\n    ])\n  },\n  methods: {\n    ...mapActions(['setIsLoading'])\n  },\n  async mounted() {\n    // eslint-disable-next-line no-undef\n    var elements = new Commerce.elements(\n      this.getFortisPaymentViaUrl.clientToken\n    )\n    elements.create({\n      container: '#payment',\n      environment: this.getFortisPaymentViaUrl.environment,\n      theme: 'default',\n      digitalWallets: [],\n      fields: {\n        billing: [\n          { name: 'address', required: true },\n          { name: 'postal_code', required: true }\n        ]\n      }\n    })\n    elements.on('done', async result => {\n      console.log('payment>done')\n      console.log('resul>', result)\n\n      try {\n        this.pubNubMsg.channel = this.getFortisPaymentViaUrl.channel\n\n        this.fortisPaymentResult = result\n\n        // Update transaction api Id\n        await api.patient.request.UpdateFortisTransactionApiId({\n          facilityId: this.currentPatientAssociated.facilityID,\n          posId: this.getFortisPaymentViaUrl.id,\n          transactionId: result.data.id\n        })\n\n        var completeResponse = await api.patient.request.fortisTransactionComplete(\n          {\n            facilityId: this.currentPatientAssociated.facilityID,\n            email: this.getFortisPaymentForm.email,\n            posId: this.getFortisPaymentViaUrl.id,\n            transactionId: this.fortisPaymentResult.data.id,\n            taskId: this.getFortisPaymentForm.taskId,\n            patientId: this.currentPatientAssociated.patientID\n          }\n        )\n\n        if (!completeResponse.data.value) {\n          this.$swal({\n            text: completeResponse.data.reason,\n            position: 'top-center',\n            title: 'Payment Unsuccessful. Please try again',\n            showConfirmButton: false,\n            timerProgressBar: true,\n            timer: 2000,\n            icon: 'error'\n          })\n          return\n        }\n\n        this.$swal({\n          text: completeResponse.data.reason,\n          position: 'top-center',\n          title: 'Payment',\n          showConfirmButton: false,\n          timerProgressBar: true,\n          timer: 2000,\n          icon: 'success'\n        })\n        this.$pnPublish(\n          {\n            channel: this.getFortisPaymentViaUrl.channel + '-done',\n            message: Date.now()\n          },\n          (status, response) => {\n            console.log(\n              'publish>' + this.getFortisPaymentViaUrl.channel + '-done'\n            )\n            console.log(status, response)\n          }\n        )\n        this.close = true\n      } catch (ex) {\n      } finally {\n      }\n    })\n  }\n}\n</script>\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/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./FortisCardPayment.vue?vue&type=script&lang=js\"; 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/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./FortisCardPayment.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./FortisCardPayment.vue?vue&type=template&id=71aaaaa8\"\nimport script from \"./FortisCardPayment.vue?vue&type=script&lang=js\"\nexport * from \"./FortisCardPayment.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/@vue/cli-service/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"],"sourceRoot":""}