#josh-carter_unexpected

1 messages ยท Page 1 of 1 (latest)

cerulean willowBOT
#

๐Ÿ‘‹ 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.

bright sleetBOT
sly burrow
fallen narwhal
#

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

sly burrow
#

Yes Stripe doesn't check if the image exists or not

#

you need to to that check by your integration.

fallen narwhal
#

Yeah not a problem, not worried about if the image actually exists, but rather stripe accepting a URL with a space in

sly burrow
#

You need to encode the url (replacing the spce with %20 for example) and then pass it to Stripe APIs

fallen narwhal
#

I have done that. When i do that, it gives me the error

sly burrow
#

AH, let me check then...

fallen narwhal
#

Thank you ๐Ÿ™‚

random jolt
#

๐Ÿ‘‹ taking over for my colleague. Let me catch up.

#

would you mind sharing the request where you did what my colleague suggested?

fallen narwhal
#

Hey Tarzan, let me grab that

random jolt
#

and would you mind trying %2520 instead of a simple %20

fallen narwhal
#
{
  "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!

random jolt
#

yes I figured that the problem is that you need to double encode, because we're decoding at our end

fallen narwhal
#

Interesting, I would've never have guessed that. I'll keep a note of that. Assuming this hasnt cropped up too often

random jolt
#

let me know if you need any more help