#tymm
1 messages ยท Page 1 of 1 (latest)
You mean you want to manually query the event data through Stripe API?
what im saying is that im experiencing different behavior using the same code when creating a subscription that has a $0 and a non $0 item.
with a non $0 item i would need to retrieve the paymentintent from the Invoice and confirm it manually to complete the transaction and then get a payment_succeeded callback from stripe
however with a $0 item it seems like the process is completed automatically
i want to be able to maybe finalize the invoice manually after creating the subscription? so i can control when to receive the payment_succeeded callback
or is there any flag that i should put to allow this
Sure, you can listen to invoice.created event, and finalize the invoice manually upon receiving this event.
except the invoice is completed automatically right after creating the subscription
Maybe can you tell me when you don't want the invoice.payment_succeeded to happen upon a successful subscription creation?
im creating a subscription with an item that costs $0, cancels automatically at the end of period, to simulate a free trial. and we dont ask for payment methods before the trial begins.
correct me if im wrong but it seems like whenever a subscription's total amount is $0 it finalizes and completes the payment automatically?
You don't need to use $0 invoice to simulate a free trial. There's a trial_end param https://stripe.com/docs/api/subscriptions/object#subscription_object-trial_end
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
If you are using Checkout Session, you can set the trial_end through the subscription_data (https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data-trial_end)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
just tried it out, doesnt change that stripe still sends invoice.payment_succeeded callback
immediately after creating the subscription
was using that callback to insert into my db for things like payment date, payment method etc, but i guess for the trial subscriptions those doesnt matter and i can populate them before hand.... unless u have any other suggestions ๐
else we can close this tread