#cat.noir
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. 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.
Hi there!
- Yes, it will list all Invoices
- The Invoice contains a PaymentIntent, and the PaymentIntent contains a Charge. Looking at when the Charge was created tells you when the Invoice was paid.
payment_intent seems to be a string 🤔
It's the ID of a PaymentIntent object. So now you can retrieve that PaymentIntent, or better, use Expand: https://stripe.com/docs/expand
ah, if i do that, its still typed as a string. do i need to "cast" it? (typescript)
Yes you'd do:
const paymentIntent = invoice.payment_intent as Stripe.PaymentIntent
i see, for some reason, invoices is an empty array. does it work in test mode?
It should do yes. I guess there's no results for the parameters you passed
i just passed the customerid hm
that made the fake test payment
if i load the same customer url, i can see all the payments though
Then it should be returned
Can you share the ID (req_xxx) of the failing API request? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
hm i cant even see any invoice requests in the logs 🤔 what is going on
I can see the request id in when i log the invoice results in my code though, its req_qOLlvNmQYRZ7Gy
oh nevermind, i can see them now
req_jTwABlRmffWBZJ
cus_P0gpfhV4xk1FWm has no invoices?
oh wait, i thought each payments HAS to have an invoice automatically?
maybe i need a list of this instead ?
Not one-time payments via CHeckout, no
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Nope. Let's take a step back – what is it you're trying to do?
view payment history in my frontend from my backend api
Then I'd imagine you'd want this endpoint if you need line items and are using Checkout: https://stripe.com/docs/api/checkout/sessions/list
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
but i dont think that will show automatic monthly payments
for the monthly plan i have setup
Yeah I mean on the cus_xxx I see no recurring payments (subscriptions) so not sure what you're referencing
It probably makes sense for you to recreate the exact scenarios in test mode that your application needs to handle in live mode
Otherwise how are you supposed to know what you're building actually works as you need
i wish there was an easy way to copy paste each product to test mode
because its so time consuming :(
You're creating one-time sessions no so there's no recurring element and no invoices. In mode: 'subscription' sessions there's both, so you can use the invoice list endpoint
Dashboard supports the inverse way, which is normally how people work (i.e. model it, write the code, then copy to live once it's done)
ah, i see
the thing is right, im just enquiring of HOW this would be possible, to get a list of monthly/onetime payments list with priceid included
But yeah you really need to model it in test mode exactly how it'll work in live, otherwise you end up writing the wrong code and things won't work as you can't test them as you need
i can include one of my monthly plans for now in test mode
Well for recurring payments you'd use the Invoices yes. For one-time payments, unless you enable Invoices (https://stripe.com/docs/receipts?payment-ui=checkout#paid-invoices), then you'll want the Checkout Session
hm, i dont like the fact that i have to merge 2 requests into 1 to be able to get a list. maybe i need to create my own table in my database to store it myself
Yeah that's an option, but more overhead for you
wait, invoice creation is as simple as one line?
i mean...
invoice_creation: {
enabled: true,
},
this??
that seems easy enough
Yes, but there's additional fees
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
oh
I dont think i want to go that way because of the fees. I think my only other option is to store them in my database unfortunatly
Ok, let me know if you've any questions!
Thanks!
How do I know what amount_total returns? Does it always return in dollers? If not, how can i append a $, £ etc before it automatically?
On which object? Invoice?
It'll just be an integer
but how will i know which currency uh symbol i should display for the client?
You can pair that with currency field to format it: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-currency
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.