Webpacker stripe image

Hi, I’m using webpacker and I’ve got a product image I want to pass to my stripe checkout session, but webpacker adds a suffix to the file name, and when I attempt to pass that image to stripe it can’t find it.

Anyone, know how to determine what suffix to add to my image, so it can render properly?

Hey @merlin2049er

Could you please share how you are passing the image to stripe checkout?

hi, ok. I have my image stored on the webserver under app/javascript/images.

and in my database I’m just appending the picurl file name… in this case (/photo_not_available.png)

I haven’t tried it with a picture that is hosted on another server or cdn.

ok , all my product images are on now being stored on the cloudinary cdn, and displaying the images on stripes checkout is not an issue.

webpacker scrambles the output, and it’s not really good to put it there anyways.

You’ll want to use the asset_pack_url helper to compute the url to the Webpacker image from its canonical name. If the url needs to be calculated outside the context of a view, use include Webpacker::Helper to pull in the module which defines the helper method.

ok, thanks. It’s much easier to host these images on a cdn, so i don’t have to compile the app when i need to add pictures.