Stripe payment successful does not add credits
In development all is well, in production using stripe tesk key the payment processes successfully but the credits are not added to the account.
I have added the webhook in stripe and the CREDITS_PRICE_ID PRO_SUBSCRIPTION_PRICE_ID and STRIPE_WEBHOOK_SECRET to the server and REACT_APP_STRIPE_CUSTOMER_PORTAL to the client.
4 Replies
Hi @Ghar. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the information provided, it seems like you've set up the Stripe integration correctly. However, there could be a few reasons why the credits are not being added to the account after a successful payment. Here are a few things you could check:
1. Webhook Events: Make sure that your application is correctly receiving and handling the webhook events from Stripe. You can check this by running the Stripe CLI and ensuring that the events are being received. If you're not receiving the events, you might need to check your webhook setup in Stripe.
Source: Discord support thread: Payment for Credits / Credit Balance System > Answers Part 2 (https://discord.com/channels/686873244791210014/1205328655300038766)
2. Code Execution: Check the code where you're incrementing the user's credits. Make sure that this code is being executed when a payment is successful. You can do this by adding console.log statements or other debugging techniques.
Source: Discord support thread: Payment for Credits / Credit Balance System > Answers Part 4 (https://discord.com/channels/686873244791210014/1205328655300038766)
3. Error Handling: Make sure that your code is correctly handling any errors that might occur. This can help you identify if there's a problem with the payment or the updating of the user's credits.
Source: Docs > Auth > Email > Creating a Custom Sign-up Action Part 3 (https://wasp-lang.dev/docs/auth/email#creating-a-custom-sign-up-action)
If you're still having trouble, you might want to consider asking for help from the Wasp community or checking the Stripe documentation for more information.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Ghar, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
I had to change the webhook endpoint to use the fly.dev URL not the custom domain
Great! I think docs do cover that? ANything we could have done better?
The docs do indeed cover it - using the auto bot here is easier :) does a great job