#AlienSoft

1 messages ยท Page 1 of 1 (latest)

ashen bluffBOT
azure pewter
#

Hi there

normal creek
#

hey

azure pewter
#

Yep that should work just fine

#

Are you seeing an error?

normal creek
#

yh

azure pewter
#

Do you have a request ID you can share?

normal creek
#

well, it's not even generating a reqID

azure pewter
#

Okay what is the error exactly?

normal creek
#

so, if i do this on the intend, it works

#

"metadata" => array(
"User 2 Email" => $jsonObj->email2, //Emails of other Users
"User 3 Email" => $jsonObj->email3,

                )
#

but if i set this as a variable: i/e
$metadata = array(
"User 2 Email" => $jsonObj->email2, //Emails of other Users
"User 3 Email" => $jsonObj->email3,

                )

then on the intent i have:
"metadata" => $metadata

azure pewter
#

metadata shouldn't be an array but an object

normal creek
#

like a json obj?

#

how can i populate the obj outside the intent, then pass it on the intent

azure pewter
#

Nah just a PHP obj. Try ```$metadata => [
"User 2 Email" => $jsonObj->email2, //Emails of other Users
"User 3 Email" => $jsonObj->email3,

                ]```
normal creek
#

thanks. but it's not liking that either

azure pewter
#

What error do you see?

#

I just tested the above and it works fine

#

Can you try hardcoding the email? LIke: $metadata = ["user 2 email" => 'test@test.com', "user 3 email" => 'test2@test.com]

normal creek
#

strange. nope

azure pewter
#

What error? ๐Ÿ˜…

normal creek
#

500: well the page isn't rendering at all

azure pewter
#

And everything works fine if you just hard code the metadata?

#

Can you show me your relevant code?

normal creek
#

yh

azure pewter
#

Also whoops I was doing $metadata => above when it should have been $metadata =

#

I assume you didn't do that though?

normal creek
#

basically i have quite a few metadata's but i don't want to be adding them all on the intent incase some are EMPTY etc.. so I would like to build the metadata obj and pass that on to the intent

azure pewter
#

Yeah I mean that all makes perfect sense. It sounds to me like something with how you are building your $metadata object is off

#

The Stripe API will handle it just fine if it is created correctly

normal creek
#

oh oh i got it working ๐Ÿ™‚

#

should have been an array

#

$metadata = array ();

#

i was missing the semicolon on my first call ๐Ÿ˜„

#

as the stripe intent doesn't require one

azure pewter
#

Glad you got it working!