billing/pricing - effectivePricing term removed
MODIFY
src/integration/billing/stripe/StripeBillingIntegration.ts
src/integration/billing/stripe/StripeBillingIntegration.ts
@@ -1023,12 +1023,12 @@ export default class StripeBillingIntegration extends BillingIntegration {
private shrinkInvoiceItem(fatInvoiceItem: BillingInvoiceItem): BillingInvoiceItem {
// The initial invoice item includes redundant transaction data
- const { transactionID, currency, pricingData: effectivePricing } = fatInvoiceItem;
+ const { transactionID, currency, pricingData } = fatInvoiceItem;
// Let's return only essential information
const lightInvoiceItem: BillingInvoiceItem = {
transactionID,
currency,
- pricingData: effectivePricing
+ pricingData
};
return lightInvoiceItem;
}

MODIFY
src/types/Billing.ts
src/types/Billing.ts
@@ -92,16 +92,9 @@ export interface BillingInvoiceItem {
export interface BillingSessionData {
transactionID: number;
- // pricingData: BillingPricingData;
pricingData: BillingPricingData;
}
-// export interface BillingPricingData {
-// quantity: number;
-// amount: number;
-// currency: string;
-// }
-
export enum BillingInvoiceStatus {
PAID = 'paid',
OPEN = 'open',

MODIFY
test/api/BillingStripeTestData.ts
test/api/BillingStripeTestData.ts
@@ -277,7 +277,7 @@ export default class StripeIntegrationTestData {
// array of tax ids to apply to the line item
const taxes = (consumptionTestData.taxId) ? [ consumptionTestData.taxId ] : [];
// Princing/Consumption Data
- const effectivePricing: BillingPricingData = {
+ const billingPrincingData: BillingPricingData = {
energy: {
itemDescription: `Energy consumption - ${consumptionTestData.energyConsumptionkWh} kWh * ${consumptionTestData.energyAmount / consumptionTestData.energyConsumptionkWh} Eur`,
amount: consumptionTestData.energyAmount, // total amount to bill - not yet in cents
@@ -295,7 +295,7 @@ export default class StripeIntegrationTestData {
const invoiceItem:BillingInvoiceItem = {
currency: 'EUR',
transactionID: Utils.getRandomIntSafe(),
- pricingData: effectivePricing
+ pricingData: billingPrincingData
};
// Let's attempt to bill the line item
const billingInvoice: BillingInvoice = await this.billingImpl.billInvoiceItem(this.dynamicUser, invoiceItem);

billing/pricing - effectivePricing term removed