#Dhaval

1 messages · Page 1 of 1 (latest)

odd cosmosBOT
fallow wedge
#

hello! if you're asking if the invoice.paid event contains card details - no, it doesn't. If you're asking if you can retrieve the card details from the PaymentIntent id found in the invoice.paid event, yes you can

barren horizon
#

If you're asking if you can retrieve the card details from the PaymentIntent id found in the invoice.paid event, yes you can.
Yes, I am asking about the upper question. Can you please let me know how can I get card details?

fallow wedge
barren horizon
#

It is throwing an error

#

StripeInvalidRequestError: No such payment_intent:

fallow wedge
barren horizon
#

req_fJvBP1f7jqpo5I

fallow wedge
#

this request is to pay an invoice, there's no error message there

#

are you sure you shared the correct request id?

barren horizon
#

yes

#

I am asking for card details of pay an invoice.

fallow wedge
#

there's no error message

#

req_fJvBP1f7jqpo5I isn't to retrieve a PaymentIntent

barren horizon
fallow wedge
#

i think there's some miscommunication here

#

you asked if there's any way to retrieve the card details from the PaymentIntent id found in the invoice.paid event

barren horizon
#

please check above

fallow wedge
#

alright, what's the response that you received?

#

i can't see it since we don't log responses for GET requests

barren horizon
#

i got below response
No such payment_intent: 'pi_3MOhuVRRjbuC3zef0TrZ60XV'

fallow wedge
fallow wedge
#

example

  const paymentIntent = await stripe.paymentIntents.retrieve(
      'pi_...',
      {
        expand: ["latest_charge"]
      }, 
      {stripeAccount: 'acct_...'}
      );
barren horizon
#

Great. got it Thanks 👐

fallow wedge
#

just so you're aware, you don't actually have to retrieve the PaymentIntent

#

you could retrieve the Charge directly instead

barren horizon
#

Actually i want the card details like last4digit, expiration dates

fallow wedge
#

have you tried?

barren horizon
#

what?

fallow wedge
#

have you tried the code i shared - those details should be in the response

barren horizon
cold patio
#

great!