#pascal_lin

1 messages · Page 1 of 1 (latest)

polar quarryBOT
fossil widget
#

Hi there!

inland zenith
#

hi

fossil widget
#

Can you share the event ID (evt_xxx)?

inland zenith
#

thanks for help

#

evt_1M7cWLEGyyp51a16y2z6UvUE

#
        invparams := &stripe.InvoiceParams{}
        invparams.AddExpand("payment_intent.payment_method")
        invparams.AddExpand("customer")
        invparams.AddExpand("default_payment_method")
        inv, err := invoice.Get(i.ID, invparams)
        if err != nil {
            logger.Log("err", err)
            return err
        }
#
            if inv.PaymentIntent != nil && inv.PaymentIntent.PaymentMethod != nil && inv.PaymentIntent.PaymentMethod.Type == stripe.PaymentMethodTypeCard {
                if inv.PaymentIntent.PaymentMethod.Card != nil {
                    params.Card = &inv.PaymentIntent.PaymentMethod.Card.Last4
                }
            }
#

here is my gist code

#

by the way,I am using subscription test clock

fossil widget
#

The invoice object has a payment_intent property, and the PaymentIntent object has a payment_method property. What exactly is the issue?

inland zenith
#

but I can not retrieve in my code...but that code works fine in checkout session flow

fossil widget
#

but I can not retrieve in my code...
What does that mean? Do you get an error in your code?

inland zenith
#

could you help me check the request? I can give you a request id

fossil widget
#

Yes sure.

inland zenith
#

wait a second, thank you

#

req_GPbnhSmpLuoCr9

#

sorry, just this one

fossil widget
#

Thanks! And can you paste here the API response you get?

inland zenith
#

sorry, I just logger some specific fields in my code...does it still could help?

fossil widget
#

Can you log the full response as json?

inland zenith
#

This mainly question is I could not expand the payment method from request

#

okay, let me make other request

fossil widget
#

Yes the expand: ["payment_intent.payment_method"] is the request you made and it looks correct to me. What I'm interested in is the reply you gor from Stripe.

inland zenith
fossil widget
#

Thanks! Give me a few minutes to look into this.

inland zenith
#

but I found it is inside other fields

#

maybe I can adjust it in my code, thanks

#

I have no more question, thanks a lot🙏 ,. I am off work now, but you can still leave me messages🙇‍♂️