bp - accountData
MODIFY
src/integration/billing/BillingIntegration.ts
src/integration/billing/BillingIntegration.ts
@@ -375,15 +375,15 @@ export default abstract class BillingIntegration {
protected async retrieveAccountData(transaction: Transaction) : Promise<BillingSessionAccountData> {
if (Utils.isTenantComponentActive(this.tenant, TenantComponents.BILLING_PLATFORM)) {
const site = await SiteStorage.getSite(this.tenant, transaction.siteID, { withCompany: true });
- let billingData = site.billingData;
- if (billingData?.accountID) {
- billingData = site.company?.billingData;
+ let accountData = site.accountData;
+ if (accountData?.accountID) {
+ accountData = site.company?.accountData;
}
- if (billingData?.accountID) {
+ if (accountData?.accountID) {
return {
withTransferActive: true,
- accountID: billingData.accountID,
- platformFeeStrategy: billingData.platformFeeStrategy
+ accountID: accountData.accountID,
+ platformFeeStrategy: accountData.platformFeeStrategy
};
}
}

MODIFY
test/api/BillingTest.ts
test/api/BillingTest.ts
/* eslint-disable max-len */
-import { BillingAccount, BillingAccountStatus, BillingChargeInvoiceAction, BillingInvoiceStatus, BillingTransfer } from '../../src/types/Billing';
+import { BillingAccount, BillingAccountStatus, BillingChargeInvoiceAction, BillingInvoiceStatus } from '../../src/types/Billing';
import { BillingSettings, BillingSettingsType } from '../../src/types/Setting';
-import { BillingTransferFactory, BillingTransferSessionFactory } from '../factories/BillingFactory';
import chai, { expect } from 'chai';
import { BillingPeriodicOperationTaskConfig } from '../../src/types/TaskConfig';
import BillingStorage from '../../src/storage/mongodb/BillingStorage';
import BillingTestHelper from './BillingTestHelper';
+import { BillingTransferFactory } from '../factories/BillingFactory';
import CentralServerService from './client/CentralServerService';
import CompanyFactory from '../factories/CompanyFactory';
import Constants from '../../src/utils/Constants';

bp - accountData