#shubhamjha-subschedules

1 messages · Page 1 of 1 (latest)

mild vigilBOT
hollow osprey
#

Can you clarify? I'm not understanding the question

narrow ruin
#

i want to know that if i release any suubscrtion shedule id then ANY webhook event call?

hollow osprey
#

what do you meany by "ANY webhook event call"?

#

Are you asking whether a webhook event will be emitted if you manually release the Subscriptoin Schedule?

narrow ruin
#

yes

#

I HAVE used checkout.session.completed
customer.subscription.created
customer.subscription.updated
invoice.upcoming
subscription_schedule.canceled
subscription_schedule.created

#

event in my webhook

#

so any webhook event where called in this case

#

?

hollow osprey
#

You should be getting a subscription_schedule.released event for sub schedule releases

narrow ruin
#

ohk

hollow osprey
#

shubhamjha-subschedules

narrow ruin
#

Can I add the option of make crad default in create chekout PAGE IN STRIPE USING NODE JS

hollow osprey
#

What do you mean by "crad"?

narrow ruin
#

PAYMENT METHOD THEY USED DURING CHEKOUT

hollow osprey
#

Ah you mean card, not crad

narrow ruin
#

YES SORYY

hollow osprey
#

can you stop with the all caps?

narrow ruin
#

ONE more thing if a subscrition have upcoming event they dont need to make default payment method but if a shedule subscription where become subscription they dont pay without mking payment method default why?

hollow osprey
#

For Checkout there isn't a way to automatically have the PaymentMEthod be automatically set as the default - but for Subscription mode checkout sessions the payment method will be set as the default for that specific subscription (just not for all of the customer's payments)

narrow ruin
#

ok but what abut shudle subscription?

#

is their any option by which when creating shedule then we automatically set previous payment method?

hollow osprey
#

Are you just asking how to use an existing payment method with a Subscription Schedule and have it be used automatically in the future?

narrow ruin
#

yes

hollow osprey
narrow ruin
#

await stripe.subscriptionSchedules
.create({
customer: coustomerId,
start_date: moment.tz(expirydate, 'America/New_York').unix(),
end_behavior: 'release',
//end_behavior: 'cancel',
metadata: { payLink: payLink },
phases: [
{
items: items,
},
],
})
.then((response) => {
console.log('done.................')
return response
})
.catch((error) => {
console.log(error)
throw error
})

#

this is my code

hollow osprey
#

Yeah so you need to use the parameter I just sent you to set the PaymentMEthod

narrow ruin
#

whree should i write?

#

please

hollow osprey
#

You'd pass it in as a parameter - just like all the other parameters you've been setting

narrow ruin
#

under the pashase/

hollow osprey
#

No, not under the phases

narrow ruin
#

await stripe.subscriptionSchedules
.create({
customer: coustomerId,
start_date: moment.tz(expirydate, 'America/New_York').unix(),
end_behavior: 'release',
metadata: { payLink: payLink },
default_settings: {
default_payment_method: paymentMethodId
},
phases: [
{
items: items,
},
],
})
.then((response) => {
console.log('done.................')
return response
})
.catch((error) => {

#

look ?

hollow osprey
#

Yup, that looks right to me - but the best thing to do is just test out your code to see if it works.

narrow ruin
#

default_settings: {
default_payment_method: paymentMethodId
},

#

ok ?

hollow osprey
#

Yes, but as I said - just test it out and see if it works

#

That's really the best way to make sure things are correct

narrow ruin
#

ok

#

look

hollow osprey
#

If you're not even seeing default_settings.default_payment_method in the request body that means you're not actually running the code you think you are - are you running an old version?

narrow ruin
#

no

hollow osprey
#

Are you 100% certain you're running the code with the changes you made? Try changing something else (like add additional metadata) and see if that also gets reflected in the request

narrow ruin
#

errorMsg: 'paymentMethodId is not defined',
stack: 'ReferenceError: paymentMethodId is not defined\n' +
' at creteSheduleSubscription (C:\Users\User\Downloads\LIVE_MODE_STRIPE\STRIPE ISSUE TEST\rest-api\routes\auth-enable-routes\stripe-details.js:91:33)\n' +
' at ganerateSubId (C:\Users\User\Downloads\LIVE_MODE_STRIPE\STRIPE ISSUE TEST\rest-api\routes\auth-enable-routes\stripe-details.js:19:29)\n' +
' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
' at async executer (C:\Users\User\Downloads\LIVE_MODE_STRIPE\STRIPE ISSUE TEST\shared\route-builder\helper\route-executer.js:15:24)'
}
}

#

this error

#

code is this

#

await stripe.subscriptionSchedules
.create({
customer: coustomerId,
start_date: moment.tz(expirydate, 'America/New_York').unix(),
end_behavior: 'release',
default_settings: {
default_payment_method: paymentMethodId,
},
metadata: { payLink: payLink },
phases: [
{
items: items,
},
],
})

hollow osprey
#

Did you define a paymentMethodId variable and set it to the payment Method ID?

narrow ruin
#

not whre i get that id?

hollow osprey
#

It depends on how youre integration works - typically the PaymentMEthod would be created client-side or you'd retrieve a PaymentMethod from the list of ones already attached to the customer