From 8a0ceedc90984fd6eea200faae36af00ff8b84c6 Mon Sep 17 00:00:00 2001 From: Rene Vergara A Date: Sat, 20 Aug 2022 09:03:30 -0500 Subject: [PATCH] PmtService updated --- src/app/pmtservice/pmtservice.component.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/app/pmtservice/pmtservice.component.ts b/src/app/pmtservice/pmtservice.component.ts index 9b16631..a4569f0 100644 --- a/src/app/pmtservice/pmtservice.component.ts +++ b/src/app/pmtservice/pmtservice.component.ts @@ -4,8 +4,9 @@ import { HttpClient, HttpParams, HttpHeaders } from "@angular/common/http"; import { PmtData } from "./pmtservice.model"; import { XeroInvoice } from "./xeroinvoice.model"; import { Owner } from '../owner.model'; -import { ConfigData } from '../configdata'; import { Item } from '../items/item.model' +import { Order } from '../order/order.model' +import { ConfigData } from '../configdata'; var Buffer = require('buffer/').Buffer; @@ -112,7 +113,15 @@ export class PmtserviceComponent implements OnInit { if (OwnerDataResponse.status == 200) { this.owner = OwnerDataResponse.body!.owner; console.log('Owner => ' + this.owner.name ); - if ( this.owner.payconf == false ) { +// +// ==> remove "== false" for production enviroment +// + if ( this.owner.payconf == false) { + // verifiy if an order for requested invoice + // already exist, If exists, delete it and create + // a new one if it has not been paid in ZGo + // otherwise report payment + // process data console.log("Owner check passed!!!"); this.getXeroInvoiceData( reqData ); @@ -127,7 +136,6 @@ export class PmtserviceComponent implements OnInit { this.reportType = 1; } }}); - } getXeroInvoiceData( reqData : PmtData ) {