#lockekosta
1 messages · Page 1 of 1 (latest)
Please edit out your api key
Still considered sensitive data even in test mode
Will delete this thread if it's not edited
You also need to roll the key now: https://stripe.com/docs/keys#rolling-keys
What do you mean by refuses to work?
Is there an error message? What's happening?
I'm trying to do this as a favor on shopify so not getting much back in response. Basically created the js file, can grab the variable without the API call, adding the API call returns nothing like there's a syntax error.
My understanding is that the variable should be the length and I have 2 active test subscriptions so it should be 2, instead the script doesn't pull like there's a syntax error or something.
So it appears to me the API call is straight up just not working, and given how barebones it is, I don't know why not.
Well if there's no error and it's returning an empty list that means it's reaching our api
And it doesn't find subscriptions that meet the criteria
Can you check your request logs and send me the request id? https://support.stripe.com/questions/finding-the-id-for-an-api-request
It's not returning an empty list.
It's not returning anything. It doesn't work.
What does printing subscriptions show
Can you check your request logs and send me the request id? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
I have this:
<script>
var subAmount = subscriptionType; document.getElementById("sub_link_href").setAttribute("href", "SoldOut" + subAmount);
</script>
And it doesn't work with the API call. Without it, it works and the amount is whatever I put into the variable.
Can you check for a request id?
If I'm reading the log right it doesn't look like any request was made
And you printed out the subscriptions variable after attempting to make that call to see what it contains?
That didn't answer my question
You're saying the script doesn't run at all?
That's server side code you wrote
That's what it seems like
It can't run from the browser
You wrote node.js code to list subs
That can't be done from the browser
If I take the API call out and just give it an int, it works.
So I can't make a stripe API call in shopify?
I'm not familiar with shopify
We just help developers integrate the stripe api directly in here
Not familiar with third party plugins and such
But the code you wrote needs to be executed server-side
It's server-side code...
You can't run it from the browser
You need to run it from your server
And if you use shopify, you likely don't control the server
But idk it's a third party service
Also are you a developer? It's extremely important to understand which pieces of stripe code run clientside and which run serverside. Because if you attempt something like the above script in your browser you risk exposing your api secret key, which can give someone the ability to take over your stripe account.