#g105b
1 messages · Page 1 of 1 (latest)
Hi! Let me help you with this.
Could you please share an ID of the failed request? req_xxx
Hi Vanya, the response from Stripe was not a failure, but the response content did not contain the Product's Price, so it caused an exception in the API code (Stripe API, not my code). I've just looked in the logs, and I can see that there wasn't actually a request made to /v1/prices/price_1LUpf6HorLyYqvBKx6GlSEdH at the time of failure yesterday.
The Price in question is this: price_1LUpf6HorLyYqvBKx6GlSEdH
As far as I can tell, this Price disappeared from Stripe at 11:55 yesterday, and appeared again at 15:55. These two times correlate with when someone added Payment Link plink_1NZX3rHorLyYqvBKe7dSckgF.
Firstly, can I confirm that adding a Payment Link should not affect a Product's Price in the way I observed?
I don't log the body response, because I use the Stripe PHP API, which threw this exception:
Stripe\Exception\InvalidArgumentException - The resource ID cannot be null or whitespace. ./vendor/stripe/stripe-php/lib/Service/AbstractService.php:99
My code calls $stripe->prices->retrieve($product->default_price);
The $product in question is prod_MDGBIz6Fibp8rF and according to the Event log, this product has not changed for about a year.
If you look at that Product, you'll see there is only one price, and as far as I'm aware, the product's price has not changed, yet my understanding of this issue is that the price was not being returned in the API call yesterday.
Could you please share a larger code snippet, for context.
Sure
$this->productArray = [];
foreach($this->stripe->products->all() as $product) {
$price = $this->stripe->prices->retrieve($product->default_price);
array_push(
$this->productArray,
new AccessCard\Product(
$product->id,
$product->name,
new AccessCard\Price(
$price->id,
$price->unit_amount,
Currency::fromString($price->currency),
)
),
);
}
This code loops over the response from Products.all and constructs my own Product and Price objects... although it's the call to the $this->stripe->prices->retrieve() that threw the exception.
My code hasn't changed in months, and neither has the Product in Stripe, but I really need to understand why this crash occurred.
I see. I think this issue will need more time to investigate than I have on Discord, and a possible follow up with a product team. Could you please reach out to Support and say you talked to me on Discord. I will then look at your case asynchronously. https://support.stripe.com/?contact=true