[New Plugin] Square Checkout - By Interwebb

Hi @zach8 thanks for moving the post over from the other thread :slight_smile:

If you only add 1 Catalog Id per line item object, this should fix your issue, for example, change ‘ZZPS5OQCHMFNPBG3IK7NZVV2, 63BDRR76WVKGUIS2Q3KZQVMG’ to only ‘ZZPS5OQCHMFNPBG3IK7NZVV2

and then a separate line item object will need to be created using the Create Catalog Line Item workflow action for ‘63BDRR76WVKGUIS2Q3KZQVMG’.

Here is the documentation, let me know if this solves your issue or if you need further assistance.

Thanks,

Phill

Hi Phill,

This seems to be contradictory to the documentation. The documentation suggests I can pass a list of text-based line items. Are you saying I can pass a list of text-based items, but I can’t pass a list of Product IDs?

Thanks.

Hi @zach8 , i’ll have a look at updating the documentation as I can understand if it’s not as clear as I’d hoped.

When you use the Create Catalog Line Item workflow action, it creates some text (a Line Item Object) used in the Create Order Payment Link workflow action to create the Square Order Checkout.

Line Item Object example:{"catalog_object_id":"RG5NSHJCVJKUP7AAIQ5LJP53","quantity":"2"}

Each Line Item Object is 1 product (using 1 Catalog ID) and its quantity in the checkout. For example, 1 line item could be: 3 x Pizza.

To add multiple line items to the checkout you need to use the Create Catalog Line Item workflow action to generate the Line Item Object for each product. You can then add these Line Item Objects to a List of texts in your app and add this list into the Create Order Payment Link workflow action’s Line Item’s List field.

For example, you would use the Create Catalog Line Item 3 times (once for each product) to generate your checkout line items as follows:

3 x Pizza
4 x T-Shirt
7 x Shoes

Here is the text list we use in our example:

image
image
image
image

In our example checkout, when you add an item to the basket it uses the Create Catalog Line Item workflow action and adds this to the BasketList as a new item in the list.

I hope this makes a bit more sense!

Thanks,

Phill

Hey @phill.dev thanks for your previous reply. I haven’t had an opportunity to work on it yet.

But I’m working on a site for a friend, I’m trying to implement the Square checkout, and I’m getting the following error trying to generate a payment link from a single catalog id:

Plugin action Square Checkout V2 - Create Order Payment Link error:
TypeError: Cannot read property ‘url’ of undefined
at eval (eval at build_function (/var/task/index.js:86:21), :101:53)
at /var/task/index.js:349:23
at run_fn (/var/task/u.js:594:18)

I checked the logs and that error is repeated in the logs.

Hi @zach8,

Thats great that you’re helping your friend with their site, thanks for chosing to use our plugin.

Try checking the plugin specific server logs and it shoupd have a more detailed error description.

Go to:

Bubble.io editor > Logs > Server Logs > Show Advanced > Select the Plugin Options Below > Search

Let me know if this helps solve your problem, if not please share the logs and we’ll do our best to help.

Thanks,

Phill

Hi Phill,

When I shared the image from my server logs earlier it was with the above parameters selected. I just went back and double-checked, and the error is indeed the same. Here is the log with the preceding step where the plugin successfully creates the order, and it seems to create the payment link. It seems like something goes wrong when Bubble tries to use the link in the workflow. Granted I have no idea really.

@phill.dev FWIW, I’m now having the same issue on my site. The quick payment link was working before, but now when I try to use it, it produces the same error that I was seeing on the other site.

Thanks for your help.

Hi @zach8 apologies for the slow response, I cannot see the plugin server side action output in your screenshot. If you share this error i’ll be able to help.

Could you also please let me know which API version you are using in the Square Developer Dashboard?

Thanks,

Phill

SALE!

For the rest of the month, the Square Online Checkout will be 50% off!

Check it out here.

Thanks!

Phill

One more day of our 50% off sale left!

We are also working on lots of new plugin features and improvements.

Thanks,

Phill

I see in my test that the checkout process is triggering webhooks

Webhooks Triggered: order.updated, payment.updated

However, I can’t figure out where in Bubble to listen for those webhooks.

Hi @brenton.strine,

You can set up a webhook subscription in the Square developer dashboard to send notifications to your Bubble app.

Square Webhooks Overview (squareup.com)

Webhooks - Square API Reference (squareup.com)

I hope that helps.

Thanks,

Phill

That is helpful, however I’m having a hard time finding in Square where I can put the private key. I don’t see anywhere in Square for that! In POSTMAN I can add a header with Authorization - Bearer <key>.

Error Handling Improvements

Hi everyone,

We’ve been continuing to improve the Square checkout plugin and have just released a minor change to improve the plugin’s error handling which was a pain point for many users.

If there is an error with the plugin, for example, an incorrect currency code, it will show in the app’s server logs as well as now highlight the error within the browser.

For example, for £ the currency code is GBP and not GB, so the plugin has thrown the following error in the browser:
image

I hope this will be useful for those using the Square Checkout plugin, please let us know if you encounter any issues.

Thanks,

Phill

Hi Phil
I am getting a different plugin error to the ones above. Any ideas what I might have done wrong?
I am on a dummy test page literally trying to send one quick payment into the gateway to try to work out how to make this work.
Richard
image


Thanks for highlighting this, we’ll get this fixed for you straight away - what version of the plugin are you using?

Can you please share the plugin server-side output? Feel free to send this over a private message.

Here are the instructions to view the plugins server side output Troubleshooting & Support - Interwebb.co.uk - Bubble.io Plugin Docs

Thanks,

Phill

Not sure what you mean by the server side output - the screenshot of the logged error is in the above screenshots too.

I could easily be doing something wrong too, I am new to square and new to this plugin.

sorry you gave me a link to follow… I’ll come back shortly

OK I had both production and non-production endpoints in my plugin settings, and one of them had an extra slash on the end of the endpoint https://endpointblah.com/ <---- that slash was bad.

Sandbox I think doesn’t like my production location so I’ll have to read up on that in the square docs.

I’m now getting a payment page.

Thanks for showing me the server output - I found what I needed from there.

Great that you spotted he endpoint issue - I’ll improve the error handling for this specific scenario.

Sandbox and Production are completely separate so you’ll need to use a sandbox location ID to test.

Thanks,

Phill