Your example is missing a crucial file

I’m new to the square api and it seems like all examples show one set of code snippets but whenever you click on the “get the code here” link it inevitably takes you to this example…

Which would be okay if it worked but it’s looking for this on line 26
const paymentResponse = await fetch(‘/payment’, {
method: ‘POST’,

and I’m not finding that file anywhere. Does anyone have that file in preferably php or any kind of point in the right direction.

:wave: The /payment function is in the server.js file of the quickstart. That’s where the tokenized card that the form generates is posting the source_id to. :slightly_smiling_face:

Thanks for this. Like I said, I was linked there from a bunch of various tutorials and examples I didn’t realize it was node. I thought it worked like stripe and was vanilla javascript.

Glad to hear you got it to work as expected. :slightly_smiling_face: