#legend-checkout-lineitems

1 messages · Page 1 of 1 (latest)

dense tree
#

hello, mind sharing the req_123 Request ID you got back in that error msg? can look it up

marsh solar
#

sure didnt know if I should keep it anon

#

Request req_yYkFElp8cu53Im

dense tree
#

ah move currency param into the price_data hash

right now it is outside the price_data hash

#

since you're specifying price_data you need all its required params inside that hash

marsh solar
#

I'll try that now

marsh solar
#

InvalidRequestError: Request req_s6mhrhimVfH7J1: Received unknown parameter: line_items[0][price_d
ata][quantity]

#

after moving currency into price_data

dense tree
#

quantity isn't a param in price_data so you have to move that out

see the API ref

think of it this way, you're specifying a dynamic Price via price_data and then defining what quantity of that Price is being purchased, outside of price_data but inside an array in line_items

marsh solar
#

Ok. It's actually working! Thank you. I need to get a lot better at reading/using docs.
My final question (for now) is actually the same issue I was having before. Following the guide, I was returning redirect(session.url, code=303) in my flask route, but I get

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://checkout.stripe.com/pay/cs_test_a1qcu0tiY2QKSIFVxxgjedYwfA9iJHPW9yLRd6V8etV5XMa91Lrqqk0Tp4#fidkdWxOYHwnPyd1blpxYHZxWlFcampIVGRwc2FAQXQwMUtsUXVtT

I trigger this checkout route as a post ajax in my clientside code.
One of the other devs was saying I need instead of this redirect to use clientside code after the ajax post to send them to the stripe URL? Could you help me understand what the issue is, what that solution means, and how I might implement it?

dense tree
#

ah CORS isn't my strongest suite but what I would do instead of doing a
redirect(session.url, code=303)

is to return the CheckoutSession URL to your client-side, then on your webpage, just do a redirect there like

marsh solar
#

I'll attempt that now