Now I want to test my server action that I made under Webhooks/stripe/payment_intent.succeeded
But, I can’t use the built-in webhook testing, because this doesn’t send metadata.
Then I hoped I could simply complete the check-out with test data. But this gives me an error:
Webhook Error: No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe? https://github.com/stripe/stripe-node#webhook-signing
I think this error is due to a mismatch of the webhook endpoint secrets.
Ideally I just want to complete the check out in test mode (public test key on client side) using stripe’s test card. And then trigger the webhook on my local or live server.
Stripe support says I need two different endpoints and use different webhook secrets for each
Like:
https://…app/webhooks/stripe_testmode/
https://…app/webhooks/stripe/ )
And yes, this is the suggested way by the Stripe engineers.
@mebeingken I realised again what I’m missing: I can divide the stripe settings per target, but there’s no setting for a separate URL in Wappler, like:
https://…/webhooks/stripe_testmode/
We only get this one default: /webhooks/stripe/
The domain for dev and production will be different but the path to the api and the api name will be the same.
The url you provide to Stripe under the test settings will have your dev domain and live settings gets your production domain.
If you only have localhost then you can either use the internal Wappler testing or use ngrok to redirect an external domain to local.
I’ve never used the local Wappler testing and prefer to have a “remote dev” environment that I use in later stages of development. And occasionally I use ngrok.
Thanks @mebeingken, indeed I only have a local testing environment right now. Well I actually have a staging server but have issues connecting to the database with that still.
Looks like I need to get the staging working 100% for this.
Do you perhaps have experience doing that with Node and docker? (making a staging server)
Nothing special about a staging target. It gets setup like any other target. You just need to remember that certain settings, like the database connections and server workflow settings panel are set based on the target you have active in the editor.