billing - more details in logs
MODIFY
src/integration/billing/BillingIntegration.ts
src/integration/billing/BillingIntegration.ts
@@ -264,13 +264,13 @@ export default abstract class BillingIntegration {
}
}
- public checkStopTransaction(transaction: Transaction): void {
+ public checkBillTransaction(transaction: Transaction): void {
// Check User
if (!transaction.userID || !transaction.user) {
throw new BackendError({
message: 'User is not provided',
module: MODULE_NAME,
- method: 'checkStopTransaction',
+ method: 'checkBillTransaction',
action: ServerAction.BILLING_TRANSACTION
});
}
@@ -279,7 +279,7 @@ export default abstract class BillingIntegration {
throw new BackendError({
message: 'Charging Station is not provided',
module: MODULE_NAME,
- method: 'checkStopTransaction',
+ method: 'checkBillTransaction',
action: ServerAction.BILLING_TRANSACTION
});
}
@@ -288,7 +288,7 @@ export default abstract class BillingIntegration {
throw new BackendError({
message: 'User has no Billing Data',
module: MODULE_NAME,
- method: 'checkStopTransaction',
+ method: 'checkBillTransaction',
action: ServerAction.BILLING_TRANSACTION
});
}

MODIFY
src/integration/billing/stripe/StripeBillingIntegration.ts
src/integration/billing/stripe/StripeBillingIntegration.ts
@@ -755,7 +755,6 @@ export default class StripeBillingIntegration extends BillingIntegration {
}
public async startTransaction(transaction: Transaction): Promise<BillingDataTransactionStart> {
-
if (!this.settings.billing.isTransactionBillingActivated) {
return {
// Keeps track whether the billing was activated or not on start transaction
@@ -940,7 +939,7 @@ export default class StripeBillingIntegration extends BillingIntegration {
tenantID: this.tenant.id,
action: ServerAction.BILLING_TRANSACTION,
module: MODULE_NAME, method: 'endTransaction',
- message: 'Operation aborted - unexpected situation - the session has already been billed'
+ message: `Operation aborted - unexpected situation - the session has already been billed - transaction ID: ${transaction.id}`
});
return {
status: transaction.billingData?.stop?.status
@@ -957,7 +956,7 @@ export default class StripeBillingIntegration extends BillingIntegration {
tenantID: this.tenant.id,
action: ServerAction.BILLING_TRANSACTION,
module: MODULE_NAME, method: 'endTransaction',
- message: 'Unexpected situation - end transaction is being called while the extra inactivity is not yet known'
+ message: `Unexpected situation - end transaction is being called while the extra inactivity is not yet known - transaction ID: ${transaction.id}`
});
return {
// Preserve the previous state
@@ -1010,7 +1009,7 @@ export default class StripeBillingIntegration extends BillingIntegration {
// Check Stripe
await this.checkConnection();
// Check object
- this.checkStopTransaction(transaction);
+ this.checkBillTransaction(transaction);
try {
// Check that the customer STRIPE exists
const customerID: string = transaction.user?.billingData?.customerID;

billing - more details in logs