#cat.noir

1 messages · Page 1 of 1 (latest)

sudden geyserBOT
#

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.

unique brook
#

Hi there!

#
  1. Yes, it will list all Invoices
#
  1. 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.
gusty wing
#

payment_intent seems to be a string 🤔

unique brook
gusty wing
#

ah, if i do that, its still typed as a string. do i need to "cast" it? (typescript)

fading mulch
#

Yes you'd do:

const paymentIntent = invoice.payment_intent as Stripe.PaymentIntent
gusty wing
#

i see, for some reason, invoices is an empty array. does it work in test mode?

fading mulch
#

It should do yes. I guess there's no results for the parameters you passed

gusty wing
#

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

fading mulch
#

Then it should be returned

fading mulch
# gusty wing i see, for some reason, invoices is an empty array. does it work in test mode?

Can you share the ID (req_xxx) of the failing API request? https://support.stripe.com/questions/finding-the-id-for-an-api-request

gusty wing
#

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

fading mulch
#

cus_P0gpfhV4xk1FWm has no invoices?

gusty wing
#

oh wait, i thought each payments HAS to have an invoice automatically?

#

maybe i need a list of this instead ?

fading mulch
#

Not one-time payments via CHeckout, no

gusty wing
#

i seee

#

but the problem now is, can i get priceId from payment intent?

fading mulch
#

Nope. Let's take a step back – what is it you're trying to do?

gusty wing
#

view payment history in my frontend from my backend api

fading mulch
gusty wing
#

but i dont think that will show automatic monthly payments

#

for the monthly plan i have setup

fading mulch
#

Yeah I mean on the cus_xxx I see no recurring payments (subscriptions) so not sure what you're referencing

gusty wing
#

oh because this is test mode

#

outside of test mode, my plans are properly setup

fading mulch
#

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

gusty wing
#

i wish there was an easy way to copy paste each product to test mode

#

because its so time consuming :(

fading mulch
#

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

fading mulch
gusty wing
#

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

fading mulch
#

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

gusty wing
#

i can include one of my monthly plans for now in test mode

fading mulch
gusty wing
#

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

fading mulch
#

Yeah that's an option, but more overhead for you

gusty wing
#

wait, invoice creation is as simple as one line?

#

i mean...

invoice_creation: {
    enabled: true,
  },

this??

#

that seems easy enough

fading mulch
#

Yes, but there's additional fees

gusty wing
#

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

fading mulch
#

Ok, let me know if you've any questions!

gusty wing
#

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?

fading mulch
#

On which object? Invoice?

gusty wing
#

Session

#

Stripe.Checkout.Session

#

and on invoice, aswell, seems like its just total

fading mulch
#

It'll just be an integer

gusty wing
#

but how will i know which currency uh symbol i should display for the client?

fading mulch