question

Loyal Loops avatar image
Loyal Loops asked Loyal Loops commented

No webhook triggered for sandbox orders, payments and inventory events

Hi,

We have an app running in the android emulator, in the sandbox, and a webhook configured on this app. Both the app and the webhook have full permissions:

Webhook Events: Apps, Customers, Inventory, Orders, Payments, Merchants 

Clover Permission Set:

Read and modify your Customers data
Read and modify your Employees data
Read and modify your Inventory data
Read and modify your Merchant data
Read and modify your Orders data
Read and modify your Payments data
Process your customers' credit cards.

The webhook is verified and actually works for customers - if I create a customer via the android app (Customers), I get the webhook event. However I don't get any event for orders, payments and inventory changes made via the android app (Register and Inventory). I tested a curl call to the REST API to create an order, and I do get a webhook call in that case:

curl -X POST https://apisandbox.dev.clover.com/v3/merchants/xxxx/orders --header "Authorization:Bearer xxxx"

Any idea what may be wrong? It would help a lot in testing our webhooks if it could work via the android emulator as it does for customers.

Thanks, Martin

15 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Loyal Loops avatar image Loyal Loops commented ·

To add to this, orders I create via the REST API show up in the Android emulator in the Orders app (once the order's state has been updated to "open"), but orders created via Android that show up in the Orders app are not returned by the "get orders" REST API.

0 Likes 0 ·
Mike M avatar image Mike M commented ·

Can you please verify that your Network Queue has a size of zero when these issues are manifesting? It being non-zero would signify that your modifications via the Clover device have not yet synced to the server and thus wouldn't show up when queried via the REST API.

You can check the queue via the Help app -> Diagnostics -> Network Queue size.

0 Likes 0 ·
Loyal Loops avatar image Loyal Loops commented ·

Hey Mike, indeed the network queue had 904 items. I went into the network queue screen and it started processing them, and now that it's done it's working correctly, without going to the queue. Any idea what may have caused that? In any case, from my perspective the problem is now fixed, thanks.

0 Likes 0 ·
Loyal Loops avatar image Loyal Loops commented ·

It's back to not working this morning. My network queue has 16 items, and going into the network queue screen shortly changes the first item's status to "Processing", and quickly gets back to "In Queue". Any suggestions on what I could do to make it work again, and why this is happening? Network is fine as it works for customers webhooks (tried again just now).

0 Likes 0 ·
Mike M avatar image Mike M commented ·

Customer changes are a bit different from orders and payments, for which changes need to be synchronously POSTed to prevent any race conditions (such as paying for an order before the lineItems are able to be applied).

When you said that it works for customers, that was making changes to a customer via the Clover device, correct? Just want to clarify since any network issues should affect the entire device holistically. Please let me know.

0 Likes 0 ·
Show more comments

1 Answer

Loyal Loops avatar image
Loyal Loops answered Loyal Loops commented

Hey Mike,

I decided to try the "vanilla" emulator with a merchant that has only the base Clover apps installed this morning, and I have the issue. I started the emulator and entered 2 paid orders (second one voided), then went into the Diagnostics and saw the 14 elements in the network queue. I replied with an answer instead of a comment so I can upload some screenshots. Note that in the past, I had this issue happen later on (i.e. not right after the emulator startup).

This merchant doesn't have our app (or any non-default app) installed.

EDIT: actually I can't upload anything because I don't have 10 points yet. Give me an email address if you want me to send the screenshots.

Thanks, Martin

12 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Mike M avatar image Mike M commented ·

Ok, so we have identified that no matter how many emulators or merchants you create, you keep running into this network connectivity issue.

Do you have a devkit by chance? If so, does it also experience this issue?

Until we hear from really anyone else, you are still the only person running into this; so I'm finding it hard to reason that this is completely the server at fault. Can you please verify any network configs or firewall/port settings you may have?

Another way to debug further is to setup a proxy with your emulator so you can snoop/inspect the network requests that are hanging.

0 Likes 0 ·
Loyal Loops avatar image Loyal Loops commented ·

I don't have a devkit, but someone on our team does, he may be able to run some tests and see if he hits that issue. It seems like it's not the first time it happens, see http://devask.clover.com/question/106... and http://devask.clover.com/question/404... and http://devask.clover.com/question/206... which has little comments but tons of views so devs seem to be looking for that. Even if it was my network, it should process the queue eventually and new emulators wouldn't work either.

0 Likes 0 ·
Loyal Loops avatar image Loyal Loops commented ·

Another way to debug further is to setup a proxy with your emulator so you can snoop/inspect the network requests that are hanging.

Any details on how we could do this?

0 Likes 0 ·
Loyal Loops avatar image Loyal Loops commented ·

So the other person is running tests on the devkit, no errors so far, but on his emulator, he's got the network queue issue too (using different networks, we're in different countries, not in the same office).

0 Likes 0 ·
Mike M avatar image Mike M commented ·

I've used charles proxy in the past to listen in on my emulator traffic, however I'm sure there are multiple options out there. http://www.srooltheknife.com/2014/03/...

Could please see what http requests are failing or see if there are any errors being thrown in logcat?

0 Likes 0 ·
Show more comments

Welcome to the
Clover Developer Community