#josh-carter_unexpected
1 messages ยท Page 1 of 1 (latest)
๐ 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/1219979169845481545
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there!
Can you share the ID (req_xxx) of the failing API request?
https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_2fAWeJ8Qs8ZyKD ๐
req_flfKfFpQChpHFi
This one has an image that doesnt 404, but it doesnt seem to be checking for if the image is there, rather just a regex to confim its a valid URI
Yes Stripe doesn't check if the image exists or not
you need to to that check by your integration.
Yeah not a problem, not worried about if the image actually exists, but rather stripe accepting a URL with a space in
If i pass https://uploads.prod01.sydney.platformos.com/instances/502/assets/images-shopping-cart/New Books/1788.jpg stripe returns the error,
but if i pass https://uploads.prod01.sydney.platformos.com/instances/502/assets/images-shopping-cart/NewBooks/1788.jpg it does work
You need to encode the url (replacing the spce with %20 for example) and then pass it to Stripe APIs
I have done that. When i do that, it gives me the error
AH, let me check then...
Thank you ๐
๐ taking over for my colleague. Let me catch up.
would you mind sharing the request where you did what my colleague suggested?
Hey Tarzan, let me grab that
and would you mind trying %2520 instead of a simple %20
{
"url": "https://api.stripe.com/v1/checkout/sessions",
"method": "POST",
"headers": {
"Authorization": "Bearer REDACTED",
"Content-Type": "application/x-www-form-urlencoded"
},
"body": {
"mode": "payment",
"payment_method_types[]": "card",
"line_items[0][quantity]": "1",
"line_items[0][adjustable_quantity][enabled]": false,
"line_items[0][price_data][currency]": "usd",
"line_items[0][price_data][unit_amount]": "3000",
"line_items[0][price_data][product_data][name]": "1788: The Brutal Truth of the First Fleet",
"line_items[0][price_data][product_data][images][0]": "https://uploads.prod01.sydney.platformos.com/instances/502/assets/images-shopping-cart/New%20Books/1788.jpg?updated=1651064311",
"line_items[0][price_data][product_data][metadata][image]": "https://uploads.prod01.sydney.platformos.com/instances/502/assets/images-shopping-cart/New%20Books/1788.jpg?updated=1651064311",
"line_items[0][price_data][product_data][metadata][sku]": "CYAQE1512E",
"line_items[0][price_data][product_data][metadata][itemid]": "2128",
"line_items[1][quantity]": "1",
"line_items[1][adjustable_quantity][enabled]": false,
"line_items[1][price_data][currency]": "usd",
"line_items[1][price_data][unit_amount]": "1000",
"line_items[1][price_data][product_data][name]": "Activated Charcoal",
"line_items[1][price_data][product_data][images][0]": "https://uploads.prod01.sydney.platformos.com/instances/502/assets/images-shopping-cart/Activated-Charcoal.jpeg?updated=1651073352",
"line_items[1][price_data][product_data][metadata][image]": "https://uploads.prod01.sydney.platformos.com/instances/502/assets/images-shopping-cart/Activated-Charcoal.jpeg?updated=1651073352",
"line_items[1][price_data][product_data][metadata][sku]": "MIAQL13070",
"line_items[1][price_data][product_data][metadata][itemid]": "2101",
"phone_number_collection[enabled]": "true",
"success_url": "https://www.norfolkonlinenews.com/payment-confirmation?pid={CHECKOUT_SESSION_ID}",
"cancel_url": "https://www.norfolkonlinenews.com/cart-new"
}
}
Will try that now
Yeah that does work! percent encoding the percent haha!
yes I figured that the problem is that you need to double encode, because we're decoding at our end
Interesting, I would've never have guessed that. I'll keep a note of that. Assuming this hasnt cropped up too often
let me know if you need any more help