billing - fix regression
MODIFY
src/integration/billing/stripe/StripeBillingIntegration.ts
src/integration/billing/stripe/StripeBillingIntegration.ts
@@ -1097,14 +1097,14 @@ export default class StripeBillingIntegration extends BillingIntegration {
detailedMessages: { error: operationResult.error.message, stack: operationResult.error.stack }
});
}
- }
- if (operationResult.invoice) {
+ if (operationResult?.invoice) {
// Reuse the operation result (for better performance)
stripeInvoice = operationResult.invoice;
} else {
// Get fresh data only when necessary - e.g.: invoice has been finalized, however the payment attempt failed
stripeInvoice = await this.getStripeInvoice(stripeInvoice.id);
}
+ }
// Let's replicate some information on our side
const billingInvoice = await this.synchronizeAsBillingInvoice(stripeInvoice, false);
// We have now a Billing Invoice - Let's update it with details about the last operation result

MODIFY
src/integration/billing/stripe/StripeHelpers.ts
src/integration/billing/stripe/StripeHelpers.ts
@@ -18,7 +18,7 @@ export default class StripeHelpers {
public static async updateInvoiceAdditionalData(tenantID: string,
billingInvoice: BillingInvoice,
- operationResult: BillingOperationResult,
+ operationResult: StripeChargeOperationResult,
billingInvoiceItem?: BillingInvoiceItem): Promise<void> {
// Do we have an error to preserve
let billingError: BillingError;

billing - fix regression