#ahjaydog - one time vs recurring
1 messages · Page 1 of 1 (latest)
Good question. Can you tell me a bit more about which of our products you are using here? Are the users making these payments through Checkout or are you directly creating subscriptions/invoices/payment intents via the API and having them pay those in the browser?
i have a donation product id and a course product id
course product id is only recurring but i might make it 1 time in the future
donation is both recurring and 1 time
checkout for both
In that case, an easy way to check this might be retrieving the Checkout Session's payment_intent by its ID and checking if the invoice property on the payment intent is populated https://stripe.com/docs/api/payment_intents/object#payment_intent_object-invoice
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok because i noticed one time paymeents do not have invoices
ok that makes sense thanks
Which invoice though, there are 2?
one that you said and another one under charges for the payment intent
This field on the PaymentIntent object itself https://stripe.com/docs/api/payment_intents/object#payment_intent_object-invoice
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok
To clarify a bit, the charge will have a receipt ID which is something slightly different.
yes i see that but above the receipt id in the charge object for payment intent i see another invoice. Is that the same as the one you are talking about?
No, receipts are for showing a record of payment, Invoices are a separate object for taking payments
You are interested in the Invoices here. Subscriptions charge by creating Invoices, so you will see an invoice on the recurring payment but not on the one time ones
Wait. I just remembered that you can directly check whether the price is one time or recurring. Sorry about that. Let me find that field again.
Is null the same thing as None ?
stripe_checkout_session_one_time_payments.payment_intent.invoice I got None
stripe_checkout_session_one_time_payments = stripe.checkout.Session.retrieve(checkout_session_id,expand=['payment_intent'])
i will be back in 30 mins but looking forward to your response
Is this in Python? In that case yes, None is what you will use for null here