#_shubhamjha
1 messages · Page 1 of 1 (latest)
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.
- _shubhamjha, 4 days ago, 28 messages
hi there!
how are you accepting payments? Checkout Session, Payment Element, something else?
chekout payment link generatd by api
can i share you some code which i have usses now
sure
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
sure, so what's your question?
so my question is that how can i give some specific cutomer 3 moths of free basic subscription without taking any mony
I already answered that question: https://stripe.com/docs/api/payment_links/payment_links/create#create_payment_link-subscription_data-trial_period_days
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
did you check the link I shared?
yes i have share it from that ink
Hey! Taking over for my colleague. You want to add trial period to that PaymentLink ?
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);
yes
This is correct, what is the issue you are still facing ?
please see in code and tell me is it write way?
no i have not tried it i am working on it i will apply it in code , if any issue i willl be back