bp - show platform fee
MODIFY
src/authorization/AuthorizationsDefinition.ts
src/authorization/AuthorizationsDefinition.ts
@@ -514,7 +514,7 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
attributes: [
'id', 'status', 'createdOn', 'sessions', 'totalAmount', 'transferAmount', 'accountID', 'transferExternalID',
'account.businessOwnerID', 'account.accountExternalID', 'businessOwner.name', 'businessOwner.firstName',
- 'platformFeeData.feeAmount', 'platformFeeData.feeTaxAmount', 'currency'
+ 'platformFeeData.feeAmount', 'platformFeeData.feeTaxAmount', 'currency', 'invoice.documentNumber', 'invoice.totalAmount'
]
},
{ resource: Entity.TAX, action: [Action.LIST] },

MODIFY
src/integration/billing/stripe/StripeBillingIntegration.ts
src/integration/billing/stripe/StripeBillingIntegration.ts
@@ -1855,7 +1855,7 @@ export default class StripeBillingIntegration extends BillingIntegration {
public convertToBillingPlatformInvoice(stripeInvoice: Stripe.Invoice): BillingPlatformInvoice {
// eslint-disable-next-line id-blacklist, max-len
- const { id: invoiceID, customer, number: invoiceNumber, livemode: liveMode, amount_due: amountCents, status, currency: invoiceCurrency, metadata } = stripeInvoice;
+ const { id: invoiceID, customer, number: documentNumber, livemode: liveMode, amount_due: amountCents, status, currency: invoiceCurrency, metadata } = stripeInvoice;
const customerID = customer as string;
const currency = invoiceCurrency?.toUpperCase();
const epoch = stripeInvoice.status_transitions?.finalized_at || stripeInvoice.created;
@@ -1865,7 +1865,7 @@ export default class StripeBillingIntegration extends BillingIntegration {
const amount = amountCents ;
const totalAmount = Utils.createDecimal(amountCents).div(100).toNumber();
const invoice: BillingPlatformInvoice = {
- invoiceID, invoiceNumber, liveMode, userID,
+ invoiceID, documentNumber, liveMode, userID,
status: status as BillingInvoiceStatus,
amount, totalAmount, currency,
customerID, createdOn

MODIFY
src/storage/mongodb/BillingStorage.ts
src/storage/mongodb/BillingStorage.ts
@@ -375,7 +375,7 @@ export default class BillingStorage {
invoiceID: transfer.invoice.invoiceID,
liveMode: transfer.invoice.liveMode,
userID: transfer.invoice.userID,
- invoiceNumber: transfer.invoice.invoiceNumber,
+ documentNumber: transfer.invoice.documentNumber,
status: transfer.invoice.status,
amount: transfer.invoice.amount,
totalAmount: transfer.invoice.totalAmount,

MODIFY
src/types/Billing.ts
src/types/Billing.ts
@@ -229,7 +229,7 @@ export interface BillingPlatformInvoice {
invoiceID: string;
liveMode: boolean;
userID: string;
- invoiceNumber: string;
+ documentNumber: string;
status: BillingInvoiceStatus;
amount: number; // This one is in cents
totalAmount: number;

bp - show platform fee