I am able to do this for one item, but how would you generate this string for a list of items.
I tried to do it with :format as text - the issue here is that I can’t get the current items index number that needs to be passed into line_items[#] for each item.
Also the list in bubble starts with #1, I’m not sure if you can skip the #0 for line_items in Stripe API?
The cart is basically a list of cart items. and each item holds the name, price, image link etc.
in api connector, you will set the full part after ? dynamic like ?[urlparams]
Set arbitrary text and start your json: {“line_items”:[From your DB, you will get the list of items:format as json]
In the first box, you will set the payload for line in json (something like:
This is what you send to the plugin
This will return: line_items[0][price_data][currency]=This item's currency(dynamic)&line_items[0][price_data][product_data][name]=This product 's name(dynamic)&line_items[1][price_data][currency]=This item's currency(dynamic)&line_items[1][price_data][product_data][name]=This product 's name2(dynamic)
Advantage of the plugin is this will add the numbering index, something not possible actually with Bubble native function on list.
(I’ve used the example provided by the first message)
My approach is to generate this items list using the toolbox plugin. When the “buy” button is pressed the workflow run the 'Run Javascript" action, and that action generates the list of line items from the cart items.
I can provide you with the code i’m using later if you need it?