#newb1-SetupIntents

1 messages · Page 1 of 1 (latest)

woven fog
#

heya, what have you tried?

agile flicker
#

throws ajax error

#

new customer and card attached, but no message of setupintent created and succeeded

#

am i doing something wrong? not including something in that code?

#

are you there?

woven fog
#

please don't post the your api key even though it's in test mode. You should consider your test key compromised and roll it.

#
\Stripe\Stripe::setApiKey('sk_test_...');

    try {
        $customer = \Stripe\Customer::create([
            'source' => $_POST[stripeToken],
            'description' => $form->getValueText('quform_89_8')
        ]);

        \Stripe\SetupIntents::create([
    'customer' => $customer->id,
    'payment_method_types' => 'card',
        ]);
#

what's the error message?

agile flicker
#

just says "There was a problem
Ajax error"

woven fog
#

are you printing out the full error message?

agile flicker
#

i'm not following.. printing out?

woven fog
#

i can see you have a try block

#

how are you catching the error?

#

which line of your code is the error message originating from?

agile flicker
#

it shows up above the form i have the card elemtn in when i submit a test

#

should i not be using try?

woven fog
#

are you able to share the link to a sample or your test site which I can access to take a look?

woven fog
#

your website is in live mode, do you have one that is in test mode?

agile flicker
#

no

woven fog
#

can you share a screenshot of the error? I'm not going to be able to try to replicate it in live mode

agile flicker
#

how to upload attachment

#

huh, gues syou have to type text as well to enter

#

it's not hard to replicate it does the same thing every time

woven fog
#

actually i'm not getting that error so it looks like it may be your environment.

#

can you open the network tab in developer tools and see if there're any requests that are erroring?

agile flicker
#

i f12 and see red error but just show sthe website url, am i supposed to look somewhere else

woven fog
#

you need to select Network in the tabs

agile flicker
#

this is what i get

woven fog
#

i can see that the stripe test form request is in red, are there any other failed requests in there? it'd show in red too

agile flicker
#

just the one i meantioned i saw first, attached

#

that's below in console tab

#

nothing else red in network tab

#

in stripe dashboard looking at events, i can't tell which ones are you and which ones are me, but none of them have the setupintent created/successful events

#

test event log past couple hours

woven fog
#

looking at the network error, it looks like it's not a Stripe issue actually

agile flicker
#

er, ok but it only happens when i insert try this code

#

form works fine without stripe

#

and btw form works if use charge object code instead of setupintent code