#edutomesco

1 messages · Page 1 of 1 (latest)

little flameBOT
radiant island
#

Hi there. Let me help you with this.

upbeat haven
#

stripeEvent.Data.Object["charges.data[0].payment_method"]

#

i can't access to this object

#

I'm using golang

radiant island
upbeat haven
#

don't undestand

radiant island
#

What kind of event are you listening to?

upbeat haven
#

payment_intent.succeeeded

#

And I want the payment method that it is in "charges.data[0].payment_method"

radiant island
#

I see, let me check on my side.

upbeat haven
#

another thing this webhook didn't arrive to me but it says it is send with no problem: evt_1M4MSkG1fQyuUuzX4pE2Nu29

radiant island
#

This should give you the payment method ID

switch event.Type {
  case "payment_intent.succeeded":
    var paymentIntent stripe.PaymentIntent
    err := json.Unmarshal(event.Data.Raw, &paymentIntent)
    if err != nil {
      ...
    }
    var paymentMethod := paymentIntent.Charges.Data[0].PaymentMethod
upbeat haven
#

yes

radiant island
#

Maybe you could share some code where you integrate the webhook? I see that your server has responded successfully to the Stripe webhook, so maybe your integration is dropping the event somewhere.

upbeat haven
#

so strange

#

because it's integrated as all the others

#

and I received the others

#

my fault I alreaddy see the mistake

#

thanks for all

#

appreciate

radiant island
#

Happy to help. Let me know if you have any other questions.