#dv3ax
1 messages · Page 1 of 1 (latest)
So you're using mode: 'subscription' to create a Subscription for recurring payments, but want an additional, one-time payment on the initial invoice too?
I'm looking for a way to have an initial price for a subscription that differs from the recurring payment amount
Hmm, there's no real way to do that directly. What I'd recommend is using a 'mixed cart', where you can use an additional one-time payment for the initial reduced price and then start a trial to simulate the first period being free: https://stripe.com/docs/payments/checkout/how-checkout-works#mixed
Thank you for the answer, yes I am currently using mixed chart with trial_end, but is there any way for me to show the exact date of when the first recurring payment happens?
So:
- $100 p/m recurring, with a 30 day free trial
- A one-time payment of $50 for the 'reduced' amount
Then it'll automatically start charging users $100 p/m at the end of the free trial
What do you mean by 'exact date'? trial_end accepts a epoch, so you can pass the exact time to the second
I have managed to do that as shown in the 2nd screenshot I provided earlier, but I want the payer to see something like in the 1st screenshot (with the right initial fee)
Can you describe the exact amounts you want to charge? It's not clear to me what isn't working
Also, share the code you're using the create the session
Okay, say that the initial fee is $10 and $25/y. This image shows the desired fee but without the date info, e.g. "Then SGD 25.00 every 12 months starting on 23 May 2024".
here's the code:
$cart = [];
$cart[] = [
'price_data' => [
'recurring' => [
'interval' => 'month',
'interval_count' => 12,
],
'product_data' => [
'name' => 'testing recurring',
'metadata' => [
'pro_id' => '123',
],
],
'unit_amount' => 2500,
'currency' => 'SGD',
],
'quantity' => 1,
];
$cart[] = [
'price_data' => [
'product_data' => [
'name' => 'testing',
'metadata' => [
'pro_id' => '123',
],
],
'unit_amount' => 1000,
'currency' => 'SGD',
],
'quantity' => 1,
];
$checkout_session = $this->api()->checkout->sessions->create([
'line_items' => $cart,
'mode' => 'subscription',
'success_url' => route('stripe.order.confirm').'?session_id={CHECKOUT_SESSION_ID}',
'cancel_url' => route('stripe.order.cancel'),
'subscription_data' => [
'trial_end' => strtotime('+1 year', time()),
],
]);
Yeah that's just not configurable
Alright, thank you for clarifying!
i also faced something similar, i need to charge a trial discounted amount before charging the regular price
do you mean the renewal fees are collected once we reach the trial_end date?
ok