#dineshkumar
1 messages ยท Page 1 of 1 (latest)
Hi Dingbot
๐ happy to help
sripes whether allow or not onetime payment with trial?
would you mind moving your other messages to this thread please?
sure
if you're creating a Checkout Session for creating subscriptions you need to pass Mode = "subscription"
my code:
var options = new SessionCreateOptions
{
PaymentMethodTypes = new List<string>
{
"card",
},
LineItems = lineItems,
Mode = "payment",
SubscriptionData = new SessionSubscriptionDataOptions
{
TrialPeriodDays = 7,
},
SuccessUrl =
$"{redirectURL}?status=successful-payment&session_id={{CHECKOUT_SESSION_ID}}",
CancelUrl =
$"{redirectURL}?status=cancel-payment&session_id={{CHECKOUT_SESSION_ID}}",
};
my requirement was below, we can do it in stripe
get 7 days for free (7-Day Trial Period) before their card gets charged the one-time fee
no that's not possible without creating a subscription
even if the subscription is for only one cycle
you need to first create the checkout session the way you're doing it but with Mode="subscription"
then you will listen to checkout.session.completed webhook event
and update the subscription and set https://stripe.com/docs/api/subscriptions/update#update_subscription-cancel_at_period_end to true
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
which means that the subscription won't get renewed
I find it hard to believe we can't do a trial period when someone wants to pay for the year up front.
you can do it in your system
and once the trial is done you can send them the checkout session
please give reference for above