#GK

1 messages · Page 1 of 1 (latest)

red coralBOT
latent steeple
#

I've also tried with:

const stripe = require('stripe')('testapikey');

worthy obsidian
#

Could you please remove your Test API key from this thread?

#

What do you mean, "latest STripe version"?

#

However, after I upgraded my Node SDK it worked just fine.

  • Delete package_lock.json
  • Delete node_modules
  • Run npm install or yarn
latent steeple
#

Hi Snufkin, the test api is from the documentations (not mine)

worthy obsidian
#

Please just remove it

latent steeple
#

I see, it's a new project that I just created. Added my package.json if it helps

worthy obsidian
#

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
latent steeple
#

Alright, I'll keep trying and if i'm unsuccessful I'll message again.

Thank you very much Snufkin for your time and help.

worthy obsidian
#

I understand the frustration. Test Clocks are a big help when testing out Subscription behaviors

latent steeple
#

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?

worthy obsidian
#

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

latent steeple
#

You are right, it's an generated test api for the documentation.

#

Thank you for the heads up

worthy obsidian
#

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

latent steeple
#

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

worthy obsidian
#

By User do you mean Customer? Nope you need to create a new Customer for each Test Clock

latent steeple
#

Indeed, great thank you !