#pascal_lin
1 messages · Page 1 of 1 (latest)
Hi there!
hi
Can you share the event ID (evt_xxx)?
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
The invoice object has a payment_intent property, and the PaymentIntent object has a payment_method property. What exactly is the issue?
but I can not retrieve in my code...but that code works fine in checkout session flow
but I can not retrieve in my code...
What does that mean? Do you get an error in your code?
could you help me check the request? I can give you a request id
Yes sure.
Thanks! And can you paste here the API response you get?
Can you log the full response as json?
This mainly question is I could not expand the payment method from request
okay, let me make other request
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.
Thanks! Give me a few minutes to look into this.