Issue with Stripe when deploying through Git

Hello Netlify community,

Whenever I push new changes to the main branch of my git repo, netlify builds and deploys to production.

Everything seems to be working fine except the Stripe links. When netlify deploys automatically, the Stripe links are broken. However, if I deploy it via my local machine terminal by running netlify deploy --build --skip-functions-cache --debug --prod, the stripe link works as expected.

For your reference I did make sure to add all the Stripe env variables to my netlify site’s Env Variable section.
Link to my netlify site is: https://fluffy-vacherin-570d98.netlify.app/
Link to the most recent build is: Netlify App

Thanks in advance.

Since you’re using RedwoodJS, it sounds related to:

Thanks @hrishikesh. That link was a good starting point:
In case someone is facing the issue in the future, the following helped:
You’d have to first add the stripe environment parameter that is being in the frontend to the redwood.toml file like below:

[web]
  title = "Your Web Title"
  port = 8910
  apiUrl = "/.netlify/functions"
  includeEnvironmentVariables = ['NODE_ENV', 'STRIPE_PK'] # any front-end ENV vars that should be available 

Then you’d have to add this variable to netlify’s domain Environment Variable as well.

Hi @ROZBEH thanks so much for sharing that solution with the community! (: