#rich-checkout-chargeid
1 messages · Page 1 of 1 (latest)
Hey @prime kestrel ! What do you call a "transaction code" exactly?
It starts with ch
charge.succeeded
it is automatically created with a checkout session
{
"id": "ch_3NDUJBADMTB7TLMh0Jzy9AId",
"object": "charge",
"livemode": false,
"payment_intent": "pi_3NDUJBADMTB7TLMh0CMITWxK",
"status": "succeeded",
"amount": 199,
as an example
rich-checkout-chargeid
A Subscription (sub_123456) creates an Invoice each billing cycle, each Invoice (in_ABC) will have a PaymentIntent (pi_123) if a payment is needed and that PaymentIntent will have one or multiple Charges (ch_123). See https://dev.to/stripe/single-slider-payment-objects-overview-a0d to understand how all of this fits together
So when you have a Checkout Session you can get its Subscription, the latest_invoice and for that one it will have a charge property with the id you want
Ok I will check on that...
The other question with the two intervall would be very helpful if answered
Checkout can not support this at all today unfortunately
You'll want to rely on SubscriptionSchedules for this after the Checkout Session completes to plan future changes https://stripe.com/docs/billing/subscriptions/subscription-schedules but Checkout has no way to display the Price change in the UI
So I have to do it afterwards in this case. So do a checkout with 2.99 and how can I cancel or change the subscription?
I already saw this documentation. But it is not clear to me how to handle it in combination with the checkout
You use Checkout, it starts a Subscription and after it completes you can use the SubscriptionSchedule API to change that Subscription and plan the next phase(s) to match your intent
What means after it completes?
Have you used Checkout already? If so, after you pay on Checkout the Subscription gets created and the Session "completes". There's also the checkout.session.completed to indicate that
Yes I am using it already.
In the meanwhile i was able to retrieve the charge id
This works perfect
"There's also the checkout.session.completed to indicate that" - What to do then?
After Checkout completes you can write code that will modify the Subscription to use a SubscriptionSchedule to plan future phases
When should this be triggered? Can I trigger this immediatly?
You are the developer here. You control it all. Customer goes to Checkout, they pay, they come back to your app + you get an Event on your webhook endpoint => you write code that modifies the Susbcription