Refactor stripe subscription retrieval process
The process of retrieving stripe subscriptions has been updated in the 'stripe-webhook-handler.service.ts' file. Instead of expanding to 'line_items', the process now retrieves just the subscription and proceeds to build the payload. The refactor aims to improve the performance and simplicity of the subscription retrieval process.
This commit is contained in:
@@ -303,10 +303,10 @@ export class StripeWebhookHandlerService
|
||||
const invoice = event.data.object;
|
||||
const subscriptionId = invoice.subscription as string;
|
||||
|
||||
const subscription = await stripe.subscriptions.retrieve(subscriptionId, {
|
||||
expand: ['line_items'],
|
||||
});
|
||||
// Retrieve the subscription
|
||||
const subscription = await stripe.subscriptions.retrieve(subscriptionId);
|
||||
|
||||
// Here we need to retrieve the subscription and build the payload
|
||||
const accountId = subscription.metadata.accountId as string;
|
||||
|
||||
const subscriptionPayloadBuilderService =
|
||||
|
||||
Reference in New Issue
Block a user