#_shubhamjha

1 messages · Page 1 of 1 (latest)

kindred galleonBOT
#

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.

barren tendon
#

hi there!

#

how are you accepting payments? Checkout Session, Payment Element, something else?

fierce gorge
#

chekout payment link generatd by api

fierce gorge
#

can i share you some code which i have usses now

barren tendon
#

sure

fierce gorge
#

if (typeC == '₹') {
params['line_items'] = [
{
price: payLink,
tax_rates: [tax],
quantity: 1,
},
]
} else {
params['line_items'] = [
{
price: payLink,
quantity: 1,
},
]
}
params['mode'] = 'payment'
params['metadata'] = { updatelink: s, update: 'yes', subid: id, n: noupadte }
} else {
if (typeC == '₹') {
console.log('chekout page....opening')
params['line_items'] = [
{
price: payLink,
tax_rates: [tax],
quantity: 1,
},
]
} else {
params['line_items'] = [
{
price: payLink,
quantity: 1,
},
]
}
params['mode'] = 'subscription'
}

return await stripe.checkout.sessions
.create(params)
.then((response) => {
session = response.url
return session
})
.catch((error) => {
console.log(error)

  throw error
})

}

#

i have alredy make a price id in stripe and pass that id to the param to create he payment link

barren tendon
#

sure, so what's your question?

fierce gorge
#

so my question is that how can i give some specific cutomer 3 moths of free basic subscription without taking any mony

fierce gorge
#

but where can i give the trial priod i ant get it

#

const paymentLink = await stripe.paymentLinks.create({
line_items: [
{
price: 'price_1MoC3TLkdIwHu7ixcIbKelAC',
quantity: 1,
},
],
}); here how cani pass trail priod

barren tendon
#

did you check the link I shared?

kindred galleonBOT
fierce gorge
#

yes i have share it from that ink

oak mauve
#

Hey! Taking over for my colleague. You want to add trial period to that PaymentLink ?

fierce gorge
#

is this correct way ? const stripe = require('stripe')('sk_test_tR3PYbcVNZZ796tH88S4VQ2u');

const paymentLink = await stripe.paymentLinks.create({
line_items: [
{
price: 'price_1MoC3TLkdIwHu7ixcIbKelAC',
quantity: 1,
},
],
subscription_data: {
trial_period_days: 90, // 3 months (90 days) free trial
},
});

console.log(paymentLink.url);

oak mauve
fierce gorge
#

please see in code and tell me is it write way?

oak mauve
#

yes it seems good

#

Are you facing a particular issue ?

fierce gorge
#

no i have not tried it i am working on it i will apply it in code , if any issue i willl be back