#_kevinx

1 messages · Page 1 of 1 (latest)

icy hazelBOT
radiant canyon
#

Hi 👋

Can you share the error you are receiving

silent mauve
#

Hi yes

#

but the live mode copy doesn't have look_up key

#

and I archived them

radiant canyon
#

Archive doesn't matter unfortunately. You will have to just set the look_up key on the live product instead of copying

silent mauve
#

Got you, one more question please, what happens to the subscription status if someone paid it then open dispute

#

Will Webhook change the subscription status?

radiant canyon
#

So the payment is successful and then they dispute the charge?

silent mauve
#

Yes

#

I read stories recently that there are a lot scammers testing their stolen cards this way

radiant canyon
#

Hmmm.... I'm pretty sure that the subscription would update and transition to incomplete

#

But raising the Dispute would set off a bunch of additional webook events

silent mauve
#

yeah, if dispute changes the status in subscription, that's all I need

#

otherwise, probably have to track dispute etc which might be a pain

radiant canyon
silent mauve
#

Trying to update lookup_key for live mode and here is the error message
{
"error": {
"code": "resource_missing",
"doc_url": "https://stripe.com/docs/error-codes/resource-missing",
"message": "No such price: 'price_1NO2PfKAjj6I40xpfEKrf1rK'; a similar object exists in live mode, but a test mode key was used to make this request.",
"param": "price",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_vHF8pAQkQM2kc1?t=1688685387",
"type": "invalid_request_error"
}
}

Learn more about error codes and how to resolve them.

#

I copied that key from live mode btw, not test mode

radiant canyon
#

No the Test mode key is the key used to initialize the Stripe client library in this case

silent mauve
#

Is there anyway to use Stripe Shell in live mode?

#

I guess this is the reason

radiant canyon
#

No we don't recommend that

silent mauve
#

I got similar error in my CLI too

radiant canyon
#

Right because the CLI uses test mode by default

#

Both Stripe Shell and the CLI are designed to support testing

silent mauve
#

ok, how do I add the lookup keys for live mode then

#

it doesn't allow me to copy from test, and doesn't want me to use CLI

#

it doesn't allow me to delete those either

radiant canyon
#

Do you only interact with the API via the CLI?

#

Or do you write server-side code with one of our libraries?

silent mauve
#

to set up price and product, yes, how else?

#

Yeah, I do write server side code for production flow, but not setting up things

radiant canyon
#

You could even use a CURL command from the terminal

silent mauve
#

so CURL can be used for live mode?

#

not CLI and shell?

radiant canyon
#

Just use the live mode API key

silent mauve
#

ok, thanks, let me try

#

in this case, I guess I just write something and run it then, instead of doing them one by one, thanks

#
// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://dashboard.stripe.com/apikeys
const stripe = require('stripe')('sk_test_');

const price = await stripe.prices.update(
  'id',
  {
    lookup_key: 'MY_LOOKUP_KEY',
  }
);

#

btw, what needs to be passed here after update, if I update multiple ones

#

it doesn't look like object or array

radiant canyon
#

I'm not sure I understand the question. Where are you referring to?

silent mauve
#

oh, what's the syntax if I need to pass a second id and lookup key, in this example, there is only one

#

I tried copy the same syntax for the second one, but it failed

#

can the API update multipe prices and lookup key

#

or do I have to do it one by one

radiant canyon
#

No, you would need to iterate through one at a time

#

So put the API call inside a loop and get the Price ID & look up key

silent mauve
#

alright