PmtService updated

This commit is contained in:
Rene V. Vergara A. 2022-08-20 09:03:30 -05:00
parent 24bbbbab72
commit 8a0ceedc90
1 changed files with 11 additions and 3 deletions

View File

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