#connect-checkout

1 messages · Page 1 of 1 (latest)

thorn palm
#

@dusty juniper hello! That's a big vague right now as a question, what did you try, what are you seeing?

dusty juniper
#

We get the Price, then get the Product, then get the product.images which is an [] or urls, yes?

#

Do we pass in all images?

thorn palm
#

you should be able to simply create a Product in the Dashboard, put the right image and then see that image on Checkout

dusty juniper
#

One image?

#

Um

thorn palm
#

what have you tried? Trying to self serve is a lot faster

#

but yes just one image is supported on Checkout

dusty juniper
#

We are Stripe Connect (hence the name)

#

Ok, one image.

thorn palm
#

sure I know but it doesn't really matter for the flow

#

the image that shows is the same even on your own account

#

it's easier to debug Checkout on your own account first and when that works add Connect

dusty juniper
#

Well, we have to pull an infinite number of products and I have no idea if the customer created an image or not, but if they did I want to pull a good one and show it (or them). I guess it if you only allow one.

#

I am uploading an image to a Product associated with a Price and I see it in the dashboard

#

But now I am getting the price from the API, then getting the Product ID from the price, then pulling the Product but image url is a blank array. ?

#

"images": [

],

#

prod_KBTllThAeTu9uc

#

Wait. I got it. Seemed as if image didn't save. OK, I am going to just pull the first image_url

#

thank you!

thorn palm
#

A Product can have more than one image, I thought you asked about how to make it work with our Checkout product, sorry

#

so yes images is an array and could have 5 or 10 images in it

dusty juniper
#

You may only specify one of these parameters: images, price.

#

If we give you the Price, shouldn't Stripe populate the image for us?

#

We are getting the error that we are sending you a Price AND an image??

#

*** Stripe::InvalidRequestError Exception: You may only specify one of these parameters: images, price.

thorn palm
#

I'm sorry, can you share more information? Like the exact code of what you are doing?

dusty juniper
#

req_mEdXqje45LhyeG

#

This is the failing API call:
session = Stripe::Checkout::Session.create(session_hash ,{stripe_account: @site.stripe_user_id})

#

{:payment_method_types=>["card"], :mode=>"payment", :allow_promotion_codes=>false, :success_url=>"https://website.com/members/complete_signup_redirect?session_id={CHECKOUT_SESSION_ID}&app_site_id=app_1234567&livemode=false", :cancel_url=>"https://example.com", :line_items=>[{:price=>"price_1JX6nYGkntF0z1iAS4TTHOjo", :quantity=>1, :invoice_item=>{}, :images=>["https://files.stripe.com/links/MDB8YWNjdF8xSk9XaEtHa250RjB6MWlBfGZsX3Rlc3RfUGs0UjZyWDNPd3EyY1Y4Vk9HR2h6NnNW00PaJN3Oz0"], :description=>"My Amazing One-time Checkout "}], :payment_intent_data=>{:metadata=>{:created_with=>"PaidMembersApp", :price_id=>"price_1JX6nYGkntF0z1iAS4TTHOjo", :button_id=>2, :payment_type=>"price", :app_site_id=>"app_1234567"}, :setup_future_usage=>"off_session"}, :billing_address_collection=>"auto", :metadata=>{:created_with=>"PaidMembersApp", :created_by=>"NewCheckout"}}

#

That's the session_hash we are passing in on that request.

#

Wouldn't we want to pass both:
A.) Price
B.) Image url
?

#

The response is that we cannot pass both. I wrote this morning and the Stripe team wasn't sure but thought if we pass a Price, that Stripe would just populate an image on your end. But seems to not work, so I am writing code to pass the image_url, But that seems to throw this error:

#

invalid_request_error - line_items[0][images]
You may only specify one of these parameters: images, price.

#

Thank you! We always have complex questions since we handle a lot of variable customers doing who have different ways of doing business.

thorn palm
#

I'm sorry it's really important that you try and clarify your asks in one go unfortunately

#

like this request is clearly using Checkout now

#

I'm sorry to be nitpicky, but it's hard to help with so much information at once and since you've been using Stripe for a while making sure we use the same vocabulary will really help here

#

But this request is a Checkout Session creation
the line_items param takes a price id to an existing Price which would have been configured already with all the right information (amount, description of the product, images, etc.)
You can not pass both price and images

#

when the Price was created, it needed to have the image set up with it at the time, you can't do an "override" to pass the image in that specific line item if that makes sense

#

Let me know if that doesn't make sense!

dusty juniper
#

1.) Will Stripe Checkout show a Product image if we pass in the price_id and the Price associated with that ID has a Product with an image?

thorn palm
#

Yes it will, but same comment as earlier: it'd take a really short amount of time to try this quickly yourself as the developer

dusty juniper
#

OK, it works.

#

OK, we just had to decide if we needed to do this on our end or not.

#

OK, thank you!~

thorn palm
#

Note that Checkout only shows one image but a product can have more than one

#

I know it confuses some devs, so as a platform dev it might confuse your end users

#

like they would add 3 images and only one would show

dusty juniper
#

OK, I can happily communicate that to our customers. Can they sort the order in the dashboard to force the one to be shown?

#

Like are you always pulling FIFO or LIFO?
(i.e. the first image uploaded or the last image uploaded). I will definitely get that question from customers so if I can tell them how to force an image to be shown, they will appreciate that answer.

thorn palm
#

It's an ordered array and we'd always show the first image in the array

#

I'm not sure which one it is from the Dashboard upload, you'd have to test!

dusty juniper
#

OK, thank you