#omaradelp4er

1 messages · Page 1 of 1 (latest)

fierce foxBOT
distant tide
#

Hi there

cerulean canyon
#

hi

distant tide
#

What exactly do you mean by "can't access the data"

#

Do you see an error?

cerulean canyon
#

i want to get the email and metadata from the session in the webhook to perform an operation when the webhook is trigerd but i cannot

#

when i try to write this: var webhook = new WebHookTest
{
Email = session.CustomerEmail,
};
_unit.WebHookTest.Add(webhook);
_unit.Complete();

#

i got error that i cannot inser null value in my database

#

that mean that i cannot access the session data although i see it in my dashbord

distant tide
#

When you say session do you mean a Checkout Session object?

cerulean canyon
#

and also when i do this session.CustomerDetails.Email ii got null error

cerulean canyon
#

i mean this session var session = stripeEvent.Data.Object as Stripe.Checkout.Session;

distant tide
#

Okay but when you log it right below initializing session you do see the correct data returned?

cerulean canyon
#

just in this i can see the data: var json = await new StreamReader(HttpContext.Request.Body).ReadToEndAsync();
_logger.LogInformation(json);

distant tide
#

What happens if you log out session as a whole after initializing it? Is that null?

#

Have you logged out stripeEvent.Data.Object yet?

cerulean canyon
#

i tried to log the session after convert it into json now and i see all the data correctly

cerulean canyon
distant tide
cerulean canyon
distant tide
#

Sorry I don't understand what that means. You can't submit the data to your database properly?

#

Like if you can print the data then it is there

#

It is then up to you to handle it properly

cerulean canyon
#

i mean i cannot get it in my c# code how to do it

distant tide
#

If it is printing then you do have it in your code... I can't write your code for how to handle the data after receiving it in your webhook endpoint. I can only help you with Stripe-specific issues

cerulean canyon
#

ok thanks