#oranges13

1 messages ยท Page 1 of 1 (latest)

jolly sluiceBOT
modest moss
#

๐Ÿ‘‹

manic idol
#

Hello ๐Ÿ‘‹

modest moss
#

This has been a nightmare

manic idol
#

Sorry to hear. I am surprised that this seems to be happening because of expansion. So if you remove the expansion argument your original key gets used?

modest moss
#

Unsure. It's extremely inconsistent ๐Ÿ˜ฆ

#

Which also doesn't make sense because code shouldn't have moods

#

That is my best guess as to why this may be happening.

#

A better example I just got repeated failures to create an invoice item

manic idol
#

Do you have a snippet of code that consistently gets this error?

modest moss
#

We were doing InvoiceItem::create($parameter_array, ['idempotency_key' => 'something']); which would repetatedly fail

manic idol
#

So if you have code that just sets up stripe and then makes that call, will that fail?

modest moss
#

So this in Laravel

#

we have the api key set up in our App Service Provider which is supposed to be globally available to evrything

#

so the api key should never be UNSET

#

in fact I can echo it out immediately before the call, but the call still fails

#

I even added \Stripe\Stripe::setAPIKey immediately before the call as well

#

so it must be something to do with us using the legacy format ๐Ÿ˜ฆ

manic idol
#

Still looking in to what might be happening here. Can you make a standalone snippet of code that gets this error?

modest moss
#

Sure. The one that was failing most often just now is

\Stripe\Customer::retrieve(['id' => 'customer_id', 'expand' => ['default_source']]);

#

repeatedly and consistently

manic idol
#

I mean a little more than that. Like a few lines of code with your keys redacted where I can copy-paste in to a file, swap in my keys and get the error

modest moss
#

ah. Well like I said, it's Laravel -- so the api key is set in a different file ๐Ÿ˜•

manic idol
modest moss
#

But also we were having this problem before and we weren't using an expand array, it shoul have been straight up Invoice::retrieve('in_id') nd that was failing rather frequently too

#

Does that 3rd array format work with the old style too? I think that's where we might be getting hung up since we can't immediately migrate to the client/service syntax ๐Ÿ˜ฆ

#

I think that may be the root of all this unfortunately

manic idol
#

Whoops, I mixed up the old and new syntaxes for a moment. I will look for an equivalent in the older syntax

modest moss
#

Thanks I think that will help a ton ๐Ÿ™‚

manic idol
modest moss
#

how would we mix that with an expand? Is it the same array or do we do an array for the first parameter too?

manic idol
#

I do not know enough PHP syntax to guess and my local project seems to be broken at the moment. From the docs I would guess you should make this separate and put it after the expand arg

#

If that doesn't work, put it in the same array

wicked mulch