#GIL3S - client secret does not match
1 messages · Page 1 of 1 (latest)
For your connect tests, what public key are you using to confirm the payment intent?
Like which account's public key?
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
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?
If so, you will want to make sure you client is initializing its Stripe.js with the same Account ID you used to create the PaymentIntent https://stripe.com/docs/js/initializing#init_stripe_js-options-stripeAccount
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
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
req_E6QewFxMRW6pqP
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`});```
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
You would likely want to return it as you already are with the client secret and ID
that did the trick!
As your code is deciding which account to create the payment with. It is safe to pass the account ID client side
Awesome!
thanks for the assist. your support crew has been incredibly helpful getting things up and running. much appreciated!
Of course! Always happy to help