#alex_api

1 messages ยท Page 1 of 1 (latest)

mental fractalBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1308811088829091930

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

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.

vernal burrow
#

Hi ๐Ÿ‘‹ yeah. I'm not readily thinking of a case where you can't update a Subscription to add a trial period to it.

#

Are you seeing errors when you try to test that?

white prism
#

Not entirely. What I'm trying to do is have some way of having the customers trial period remain intact when switching between subscription plans. I can see from the events when I just updated my plan through the customer portal that there is a payment intent creation that happens before the customer is charged. I'm wondering if I could somehow listen for that event and set the trial days before they are charged so that they aren't actually charged (until the trial ends). The event looks like this:

#

{
"object": {
"id":
"pi_3QNFNVGQKZJikh7N08Yg3Xwa"
,
"object":
"payment_intent",
"amount":
24900,
"amount_capturable":
0,
"amount_details": {
"tip": {},
},
"amount_received":
0,
"application":
null,
"application_fee_amount":
null,
"automatic_payment_methods":
null,
"canceled_at":
null,
"cancellation_reason":
null,
"capture_method":
"automatic",
"client_secret":
"---",
"confirmation_method":
"automatic",
"created":
1732114777
,
"currency":
"cad",
"customer":
"cus_Pg818DurBUzUKD"
,
"description":
"Subscription update",
"invoice":
"in_1QNFNUGQKZJikh7NFxeZu70J"
,
"last_payment_error":
null,
"latest_charge":
null,
"livemode":
false,
"metadata": {},
"next_action":
null,
"on_behalf_of":
null,
"payment_method":
null,
"payment_method_configuration_details":
null,
"payment_method_options": {
"acss_debit": {
"mandate_options": {
"interval_description":
null,
"payment_schedule":
null,
"transaction_type":
null,
},
"verification_method":
"automatic",
},
"card": {
"installments":
null,
"mandate_options":
null,
"network":
null,
"request_three_d_secure":
"automatic",
},
},
"payment_method_types": [
"acss_debit",
"card",
],
"processing":
null,
"receipt_email":
"alexingham3@gmail.com",
"review":
null,
"setup_future_usage":
"off_session",
"shipping":
null,
"source":
null,
"statement_descriptor":
null,
"statement_descriptor_suffix":
"TRIAL OVER",
"status":
"requires_payment_method",
"transfer_data":
null,
"transfer_group":
null,
},
"previous_attributes":
null,
}

#

I can see that it has the statement_descriptor of "TRIAL_OVER" and I'm wondering if, because of that, it's too late to detect how many remainning trial days the customer had prior to the update and then set the new updated subscription to have those same trial days

#

I know the customer portal doesn't natively support this functionality but I'm hoping to find some sort of workaround. We have a few customers who are updating their subscription to a different tier while on a free trial and they are surprised that they're getting billed. I understand it's a bit of a unique use-case, as we offer the same 14 day free trial across 3 different tiers of subscriptions which isn't very common

vernal burrow
white prism
#

Yeah I was hoping I could add the trial days before the payment intent gets charged. That makes sense though

#

Is there any other way you can think of to have this happen automatically? Or would the only solution be to manually perform the subscription updates when they want to migrate a trial to a different plan and use the API rather than starting a billing session flow

#

Also thanks for your help Toby!

vernal burrow
#

Unfortunately I'm not aware of a way around this limitation currently, aside from the one you mentioned of not using the Customer Portal for this flow. It's something I've pushed for before, and will use this thread to push for again.

white prism
#

Ok understood, thank you for your help!