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 ) {