#matt_error

1 messages ¡ Page 1 of 1 (latest)

dull nightBOT
#

👋 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/1357405135072137217

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

nova gull
#

Hi 👋

can you explain the process where this error message is received?

heady magnet
#

Can you elaborate on the question

nova gull
heady magnet
#

There is no API request ID because as I mentioned, these requests don't even show up in the console for some reason..

#

We get the error when running the following code with the PHP SDK:

$paymentMethod = PaymentMethod::retrieve($stripePaymentMethodId);
$paymentMethod->detach();
nova gull
#

That response does not appear to be a Stripe error

heady magnet
#

Actually, the message there is slightly different

nova gull
#

Can you share that message?

heady magnet
#

Invalid response object from API: {$rbody} " . "(HTTP response code was {$rcode})";

nova gull
#

But you aren't seeing a HTTP response code when that is returned, are you? What you shared was actual HTML

dull nightBOT
heady magnet
#

We're seeing a 400 response code, but we do not see the request show up in the dashboard

#

So it looks like for whatever reason, when we hit the API, Stripe is returning an nginx error to us

viscid void
#

Hi hi! I’m going to be taking over for my colleague here. Can you share the Payment Method ID?

heady magnet
#

Sure, pm_1R7sWCIVLuRzysjdP0ijXtvj

heady magnet
#

Also here's the full error that we're receiving, since I noted that the original message cut it off:

{"code":400,"message":"Invalid response body from API: 
<html>
    \r\n
    <head>
        <title>
            400 Bad Request
            <\/title>
                <\/head>
                    \r\n
                    <body>
                        \r\n
                        <center>
                            <h1>
                                400 Bad Request
                                <\/h1>
                                    <\/center>
                                        \r\n<hr>
                                        <center>
                                            nginx
                                            <\/center>
                                                \r\n
                                                <\/body>
                                                    \r\n<\/html>\r\n (HTTP response code was 400, json_last_error() was 4)"}
viscid void
#

Where are you receivng that error?

viscid void
#

At what time was the request attempted/did you get the error?

heady magnet
#

Latest request was at 10:53 PST. I can make a request again, but it seems like the requests aren't showing on our dashboard

viscid void
#

That's great, thanks. Wait one.

heady magnet
#

Sure, thank you

heady magnet
#

Hey, just checking in to see if there are any updates on this

viscid void
#

Still digging.

heady magnet
#

Alright, thank you

dull nightBOT
ocean tapir
#

It looks like this response is happening because there is a null byte that is being sent along with your API key. Can you send me your code for how you are setting your API key in your stripe-php client?

heady magnet
#

Sure, one moment

#
Stripe::setApiKey($this->config['apiSecret']);

What I don't understand is, why is it being sent with only that one specific request when this is the way that we set our API key in every request and those seem to work

ocean tapir
#

My mistake, it looks like the issue is in the URL that is getting sent to us. That is largely getting set by the PHP library, so I am guessing the null byte is somehow included in the payment method ID that you are providing us

heady magnet
#

How were you able to determine that the issue is to do with a null byte?

ocean tapir
#

The type of internal error is coming from the HTTP request being malformed because of a null byte.

heady magnet
#

I see. Is it happening in the retrieve request or the detach request?

ocean tapir
#

Looks to be the detach, though if there is an extra null character in the ID I would expect that to effect any call that you pass the ID to the same way