#adityalystlocdeveloper_33428

1 messages · Page 1 of 1 (latest)

agile nacelleBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

finite ocean
#

const currentSubscription = await stripe.subscriptions.update("sub_1OH5SuSI198cQJkBX8BpkLMZ", {
cancel_at_period_end: true,
});
// const remainingTime = currentSubscription.current_period_end - Math.floor(Date.now() / 1000);
console.log(new Date(currentSubscription.current_period_end).getTime());

const newSubscription = await stripe.subscriptions.create({
customer: "cus_P5FyyIkOtn7B1i",
items: [{ price: "price_1OGycKSI198cQJkB7C4HaLpK" }],
billing_cycle_anchor:currentSubscription.current_period_end,
currency: "inr",
});

tawdry rampart
finite ocean
#

can you nplease cheack above code

tawdry rampart
#

I did. If you want to stick to only using the Subscription create call directly, you can try using a free trial on the second subscription but that might be more difficult to work with than the subscription schedules that I mentioned.

finite ocean
#

can you show syntax for node js

tawdry rampart
#

For which one? The trial or the subscription schedule?

finite ocean
#

subscription schudle

#

all data is above

#

const currentSubscription = await stripe.subscriptions.update("sub_1OH5SuSI198cQJkBX8BpkLMZ", {
cancel_at_period_end: true,
});
// const remainingTime = currentSubscription.current_period_end - Math.floor(Date.now() / 1000);
console.log(new Date(currentSubscription.current_period_end).getTime());

const newSubscription = await stripe.subscriptions.create({
customer: "cus_P5FyyIkOtn7B1i",
items: [{ price: "price_1OGycKSI198cQJkB7C4HaLpK" }],
billing_cycle_anchor:currentSubscription.current_period_end,
currency: "inr",
});

tawdry rampart
finite ocean
#

how can we add currency for items

tawdry rampart
#

Or it would already be set on the price object if you are still using Prices like price_1OGycKSI198cQJkB7C4HaLpK instead of creating prices with price_data

finite ocean
#

i have plan which in us and ind so how can i pass currency as "inr

#

have to create two plans separtely?

#

i have my plan id

tawdry rampart
#

I am confused by your question

#

You can pass in INR to the paramters that I just linked to

#

Prices and Plans can be used across multiple subscriptions. So if you only have once INR amount that you want to charge, you only need to create one Price. If you have mutliple amounts you should create multiple Price objects or use the price_data parameter