#alex-dp - java webhook events

1 messages · Page 1 of 1 (latest)

lofty saffron
#

hey there

#

Can you share an example event / charge ID i can look at?

#

Did you provide an existing customer when you created the payment?

misty fern
#

hi, look at this charge id

#

ch_3KRfuYFg4Rvv65py0vsFRTrC

#

it's in test mode

#

where the user enters their email

#

I would like to capture that when the charge goes through

#

perhaps there is another event type that I should use instead of charge.succeeded? thank you

worn nest
#

hello

#

catching up here

misty fern
#

hi

worn nest
#

looking

#

can you retrieve the entire Charge object and log out the raw response? you can use curl for it, for example and share it here (redact any personal info like email etc)

something like (replace sk_test with your test mode publishable key

curl https://api.stripe.com/v1/charges/ch_3KRfuYFg4Rvv65py0vsFRTrC \
  -u sk_test_123:

misty fern
#

give me 1 min

#

the email is there

#

I'm just clueless on how to access it from the Charge object sent to the webhook

#

charge.getBillingDetails().getEmail() I guess will work. thank you so much!

worn nest
#

to get the email of the Customer object, you first need to fetch the CUstomer object using the charge.customer CUstomer ID

that Customer object will have customer.email