#GIL3S - client secret does not match

1 messages · Page 1 of 1 (latest)

stiff wyvern
#

For your connect tests, what public key are you using to confirm the payment intent?

#

Like which account's public key?

wooden prism
#

should each connect account have it's own set of keys?

#

I'm having trouble tracking it down. All connect accounts are using the same prod pub/private keys

stiff wyvern
#

Oh wait sorry, that was slightly the wrong question. You will always be using the same secret-public key pair from the same account

#

That should be fine. On your server are you using the Stripe Account parameter to create these payments or subscriptions directly on the Connected accounts?

wooden prism
#

I'll verify

#
            $payment_intent_data = [
              'amount' => $amount * 100,
              'customer' => $customer->id,
              'description' => '**** Donation',
              'currency' => 'usd',
              'payment_method_types' => [
                'card',
              ],
            ];
            $payment_intent = $this->stripe_call('paymentIntents', 'create', NULL, $payment_intent_data);
            $_SESSION['vfd_checkout']['stripe']['payment_intent_id'] = $payment_intent->id;
            $client_secret = $payment_intent->client_secret;```
#

so essentially that stripe call method pulls the private key when creating the paymentItntent and theyn stripe.js which receives the client secret from the paymentIntent and uses the public key associated with the private key used in the previous step

stiff wyvern
#

Interesting. Still not quite sure what is wrong here but I have a good idea for how to find out. Can you look at your request logs https://dashboard.stripe.com/logs and send me the Request ID req_123 from the time you tried to confirm the payment intent but got this error?

#

A couple things might be getting mixed up here and I should be able to see which two keys were relevant from that call

wooden prism
#

req_E6QewFxMRW6pqP

stiff wyvern
#

Thank you

#

On the client side are you using that stripeAccount param I mentioned? I think you may just need to initialize it with that:

var stripe = Stripe('pk_test_123', {stripeAccount: `acct_456`});```
wooden prism
#

ok that makes sense. I am definitely not doing that. Is there any documentation on how to get those values into the js dynamically? We have one checkout.js where those values can change depending on what subdomain you are accessing the product through

stiff wyvern
#

You would likely want to return it as you already are with the client secret and ID

wooden prism
#

that did the trick!

stiff wyvern
#

As your code is deciding which account to create the payment with. It is safe to pass the account ID client side

#

Awesome!

wooden prism
#

thanks for the assist. your support crew has been incredibly helpful getting things up and running. much appreciated!

stiff wyvern
#

Of course! Always happy to help