{"version":3,"sources":["./src/app/popovers/transaction-options/transaction-options.component.html","./src/app/popovers/transaction-options/transaction-options.component.ts","./src/app/pages/secure/transactions/transaction/transaction.page.html","./src/app/pages/secure/transactions/transaction/transaction-routing.module.ts","./src/app/pages/secure/transactions/transaction/transaction.page.ts","./src/app/pages/secure/transactions/transaction/transaction.module.ts"],"names":["TransactionOptionsComponent","navParams","popoverCtrl","modalController","alertController","transaction_page","this","data","transaction","type","presentTransactionRefund","dismiss","e","routes","path","component","TransactionPage","location","router","route","authService","apiService","loadingController","observerService","popoverController","spinner","moment","transaction_id","snapshot","params","presentSpinner","then","loadTransaction","catch","subscribe","Promise","resolve","reject","isLoggedIn","getConsumerTransaction","console","log","error","status","presentAlert","navigate","replaceUrl","window","reload","default_href","history","length","back","navigateByUrl","ev","popover","create","event","animated","showBackdrop","componentProps","present","modal","header","sub_header","message","alert","subHeader","buttons","cssClass","goBack","TransactionPageRoutingModule","forChild","TransactionPageModule"],"mappings":"0VAEQ,qBAAsM,4EAClM,oBACA,oBAAW,iBAAM,OACrB,O,MAFa,+BAAoC,kB,yBAFpD,qBACG,2BAIJ,Q,oBAJe,oLCOZ,Y,MAAMA,EAIT,YACYC,EACAC,EACDC,EACAC,GAHC,KAAAH,YACA,KAAAC,cACD,KAAAC,kBACA,KAAAC,kBANX,KAAAC,iBAAmB,KASnB,WACIC,KAAKD,iBAAmBC,KAAKL,UAAUM,KAAKF,iBAGhD,2BACiD,GAA1CC,KAAKD,iBAAiBG,YAAYC,MACjCH,KAAKD,iBAAiBK,2BAE1BJ,KAAKK,UAGH,U,kDACF,UACUL,KAAKJ,YAAYS,UACzB,MAAOC,Q,6CAzBJZ,GAA2B,0C,uBAA3BA,EAA2B,6SDTxC,wBACK,2BAML,Q,MANgB,0E,uKCQT,G,6ECFC,oBACI,QACJ,Q,oBADI,yD,sFAGA,uBAAsJ,8EAClJ,oBACJ,O,MADa,+BAA8B,kB,sBAWvC,QAA4C,iBAAM,Q,sBAClD,QAA4C,iB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sBACI,wBACI,uBAAY,+BAAS,EAAAsD,OAAO,0BACxB,oBACJ,OACJ,OACA,4BAGA,wBACI,6BAGJ,OACJ,OACJ,OAEA,sBACI,6BAgFA,4BAQJ,Q,MAvGyB,+BAAgC,iBAGrC,mCAIK,+IAQV,mCAgFA,0D,kkCEnFR,KDDA,Y,MAAMC,G,6CAAAA,I,uBAAAA,I,2BAHF,CAAC,IAAaC,SAAS3D,IACtB,O,GAEL,GEIA,S,MAAM4D,G,6CAAAA,I,uBAAAA,I,2BATF,CACP,IACA,IACA,IACA,IACA,M,GAIG","file":"73.2d45947cd0a770e40158.js","sourcesContent":["\n \n 0\" button=\"true\" (click)=\"presentTransactionRefund()\">\n \n Refund\n \n \n\n","import { Component, OnInit } from '@angular/core';\nimport { PopoverController, ModalController, AlertController, NavParams } from '@ionic/angular';\n\n@Component({\n selector: 'app-transaction-options',\n templateUrl: './transaction-options.component.html',\n styleUrls: ['./transaction-options.component.scss'],\n})\n\nexport class TransactionOptionsComponent implements OnInit {\n\n transaction_page = null;\n\n constructor(\n private navParams: NavParams,\n private popoverCtrl: PopoverController,\n public modalController: ModalController,\n public alertController: AlertController,\n ) { }\n\n ngOnInit() {\n this.transaction_page = this.navParams.data.transaction_page;\n }\n\n presentTransactionRefund() {\n if(this.transaction_page.transaction.type == 2) {\n this.transaction_page.presentTransactionRefund();\n }\n this.dismiss();\n }\n\n async dismiss() {\n try {\n await this.popoverCtrl.dismiss();\n } catch (e) {\n // click more than one time popover throws error, so ignore...\n }\n }\n\n}\n","\n \n \n \n \n \n \n \n Transaction #{{transaction.number}}\n \n \n 0\" (click)=\"presentTransactionOptions($event)\">\n \n \n \n \n\n\n\n \n \n \n Type\n Charge\n Refund\n \n \n Date\n {{this.moment(transaction.created_date).format(\"D MMM YYYY, HH:mm\")}}\n \n \n Price\n \n 0\">–${{transaction.price | number:'1.2'}}\n +${{transaction.price * -1 | number:'1.2'}} \n \n \n Fee\n \n 0\">–${{transaction.merchant_fee.price | number:'1.2'}}\n +${{transaction.merchant_fee.price * -1 | number:'1.2'}} \n \n \n Payout\n –${{transaction.merchant_payout.price * -1 | number:'1.2'}}\n 0\">+${{transaction.merchant_payout.price | number:'1.2'}} \n \n \n Payout number\n #{{transaction.merchant_payout.number}}\n \n \n Originating transaction\n #{{transaction.originating_transaction.number}}\n \n \n \n \n Note for us\n \n \n {{transaction.merchant_note}}\n \n \n \n \n Note to customer\n \n \n {{transaction.consumer_note}}\n \n \n \n \n Refunds\n \n \n \n \n \n \n

\n {{transaction.number}}\n

\n

\n {{this.moment(transaction.created_date).format(\"D MMM YYYY\")}}\n

\n

\n {{this.moment(transaction.created_date).format(\"HH:mm\")}}\n

\n
\n \n \n 0\">–${{transaction.price | number:'1.2'}}\n +${{transaction.price * -1 | number:'1.2'}}\n \n
\n
\n
\n \n \n

\n \n No transaction found\n

\n
\n
\n
\n","import { NgModule } from '@angular/core';\nimport { RouterModule, Routes } from '@angular/router';\nimport { TransactionPage } from './transaction.page';\n\nconst routes: Routes = [\n {\n path: '',\n component: TransactionPage,\n }\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule]\n})\nexport class TransactionPageRoutingModule {}\n","import { Component } from '@angular/core';\nimport { Location } from '@angular/common';\nimport { LoadingController, AlertController, PopoverController, ModalController} from '@ionic/angular';\nimport { Router, ActivatedRoute } from \"@angular/router\";\nimport { APIService } from \"../../../../services/api.service\";\nimport { AuthService } from \"../../../../services/auth.service\";\nimport { ObserverService } from \"../../../../services/observer.service\"\nimport * as moment from 'moment-timezone';\nimport { TransactionOptionsComponent } from '../../../../popovers/transaction-options/transaction-options.component';\nimport { TransactionRefundPage } from '../../../../modals/transaction-refund/transaction-refund.page';\n\n@Component({\n selector: 'app-transaction',\n templateUrl: 'transaction.page.html',\n styleUrls: ['transaction.page.scss']\n})\nexport class TransactionPage {\n\n spinner = null;\n moment = moment;\n transaction_id = null;\n transaction = null;\n\n constructor(\n private location: Location,\n private router: Router,\n private route: ActivatedRoute,\n private authService: AuthService,\n private apiService: APIService,\n public alertController: AlertController,\n public loadingController: LoadingController,\n private observerService: ObserverService,\n private popoverController: PopoverController,\n private modalController: ModalController,\n ) { }\n\n ngOnInit() {\n\n this.transaction_id = this.route.snapshot.params.transaction_id;\n\n this.presentSpinner(\"Loading transaction\").then(() => {\n this.loadTransaction().then(() => {\n this.spinner.dismiss();\n })\n .catch(() => {\n this.spinner.dismiss();\n })\n })\n\n this.observerService.subscribe('transaction_updated', () => {\n this.presentSpinner(\"Loading transaction\").then(() => {\n this.loadTransaction().then(() => {\n this.spinner.dismiss();\n })\n .catch(() => {\n this.spinner.dismiss();\n })\n })\n }); \n\n }\n\n loadTransaction() {\n const promise = new Promise((resolve, reject) => {\n this.authService.isLoggedIn().then(() => {\n this.apiService.getConsumerTransaction(this.transaction_id).then((transaction) => {\n if (transaction) {\n this.transaction = transaction;\n console.log(transaction)\n resolve();\n }\n })\n .catch((error) => {\n if (error) {\n if (error.status === 400) {\n this.presentAlert(\"Problem\", \"Unknown error\", \"Unfortunately something went wrong when trying to get the transaction.\");\n } else if (error.status === 403) {\n this.presentAlert(\"Problem\", \"Insufficient permissions\", \"You don't have permission to view a transaction.\");\n } else if (error.status === 404 || error.status === 0) {\n this.presentAlert(\"Problem\", \"Unavailable\", \"Unfortunately we're unable to retrieve the transaction at this time.\");\n }\n }\n reject();\n });\n })\n .catch(() => {\n this.router.navigate([\"logout\"], { replaceUrl: true }).then(() => {\n window.location.reload();\n });\n });\n });\n return promise;\n }\n\n goBack(default_href) {\n if (window.history.length > 1) {\n this.location.back();\n }\n else {\n this.router.navigateByUrl(default_href);\n }\n }\n\n async presentTransactionOptions(ev: any) {\n const popover = await this.popoverController.create({\n component: TransactionOptionsComponent,\n event: ev,\n animated: true,\n showBackdrop: true,\n componentProps: {\n transaction_page: this\n }\n });\n return await popover.present();\n }\n\n async presentTransactionRefund() {\n const modal = await this.modalController.create({\n component: TransactionRefundPage,\n componentProps: {\n transaction_id: this.transaction_id\n }\n });\n return await modal.present();\n }\n\n async presentAlert(header, sub_header, message) {\n const alert = await this.alertController.create({\n header: header,\n subHeader: sub_header,\n message: message,\n buttons: [\"OK\"],\n });\n await alert.present();\n }\n\n async presentSpinner(message) {\n this.spinner = await this.loadingController.create({\n message: message,\n showBackdrop: true,\n cssClass: 'loading-spinner'\n });\n await this.spinner.present();\n }\n\n}\n","import { IonicModule } from '@ionic/angular';\nimport { RouterModule } from '@angular/router';\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\nimport { TransactionPage } from './transaction.page';\nimport { TransactionPageRoutingModule } from './transaction-routing.module';\n\n@NgModule({\n imports: [\n FontAwesomeModule,\n IonicModule,\n CommonModule,\n FormsModule,\n TransactionPageRoutingModule\n ],\n declarations: [TransactionPage]\n})\nexport class TransactionPageModule {}\n"],"sourceRoot":"webpack:///"}