#rich-checkout-chargeid

1 messages · Page 1 of 1 (latest)

ripe badgeBOT
unique escarp
#

Hey @prime kestrel ! What do you call a "transaction code" exactly?

prime kestrel
#

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

unique escarp
#

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

prime kestrel
#

Ok I will check on that...

#

The other question with the two intervall would be very helpful if answered

unique escarp
#

Checkout can not support this at all today unfortunately

prime kestrel
#

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

unique escarp
#

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

prime kestrel
#

What means after it completes?

unique escarp
#

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

prime kestrel
#

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?

unique escarp
#

After Checkout completes you can write code that will modify the Subscription to use a SubscriptionSchedule to plan future phases

prime kestrel
#

When should this be triggered? Can I trigger this immediatly?

unique escarp
#

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