#RubyDev-prices

1 messages · Page 1 of 1 (latest)

plain venture
#

I think so. Do you have more context?

signal mango
#

I'm fetching payment intent using customer_id

#

to get all payment intents of a particular customer

#

but also wants to get info about PI

#

what is the customer paid for

#

for which price_id

plain venture
#

ok and what create the PaymentIntents in your integration?

signal mango
#

checkout session

plain venture
#

for example, you could look at payment_intent.invoice to get to the invoice, and then the invoice has line items with prices

signal mango
#

yes but that is in case of subscriptions only I guess

plain venture
signal mango
#

what about one time payments?

plain venture
#

(see above)

signal mango
#

I think invoice is null in case of one time payments is this correct?

plain venture
#

it is yes

#

so you want the approach I mentioned, listing CheckoutSessions by paymentIntent ID

signal mango
#

so how I get that info for one time payments then?

plain venture
#

see above

signal mango
#

Okay so you mean I can fetch checkout session for that PI?

#

Yes cause of the code where I got stuck I only PI ID

#

I mean payment intent id only

#

CheckoutSession is some event that happened in past already, I don't have command over it.

#

that is already done by other system.

#

I'm creating a microservice to know the payment of customers whether one-time or subscription.

plain venture
#

makes sense; the above should unblock you

signal mango
#

but the question is still the same how can I get access to checkout session?

raven raft
#

Hey there, taking over from @plain venture

signal mango
#

Okay cool

#

I only have list of customer_ids as starting point

raven raft
#

Because a single PI can only belong to a single Checkout Session, there will only ever be a single object returned

signal mango
#

I see

#

so your answer is I can fetch CS with the help of PI

#

Okay alright let me try

#

thanks

signal mango
#

@raven raft not getting line_items within CS