#karamhelmi12

1 messages · Page 1 of 1 (latest)

pine crescentBOT
regal pilot
#

Hi let's chat in this thread @upbeat oriole

upbeat oriole
#

hey thank you

regal pilot
#
                clientSecret: intent,```
#

looks like you only pass the intent and not the client secret here. Why?

upbeat oriole
#

sorry i forgot to change it back, i was having the issue when i was sending intent.clientsecret

#

so when i send intent.clientsecret i don't get the clientsecret in the client side

regal pilot
#

When you log intent.clientsecret, what do you get?

upbeat oriole
#

i am rebooting the app two seconds

#

i do get the following {requiresAction: true,
status: requires_action}

#

i just don't get the clientsecret

regal pilot
#

So it's just missing that param entirely?

pine crescentBOT
upbeat oriole
#

yeah

#

i am thinking i should be getting null or something maybe

#

but i just don't get anything at all

#

the value i recieve from the server is at the very bottom

quick oar
#

Hi 👋

I'm stepping in as @regal pilot needs to go soon. It looks like your generateResponse function is not returning all the data you expect. Can you try adding some logging there to make sure you are getting the intent object you expect?

upbeat oriole
#

like this? console.log(intent.clientSecret);

quick oar
#

I would log the whole intent to see if it has the properties you are trying to reference.

upbeat oriole
#

okay two seconds

#

i am using firebase cloud functions and i am trying to figure out where i can see the output of the console.log()

#

i never really used cloud functions before

quick oar
#

I do not have experience with firebase functions either. However, based on the output it looks like the only value being retunred by your function is the one you hard-coded

#

Which suggests to me the intent is not getting passed

upbeat oriole
#

this is what i get when i send the entire intent to through my console

#

i can pass the intent however just not the clientsecret

quick oar
#

Okay so if you look at what is being returned for clientSecret it looks like the whole Payment Intent data is assigned to that key for some reason

upbeat oriole
#

i did think that it's weird

#

but here where it makes my brain go in knots

#

i can't use the clientsecret id that is printed

quick oar
#

Yeah it seems like the response is getting kind of mangled but first try returning the intent.clientSecret.clientSecret?

upbeat oriole
#

okay two seconds

#

i get this

quick oar
#

Hmmm... okay. So I think you will want to look at the intent before it gets to generateResponse.

upbeat oriole
#

okay now i am getting the whole thing properly

#

but i still need to do the generateResponse() helper method so i return the right value. do you know how i can still have the method but also avoiding the problem

quick oar
#

I don't know off the top of my head. But you can see that you have the data in the right shape now so try passing it to the generateResponse function and see if you can access the clientSecret.

upbeat oriole
#

okay

#

your help is very much appreciated, thank you very much

#

hope you have a wonderful day!

quick oar
#

Thanks! I hope you can get it working soon.