Duki
Duki
BABetter Auth
Created by Glen Kurio on 4/20/2025 in #bug-reports
Stripe plugin create a new customer on subscription.upgrade click.
I experience the same behavior. Have you found out why this is happening yet?
5 replies
BABetter Auth
Created by Clément on 4/19/2025 in #bug-reports
Period fields not populated after stripe subscription
For anyone reading this, stripe api v18.0.0 is used in BA version v1.2.8-beta.2! 🥳
18 replies
BABetter Auth
Created by Clément on 4/19/2025 in #bug-reports
Period fields not populated after stripe subscription
Perfect, thanks a lot for checking in!
18 replies
BABetter Auth
Created by Clément on 4/19/2025 in #bug-reports
Period fields not populated after stripe subscription
That explains a lot
18 replies
BABetter Auth
Created by Clément on 4/19/2025 in #bug-reports
Period fields not populated after stripe subscription
Ooh i see it now. They have breaking changes in v18 🙈
18 replies
BABetter Auth
Created by Clément on 4/19/2025 in #bug-reports
Period fields not populated after stripe subscription
18.0.0
18 replies
BABetter Auth
Created by Clément on 4/19/2025 in #bug-reports
Period fields not populated after stripe subscription
@Ping Sorry for the ping, but its breaking the subscription flow a bit 🙈 Can you confirm whether this is a bug or if we r missing any configurations? If it's a bug I can create an issue in github when necessary
18 replies
BABetter Auth
Created by Clément on 4/19/2025 in #bug-reports
Period fields not populated after stripe subscription
Do we have to populate any metadata or something? 🤔
18 replies
BABetter Auth
Created by Clément on 4/19/2025 in #bug-reports
Period fields not populated after stripe subscription
(shortened some things, because the message would have been too long and I dont have discord nitro)
18 replies
BABetter Auth
Created by Clément on 4/19/2025 in #bug-reports
Period fields not populated after stripe subscription
And it logs this subscription object:
{
id: 'sub_1RGEcnPL1qjk3NmrqLLPgRDK',
object: 'subscription',
application: null,
application_fee_percent: null,
automatic_tax: { ... },
billing_cycle_anchor: 1745219919,
billing_cycle_anchor_config: null,
cancel_at: null,
cancel_at_period_end: false,
canceled_at: null,
cancellation_details: { ... },
collection_method: 'charge_automatically',
created: 1745219919,
currency: 'chf',
customer: 'cus_SALpY9cI1moQS7',
days_until_due: null,
default_payment_method: 'pm_1RGEclPL1qjk3NmrfKoROdnv',
default_source: null,
default_tax_rates: [],
description: null,
discounts: [],
ended_at: null,
invoice_settings: { ... },
items: { ... },
latest_invoice: 'in_1RGEcnPL1qjk3NmrfugfoyZJ',
livemode: false,
metadata: {},
next_pending_invoice_item_invoice: null,
on_behalf_of: null,
pause_collection: null,
payment_settings: {
payment_method_options: { ... },
payment_method_types: null,
save_default_payment_method: 'off'
},
pending_invoice_item_interval: null,
pending_setup_intent: null,
pending_update: null,
plan: {
id: 'price_1RFVZWPL1qjk3NmrTduzFHok',
object: 'plan',
active: true,
amount: 1500,
amount_decimal: '1500',
billing_scheme: 'per_unit',
created: 1745046738,
currency: 'chf',
interval: 'month',
interval_count: 1,
livemode: false,
metadata: {},
meter: null,
nickname: 'Basic Monthly',
product: 'prod_S9pDoekuN3KnzH',
tiers_mode: null,
transform_usage: null,
trial_period_days: null,
usage_type: 'licensed'
},
quantity: 1,
schedule: null,
start_date: 1745219919,
status: 'active',
test_clock: null,
transfer_data: null,
trial_end: null,
trial_settings: { end_behavior: { missing_payment_method: 'create_invoice' } },
trial_start: null
}
{
id: 'sub_1RGEcnPL1qjk3NmrqLLPgRDK',
object: 'subscription',
application: null,
application_fee_percent: null,
automatic_tax: { ... },
billing_cycle_anchor: 1745219919,
billing_cycle_anchor_config: null,
cancel_at: null,
cancel_at_period_end: false,
canceled_at: null,
cancellation_details: { ... },
collection_method: 'charge_automatically',
created: 1745219919,
currency: 'chf',
customer: 'cus_SALpY9cI1moQS7',
days_until_due: null,
default_payment_method: 'pm_1RGEclPL1qjk3NmrfKoROdnv',
default_source: null,
default_tax_rates: [],
description: null,
discounts: [],
ended_at: null,
invoice_settings: { ... },
items: { ... },
latest_invoice: 'in_1RGEcnPL1qjk3NmrfugfoyZJ',
livemode: false,
metadata: {},
next_pending_invoice_item_invoice: null,
on_behalf_of: null,
pause_collection: null,
payment_settings: {
payment_method_options: { ... },
payment_method_types: null,
save_default_payment_method: 'off'
},
pending_invoice_item_interval: null,
pending_setup_intent: null,
pending_update: null,
plan: {
id: 'price_1RFVZWPL1qjk3NmrTduzFHok',
object: 'plan',
active: true,
amount: 1500,
amount_decimal: '1500',
billing_scheme: 'per_unit',
created: 1745046738,
currency: 'chf',
interval: 'month',
interval_count: 1,
livemode: false,
metadata: {},
meter: null,
nickname: 'Basic Monthly',
product: 'prod_S9pDoekuN3KnzH',
tiers_mode: null,
transform_usage: null,
trial_period_days: null,
usage_type: 'licensed'
},
quantity: 1,
schedule: null,
start_date: 1745219919,
status: 'active',
test_clock: null,
transfer_data: null,
trial_end: null,
trial_settings: { end_behavior: { missing_payment_method: 'create_invoice' } },
trial_start: null
}
18 replies
BABetter Auth
Created by Clément on 4/19/2025 in #bug-reports
Period fields not populated after stripe subscription
In my stripe plugin I added an event hook to check the subscription myself like this:
onEvent: async (event) => {
switch (event.type) {
case 'checkout.session.completed': {
const subscriptionId = event.data.object.subscription
const subscription = await stripeBackendClient.subscriptions.retrieve(subscriptionId as string);
console.log('subscription', subscription);
break;
}
}
},
onEvent: async (event) => {
switch (event.type) {
case 'checkout.session.completed': {
const subscriptionId = event.data.object.subscription
const subscription = await stripeBackendClient.subscriptions.retrieve(subscriptionId as string);
console.log('subscription', subscription);
break;
}
}
},
18 replies
BABetter Auth
Created by Clément on 4/19/2025 in #bug-reports
Period fields not populated after stripe subscription
Heya, I experience the same issue. But I see an update error on prisma, saying:
Invalid `prisma.subscription.update()` invocation:

{
where: {
id: "SiGKftVY9a591QLakFP0IUkWPDNaygQK"
},
data: {
plan: "basic",
stripeSubscriptionId: "sub_1RGEcnPL1qjk3NmrqLLPgRDK",
status: "active",
periodStart: new Date("Invalid Date"),
~~~~~~~~~~~~~~~~~~~~~~~~
periodEnd: new Date("Invalid Date"),
seats: 1
}
}
Invalid `prisma.subscription.update()` invocation:

{
where: {
id: "SiGKftVY9a591QLakFP0IUkWPDNaygQK"
},
data: {
plan: "basic",
stripeSubscriptionId: "sub_1RGEcnPL1qjk3NmrqLLPgRDK",
status: "active",
periodStart: new Date("Invalid Date"),
~~~~~~~~~~~~~~~~~~~~~~~~
periodEnd: new Date("Invalid Date"),
seats: 1
}
}
Do you also see an error from your ORM or something? I also checked BA's code where they populate these fields (in packages/stripe/src/hooks.ts line 44):
periodStart: new Date(subscription.current_period_start * 1000),
periodEnd: new Date(subscription.current_period_end * 1000),
periodStart: new Date(subscription.current_period_start * 1000),
periodEnd: new Date(subscription.current_period_end * 1000),
There they reference the fields current_period_end and current_period_start, but when I retrieve the subscription myself I cannot find these fields in the subscription object.
18 replies
BABetter Auth
Created by Duki on 4/20/2025 in #bug-reports
change email does not update the customer's email in stripe
5 replies
BABetter Auth
Created by Duki on 4/19/2025 in #help
Unknown argument `stripeCustomerId` when creating customer on signup
ok yea it was my fault. I got a warning from prisma to set an output path for the generated client Warning: You did not specify an output path for your generator in schema.prisma. This behavior is deprecated and will no longer be supported in Prisma 7.0.0., but then forgot to change the PrismaClient import statement from the old default path.
13 replies
BABetter Auth
Created by Duki on 4/19/2025 in #help
Unknown argument `stripeCustomerId` when creating customer on signup
Havent tried yet, but i think its on my end, because if i try to manually update the user, i dont even get the ahtocomplete from typescript for that field. Something must be wrong with my generator i think. Will take a look when I get to it and report back.
13 replies
BABetter Auth
Created by Duki on 4/19/2025 in #help
Unknown argument `stripeCustomerId` when creating customer on signup
Perhaps I am still not understanding prisma and how to properly migrate the schema changes to the prisma client 🙈
13 replies
BABetter Auth
Created by Duki on 4/19/2025 in #help
Unknown argument `stripeCustomerId` when creating customer on signup
I even reset the db and the problem still remains
13 replies
BABetter Auth
Created by Duki on 4/19/2025 in #help
Unknown argument `stripeCustomerId` when creating customer on signup
I already migrated the new schema as well 🤔
13 replies
BABetter Auth
Created by Duki on 4/19/2025 in #help
Unknown argument `stripeCustomerId` when creating customer on signup
Unknown argument `stripeCustomerId`. Available options are marked with ?.
at An (/Users/duki/IdeaProjects/simple-recipe-app/node_modules/@prisma/client/runtime/library.js:29:1363)
at zn.handleRequestError (/Users/duki/IdeaProjects/simple-recipe-app/node_modules/@prisma/client/runtime/library.js:121:7102)
at zn.handleAndLogRequestError (/Users/duki/IdeaProjects/simple-recipe-app/node_modules/@prisma/client/runtime/library.js:121:6784)
at zn.request (/Users/duki/IdeaProjects/simple-recipe-app/node_modules/@prisma/client/runtime/library.js:121:6491)
at async l (/Users/duki/IdeaProjects/simple-recipe-app/node_modules/@prisma/client/runtime/library.js:130:9778)
at async Object.update (file:///Users/duki/IdeaProjects/simple-recipe-app/node_modules/better-auth/dist/adapters/prisma-adapter/index.mjs:145:16)
at async Object.update (file:///Users/duki/IdeaProjects/simple-recipe-app/node_modules/better-auth/dist/shared/better-auth.rSYJCd3o.mjs:433:19)
at async after (file:///Users/duki/IdeaProjects/simple-recipe-app/node_modules/@better-auth/stripe/dist/index.mjs:1069:38)
at async createWithHooks (file:///Users/duki/IdeaProjects/simple-recipe-app/node_modules/better-auth/dist/shared/better-auth.Bk5IMdhM.mjs:56:9)
at async Object.createUser (file:///Users/duki/IdeaProjects/simple-recipe-app/node_modules/better-auth/dist/shared/better-auth.Bk5IMdhM.mjs:156:27) {
clientVersion: '6.6.0'
}
Unknown argument `stripeCustomerId`. Available options are marked with ?.
at An (/Users/duki/IdeaProjects/simple-recipe-app/node_modules/@prisma/client/runtime/library.js:29:1363)
at zn.handleRequestError (/Users/duki/IdeaProjects/simple-recipe-app/node_modules/@prisma/client/runtime/library.js:121:7102)
at zn.handleAndLogRequestError (/Users/duki/IdeaProjects/simple-recipe-app/node_modules/@prisma/client/runtime/library.js:121:6784)
at zn.request (/Users/duki/IdeaProjects/simple-recipe-app/node_modules/@prisma/client/runtime/library.js:121:6491)
at async l (/Users/duki/IdeaProjects/simple-recipe-app/node_modules/@prisma/client/runtime/library.js:130:9778)
at async Object.update (file:///Users/duki/IdeaProjects/simple-recipe-app/node_modules/better-auth/dist/adapters/prisma-adapter/index.mjs:145:16)
at async Object.update (file:///Users/duki/IdeaProjects/simple-recipe-app/node_modules/better-auth/dist/shared/better-auth.rSYJCd3o.mjs:433:19)
at async after (file:///Users/duki/IdeaProjects/simple-recipe-app/node_modules/@better-auth/stripe/dist/index.mjs:1069:38)
at async createWithHooks (file:///Users/duki/IdeaProjects/simple-recipe-app/node_modules/better-auth/dist/shared/better-auth.Bk5IMdhM.mjs:56:9)
at async Object.createUser (file:///Users/duki/IdeaProjects/simple-recipe-app/node_modules/better-auth/dist/shared/better-auth.Bk5IMdhM.mjs:156:27) {
clientVersion: '6.6.0'
}
13 replies
BABetter Auth
Created by Duki on 4/19/2025 in #help
Unknown argument `stripeCustomerId` when creating customer on signup
I'm using BA and BA stripe plugin v1.2.7 and prisma client v6.6.0
13 replies