Stripe Checkout Tutorial

That is exactly what I did and I got this back:
{“error”:{“message”:“Invalid object”,“param”:“shipping_address_collection”,“type”:“invalid_request_error”}}

I wonder if something is not updating in Wappler. I use docker and digitalocean and sometimes I think things don’t get uploaded. I am able to get the Business address to show up so maybe I can use that to get the address to send the product. I make dog treats for a business hobby and most of my sales are local at the farmers market but I have some customers who want to order online during the winter. I appreciate your help. I am a Design Professor by trade and even visual programming has been a bit difficult for me at times but I do find it challenging.

1 Like

I wanted to update this response I received from Stripe in case it could help someone else:

take note that shipping_address_collection[allowed_countries] is an array and in curl command, you will need to pass the array using the syntax like following

-d “shipping_address_collection[allowed_countries][0]”=CA
-d “shipping_address_collection[allowed_countries][1]”=US \

take note of the [0] and [1] where are the array index indication.

2 Likes

I am not clear on this part I have Highlighted. I think I have the ‘insOrder’ insert figured out. I do successfully insert into my order table.

And I assume I get the ‘totalPrice’ query from the repeat step? But I need help with that repeat step. What does that query look like?

Screen Shot 2020-09-03 at 3.21.22 PM

And where does the {{_POST record}} come from?

Looks like you have your whole check out cart in a form? Can you explain a bit about dmx-bind:name attributes?

Ok, I figured out where you get the $_POST record from … but how do you get the variables in there?

I’m trying!

Check this post, shows the snippet needed to get the cart contents to your server action.

Ok, I understand what this endpoint is suppose to do but what are the variables for? (id, created, type)

And can this webhook be taken one step further and add an email step to send a confirmation to user and admin?

Technically you don’t need them, they’re usable if you wanted to store it for an audit trail or if you needed to compare values

1 Like

Having trouble with the webhook endpoint. The endpoint/webhook is successful

But the data is. not being updated in my database. Here is my action post objects, is this right?

This did indeed prevent the webhook from succeeding for me.

I’m getting this error when clicking on fetch, can anyone have any idea about this error?

You need a value in the idempotent field. I set this to a hash of the current time just so it’s random like this:

Idempotency-Key
{{NOW_UTC.sha1('saltvalue')}}

This is set in the headers of your Stripe API action.

2 Likes

I’m getting this error when sending test webhook to my website. I have used url of my index page

It needs to be set to your endpoint (webhook) url/server action file instead of your index page.

1 Like

Have tried that too but not resolved

I’m using dataAPI in my bubble app and willing to insert data in bubble app database from wappler app. I have made a simple table with 2 attributes name and age. Now when I try to insert data it gives me this error.
When I use url: myappurl?name=anyname&age=anyage, it inserts the data correctly. But if I put name and age in “input data” it throughs this error. Any suggestion ?

image

I haven’t checked this box in bubble settings>API section that’s why getting that error

I managed to work myself through this tutorial and through I had it all figured out but then I realized that when I put two items in my datastore cart and went through to checkout only the first line item was showing in the Stripe Checkout page. I checked the database and the table I was using contained two entries for the two items I had entered into the cart so I am not getting the array that contains all the items back into the API from my database. I am using the price feature on stripe so here is the value from the api name : value fields: Name–> line_items[0][price] Value–> {{record_repeat[0].priceID}}

Here is the log file from Stipe that shows what is being passed:

Any suggestions or readings would be appreciated. I have been working on this for a week with no progress.

thank you

Does anyone have a suggestion regarding this issue or where[quote=“dmbe11, post:47, topic:21518, full:true”]
I managed to work myself through this tutorial and through I had it all figured out but then I realized that when I put two items in my datastore cart and went through to checkout only the first line item was showing in the Stripe Checkout page. I checked the database and the table I was using contained two entries for the two items I had entered into the cart so I am not getting the array that contains all the items back into the API from my database. I am using the price feature on stripe so here is the value from the api name : value fields: Name–> line_items[0][price] Value–> {{record_repeat[0].priceID}}

Here is the log file from Stipe that shows what is being passed:

Any suggestions or readings would be appreciated. I have been working on this for a week with no progress.

thank you
[/quote]

to go to find an answer?

The tutorial shows how to send a single line item. You’d need to send Stripe your line items as an array which would look something like line_items[0], line_items[1], line_items[2] etc…