#GK
1 messages · Page 1 of 1 (latest)
The documentation is:
https://stripe.com/docs/billing/testing/test-clocks?dashboard-or-api=api
I've also tried with:
const stripe = require('stripe')('testapikey');
Could you please remove your Test API key from this thread?
What do you mean, "latest STripe version"?
I ran the snippet here: https://stripe.com/docs/api/test_clocks/create?lang=node and it did not work at first
However, after I upgraded my Node SDK it worked just fine.
- Delete
package_lock.json - Delete
node_modules - Run
npm installoryarn
Hi Snufkin, the test api is from the documentations (not mine)
Please just remove it
I just ran
stripe.testHelpers.testClocks.create({
frozen_time: 1577836800,
});
with
{
"dependencies": {
"dotenv": "^16.0.0",
"express": "^4.17.3",
"stripe": "^8.203.0"
},
"devDependencies": {
"typescript": "^4.9.4"
}
}
``` in my `package.json` and it was successful
Alright, I'll keep trying and if i'm unsuccessful I'll message again.
Thank you very much Snufkin for your time and help.
I understand the frustration. Test Clocks are a big help when testing out Subscription behaviors
Just made it work but I had to switch from:
import Stripe from 'stripe' const stripe = new Stripe('sorry', { apiVersion: Config.Stripe.apiVersion, })
TO
const stripe = require('stripe')('sorry')
Do you have any ideas why this would happen?
Once again, bad idea to put even Test API keys in this thread
A malicious actor could grab them and spam the APIs forcing your Test account to be rate limited
You are right, it's an generated test api for the documentation.
Thank you for the heads up
If you are logged in to your account when you visit the API ref docs it will insert your API key
I'm confirming with my account right now
Thanks for removing, I don't want you to get spammed
Thank you
@worthy obsidian I have a question about test clocks. Is it possible to create a test clock with an existing user? Rather than creating a new customer for a test
By User do you mean Customer? Nope you need to create a new Customer for each Test Clock
Indeed, great thank you !