#ozzy_api

1 messages · Page 1 of 1 (latest)

hushed ivyBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1316817756703821969

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

south dome
#

Hi there

#

Can you share more details about what you mean when you say "change it to live"? Did you update both your secret key and publishable key?

Please don't share any secret keys here.

iron plover
#

I only changed my secret key and rolled my publishable key

#

i am getting a null resource id or whitespaced this just happened last night all i did no changes to my code

south dome
#

rolled my publishable key
Did you update your client-side code to use the pk_live key?

iron plover
#

Yes

silver meadow
hushed ivyBOT
#

@silver meadow looks like you're in the wrong place, this thread is for someone else's question.

Note that posting inappropriate messages in other people's threads is against the rules. No worries if this was just an honest mistake, but anyone who violates the rules multiple times will be removed from this server.

silver meadow
#

ok thx

south dome
#

@iron plover I think you'll need to debug this more closely

iron plover
#

it works with my other account keys though

#

so its not from my code

south dome
#

I recommend adding some logging to determine where the code is errorring out after you swap in the live keys

#

Can you share the section of your code that calls /v1/invoices?

#

Are you retrieving an Invoice that only exists in test mode?

iron plover
#

it doesnt make sense I tried keys from a different stripe account and it works

#

something wrong with the stripe keys

south dome
#

Are you able to test that secret key outside of your code? You can try using cURL

iron plover
#

I will try that i will need some time

south dome
#

@iron plover any luck?

iron plover
#

about to test

#

we tried woo with the original keys and it works

south dome
#

by "original keys" you mean your live secret key?

iron plover
#

we connected by authentication

#

we didnt use keys

south dome
#

Okay, that's not too helpful.

#

I was hoping you could make a call to list all customers using the same key you're trying to use within your code to rule out any issues with the key

iron plover
#

Ok I will open another ticket i will need some time for this

#

I am getting a new error now

#

Invalid card details No such token: 'tok_1QVH8NBwNF8aAhcXs9bzIfQ1'

south dome
#

What are you trying to do when you get that error?

iron plover
#

pay with my cc

south dome
#

Specifically, what kind of request are you making when you get the "No such token" error?

#

I suspect you're mixing up accounts

iron plover
#

trying to do a $10 donation on the checkout i changed all the keys to the correct ones

#

trying to see my error log

south dome
iron plover
#

one sec let me try this on test mode

south dome
#

Okay, I think you need to take a step back

#

This is getting confusing to follow and I think you might be trying to do too many things at once

#

Start from the top and confirm that your code can still run with the test mode secret key and test mode publishable key.

iron plover
#

It works on test mode

south dome
#

Can you share the test mode publishable key you're using? It's safe to share here since publishable keys are public/not sensitive

#

The key begins with 'pk_test'

iron plover
#

pk_test_51KrzE2BwNF8aAhcXNMoFjTtRn2nyHynf61jKNUDmzmSQYNXQAQGPLFol3iNsKmB5VTnrZL1wvxQoXzhAqO5ygqGs00wJghjunP

south dome
#

Okay, good. That key is tied to the same account you used to create token tok_1QVH8NBwNF8aAhcXs9bzIfQ1

#

Do you happen to have the request ID for the request that returned the error nvalid card details No such token: 'tok_1QVH8NBwNF8aAhcXs9bzIfQ1' ?

hushed ivyBOT
iron plover
#

Sorry I do not. I got the error resource id cannot be nulled or whitespace again won't let me access my code

gloomy spear
#

If you don't see the request ID in your logs - that means the API request is going to a different account.

#

How are you initializing Stripe.js?

iron plover
#

This stopped working suddenly last night. I can't process donations anymore unless I do a test donation, which works fine. However, when I switch to live keys, the site crashes and shows the error: 'source ID cannot be null or white.' I haven’t changed or rolled back my API versions. Strangely, if I use the same code with keys from a different account, it works fine.

gloomy spear
#

What line of code is throwing "'source ID cannot be null or white" error?

iron plover
#

[12-Dec-2024 11:47:13 America/Boise] PHP Fatal error: Uncaught Stripe\Exception\InvalidArgumentException: The resource ID cannot be null or whitespace. in /home2/ozzycode/public_html/h4cdev/donate/includes/stripe-php/lib/Service/AbstractService.php:99

gloomy spear
#

That's just a log. What line of code in your integration triggers the error? There must be something in your own code that's calling methods from stripe-php right?

iron plover
#

Yeah one sec

#

foreach($i as $key=>$value){$invoice_data=$stripe->invoices->retrieve($value['latest_invoice'],[]);

gloomy spear
#

So what are you iterating on here? I'd recommend backtracking it line by line

iron plover
#

Ok. I am going to review this again and get back to you guys if i need support again need a little break

gloomy spear
#

NP! 🙂 Good luck

#

I suspect you're using Stripe Connect based integration and you're initializing Stripe library with a connected account ID. When you switch platforms, the same connected account will not be connected to the other platform.

Which is why you're seeing resource not found error.