var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var Bizgaze; (function (Bizgaze) { let Apps; (function (Apps) { let Transact; (function (Transact) { let Managers; (function (Managers) { var _PaymentManager_region, _PaymentManager_endregion; class PaymentManager extends Unibase.Platform.Core.BaseManager { constructor() { super(...arguments); _PaymentManager_region.set(this, void 0); _PaymentManager_endregion.set(this, void 0); } getpayment(Id) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/payments/getpayment/paymentid/' + Id; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } deletePayment(paymentId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/payments/deletepayment/paymentid/' + paymentId; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getPaymentModeSeriesSetting(paymenttypeid, paymentmodeid) { return __awaiter(this, void 0, void 0, function* () { var url = _appsettings.server_url() + '/apis/v4/bizgaze/transact/payments/getseriessetting/paymentmodeid/' + paymentmodeid + '/paymenttypeid/' + paymenttypeid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null && response.result != "") response.result = JSON.parse(response.result); return response; }); }); } getPendings(contactid, paymentid, query, journaltypeid, lobid, paymentdate, controltype) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/payments/getpendings/contactid/' + contactid + '/paymentid/' + paymentid + '/query/' + query + '/journaltypeid/' + journaltypeid + '/lobid/' + lobid + '/paymentdate/' + paymentdate + '/controltype/' + controltype; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getAdvancePaymentsByOrgId(ContactId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/payments/getadvancepaymentsbyorgid/contactid/' + ContactId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != "" && response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getAllPendingPayments(ContactId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/payments/getallpendingpayments/contactid/' + ContactId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != "" && response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getLastFivePaymentsByContactId(ContactId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/payments/getlastfivepaymentsbycontactid/contactid/' + ContactId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != "" && response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getReturnedChequesBySpocId(SpocId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/payments/getreturnedchequesbyspocid/spocid/' + SpocId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != "" && response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } refreshPaymentModes() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/payments/refreshpaymentmodes/np'; return yield this.dataHelper().postAsync(url, "{}").then(function (response) { return response.message; }); }); } paymentPrint(paymentId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/payments/getpaymenthtml/paymentid/' + paymentId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getAccountSettingByPaymentType(paymentTypeId, settingTypeId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/payments/getaccountsettingbypaymenttype/paymenttypeid/' + paymentTypeId + '/settingtypeid/' + settingTypeId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null && response.result !== "") response.result = JSON.parse(response.result); return response; }); }); } getAccountSettingsByPaymentType(paymentTypeId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/payments/getaccountsettingbypaymenttype/paymenttypeid/' + paymentTypeId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null && response.result !== "") response.result = JSON.parse(response.result); return response; }); }); } changestatus(obj) { return __awaiter(this, void 0, void 0, function* () { debugger; const url = 'apis/v4/bizgaze/transact/payments/paymentstagechangebystatus/List'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } reverseentryforreceiptreject() { return __awaiter(this, void 0, void 0, function* () { debugger; const url = 'apis/v4/bizgaze/transact/payments/reverseentryforreceiptreject/np'; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } reconcileEntry(paymentId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/payments/reconcileentry/paymentid/' + paymentId; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getPaymentByRemoteId(remoteId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/payments/getpaymentbyremoteid/remoteid/' + remoteId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null && response.result !== "") response.result = JSON.parse(response.result); return response; }); }); } static Instance() { if (this.instance === undefined) { this.instance = new PaymentManager(); } return this.instance; } } _PaymentManager_region = new WeakMap(), _PaymentManager_endregion = new WeakMap(); Managers.PaymentManager = PaymentManager; })(Managers = Transact.Managers || (Transact.Managers = {})); })(Transact = Apps.Transact || (Apps.Transact = {})); })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {})); })(Bizgaze || (Bizgaze = {}));