#jessa2323

1 messages ยท Page 1 of 1 (latest)

floral isleBOT
tall dragon
#

hello! the parse error seems fairly self explanatory, i don't know how you're running the command, but it looks like there's an additional % character in your URL - yes, what's the full command you're running? Please omit your secret key when sharing your command

amber plank
#

sure, yeah the % issue is probably specific to my use case, it's how you pass the replacement in xargs.

so i have a file with subscription IDs, one per line. and here's my command:

cat subscriptions.txt | xargs -I % sh -c "stripe subscriptions update % --stripe-account 'connected_acct_id' -d 'application_fee_percent=10.36' --live

#

it works in test mode

tall dragon
#

what's with the % ?

#

specifically here "stripe subscriptions update %

amber plank
#

the file subscriptions.txt has one subscription ID per line, that is how you specify where to put the output of the file into the command you're running.

the command gets run once per line in the file, and the subscription ID gets replaced into the %

tall dragon
#

i'm not too familiar with how to implement what you want via the command line, but it's pretty clear that the Subscription id isn't being replaced

#

that's why you're getting /v1/subscriptions/%

amber plank
#

yeah, that error only happens when i use the --api-key method. it works fine if i don't need to pass the --api-key parameter and use test mode

it seems like for some reason, passing the super long --api-key is breaking the command.

is there another way to set the live mode api key for all commands? i also tried stripe login -i and setting it in the config file

#

but it's still using my old api key, even though that isn't even listed in the config file anymore, and i've opened a new terminal session, etc

#

oh hm, i just updated my cli binary, it was on 1.14.7

tall dragon
#

it's working now?

amber plank
#

no, but it's doing something different now, it's asking me to grant access via the browser when i run the command. but it's doing it for every line in the file and giving me a different pairing code each time, so i guess i might just give up and update each of these subscriptions manually, there are like 35 of them

tall dragon
#

honestly, that's probably faster than us figuring it out how to use the live key ๐Ÿ˜…

#

i'm happy to look into a couple of things you could try if you want to continue though

amber plank
#

what couple things?

tall dragon
#

when you say you set the livemode key - when you do stripe config --list, it's showing that livemode key under live_mode_api_key?

amber plank
#

hm, i put the key i wanted to use in the file, but now there is a different one there, after i was prompted by the browser.

i can remove that and put live_mode_api_key = 'mykey' and then do stripe config --list again?

tall dragon
#

it should be fine, so now if you run it with --live it requires you to login at each step?

amber plank
#

sorry, when you say "it should be fine", do you mean the key that got placed in there after i was prompted to log in? because that one doesn't have the permission i need to update subscriptions on connected accounts

tall dragon
amber plank
#

ok i'll try it ๐Ÿ™‚

#

i tried that, and it appeared successful, but when i run my command, it's using a completely different key than is listed in my config file or in the output of stripe config --list . in fact there are 2 separate keys in the config, one for live and one for test, and the one my command is using is a 3rd one -

The provided key 'rk_live_*********************************************************************************************guNbQY' does not have the required permissions for this endpoint on account...

the key ending in guNbQY is the one that was generated after the browser prompt last time. i don't know why it's using that one when it's not in the config file

#

i'm just going to do these updates manually ๐Ÿ™‚ thanks for trying though

tall dragon
#

alright, sorry for not being of much help!

amber plank
#

all good, thanks anyway

#

sorry, thought you might want a new thread for a new topic ๐Ÿ™‚

tall dragon
#

no worries, i get it's a bit confusing

#

If i update the application_fee_percent on each subscription via the api, that percent will be used on the next subscription payment, correct? just want to make sure there's no issue with setting it after the subscription creation

yes, it will be used on the next subscription payment

in case you haven't seen this yet, you can use test clocks to mimic the passing of time : https://stripe.com/docs/billing/testing/test-clocks

Learn how to move Billing objects through time in test mode.

amber plank
#

oh yeah, we used that extensively in the development of our integration. just launched it, first customer used it and sold 35 memberships immediately, then we realized we forgot to configure our fees. ๐Ÿ™‚

#

the test case would be kind of involved to set up with test clocks, so thought i'd ask first. thanks for confirming it'll be used on the next payment

tall dragon
#

probably good to try it out in test mode again, i.e. create a Subscription with no application fees, then update the application fee later just to make sure that everything works as expected

amber plank
#

ok, if you recommend that, i'll do it