#caderann_code
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1412685122431614987
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
additional code context:
public function createSetupIntent(CenterContact $centerContact): array
{
$ephemeralKey = Stripe\EphemeralKey::create([
'customer' => $centerContact->gateway_id, //stripe customer id
],
['stripe_version' => '2023-10-16', 'stripe_account' => $this->stripe_id]
); // $this->stripe_id is connected account id
$stripeIntent = StripeSetupIntent::create([
'customer' => $centerContact->gateway_id, //stripe customer id
'automatic_payment_methods' => [
'enabled' => true,
'allow_redirects' => 'always'
],
], ['stripe_account' => $this->stripe_id]); // $this->stripe_id is connected account id
return [
'setup_intent' => $stripeIntent,
'ephemeral_key' => $ephemeralKey->secret
];
}
Hi! Is the setup intent being created on the same account as the publishable key is being used?
yes, we've verified it
the Publishable key is of the account of the parent stripe account, not the connected account
we're also getting this error in the app network logs:
{
"error": {
"code": "resource_missing",
"doc_url": "https://stripe.com/docs/error-codes/resource-missing",
"message": "No such setupintent: 'seti_1S2SCGAXSZpEHfLwgIdKQroq'",
"param": "intent",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_ZTOI3ho9nfkk2A?t=1756711837",
"type": "invalid_request_error"
}
}
You are using the Stripe-account header to create the Setup Intent. This means the Setup Intent lives in the connected account. So you will have to use the publishable key of the connected account and not the platform.
okay, can we retrieve the publishable_key for the connected using API?
because we cannot hardcode the publishable key in our app as it's white-labelled
Just checking on above.
You cannot and don't need to retrieve the publishable key of the connected account. You can use the Stripe-account header for it: https://docs.stripe.com/connect/authentication?create-client=react-native
we're already sending it in the request header as given in the above code snippet
Above is your backend code correct?
yes
The error is for the frontend as it mentions the publishable key. The document I linked is for the frontend as well.