mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Fetch all the subscriptions when backfilling user ids (#29005)
GitOrigin-RevId: 07c091176e50cad250e6bb4dea94fa3424643fd2
This commit is contained in:
@@ -80,6 +80,12 @@ async function processSubscription(
|
||||
|
||||
// Get customer details to check current metadata
|
||||
const customer = subscription.customer
|
||||
if (customer.deleted) {
|
||||
if (verbose) {
|
||||
console.info(`Customer ${customer.id} is deleted, skipping`)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if (customer.metadata?.userId === adminUserId) {
|
||||
if (verbose) {
|
||||
@@ -164,6 +170,7 @@ async function main(trackProgress) {
|
||||
const listParams = {
|
||||
limit: 100, // Stripe's maximum limit per request
|
||||
expand: ['data.customer'], // Expand customer data to reduce additional API calls
|
||||
status: 'all', // Include subscriptions in all statuses (active, past_due, unpaid, canceled, etc.)
|
||||
}
|
||||
|
||||
let hasMore = true
|
||||
|
||||
@@ -143,6 +143,7 @@ async function main(trackProgress) {
|
||||
|
||||
const listParams = {
|
||||
limit: 100, // Stripe's maximum limit per request
|
||||
status: 'all', // Include subscriptions in all statuses (active, past_due, unpaid, canceled, etc.)
|
||||
}
|
||||
|
||||
let hasMore = true
|
||||
|
||||
Reference in New Issue
Block a user