Hello, community!
I’m wondering if anyone has successfully enabled Stripe payments in the Editor, Production, and Staging environments.
Here’s our setup: we’ve configured the test keys (PK & SK) in the Stripe plugin for the Editor and Staging environments, and the live keys (PK & SK) for Production.
The payment workflows function perfectly in both the Editor (Test) and Production (Live) environments.
However, when attempting a test payment in the Staging environment using the test keys, the payment modal fails to appear, and we receive the following message:
{
"error": {
"message": "The client_secret provided does not match any associated PaymentIntent on this account. Ensure the publishable key used belongs to the same account that created the PaymentIntent.",
"param": "client_secret",
"request_log_url": "https://dashboard.stripe.com/logs/req_10PYB78n3imHxE?t=1737541221",
"type": "invalid_request_error"
}
}
It seems that while the Staging domain correctly loads the plugin, it might still be using the live keys instead of the test keys, even though the configuration specifies the test keys.
Any ideas or suggestions?
Thank you very much,
Hi, under the ‘Staging’ section, you set both:
- Public API key (pk_test_)
- Private API key (sk_test_)
And you are still experiencing this issue?
Hello Danlopes,
I have tested multiple scenarios and verified that the client_secret returned from the Xano endpoint matches the one used in the network configuration. They are completely identical, so there is no mismatch at that level.
However, while running tests in the staging environment, I noticed that the network requests are still using the live publishable key ( pk_live_…) instead of the expected test publishable key ( pk_test_…).
My Stripe configuration is correctly distinguishing between editor mode and production, but for some reason, the staging environment is not switching to the test key as expected. This results in requests being sent to Stripe with the wrong key, causing validation errors.
Here is an example of the request being made in staging:
https://api.stripe.com/v1/elements/sessions?client_secret=pi_3QzSiCG0ni80htPp0kR0zneK_secret_sQt944sTQ2CXnKOqNF79aSRAI&key=pk_live_51MeSVFG0ni80htPpsQHNIGPXL7oRdPhRvVzy8xZc0vsTTR9EML8BiC7ii6cuYqFp7929CwlngXvXsyRJVt0ELmmV0047PMfKmR&type=payment_intent&locale=en-GB&referrer_host=d41aad08-9bf3-452d-9da1-d38672884ce3-staging.weweb-preview.io&expand[0]=payment_method_preference.payment_intent.payment_method&stripe_js_id=136e6fdb-e9a0-47dc-9e9b-6113eed38db2
Could you help investigate why staging is still using pk_live_… instead of pk_test_…, even though the configuration is correctly distinguishing between other environments?
Thanks for your help!
Best,
I have created a ticket: WeWeb Staging Using Live Stripe Publishable Key Instead of Test Key
Thanks in advance for your support!