Start a new topic

Webhooks are not working

We found a strange bug when adding webhooks for application.

We have following code to add necessary webhooks:

 

$events = array('place_order', 'order_status', 'update_user');

foreach($events as $event) {
    $res = $merchium->createRequest('webhooks', array(
        'event' => $event,
        'url' => fn_url("merchium_asms.process_event?event=" . $event)
    ));
}

 in res we receive webhook id, but, on Information page on webhooks page there's no webhooks list, also requests are not sent on this events (we checked Merchium logs at "Administration" dropdown). If we are doing something wrong, can you direct us where we mistaken? P.S. webhooks are checked at application permissions

Guys, any response?

Hi!


>  in res we receive webhook id, but, on Information page on webhooks page there's no webhooks list,


You can see all active webhooks on a separate page in the Administration menu. In your dev store it's on https://store-7dkr.mymerchium.ru/admin/?dispatch=webhooks.manage


You're doing everything correctly, and webhooks are added, and we can see them.


> also requests are not sent on this events (we checked Merchium logs at "Administration" dropdown).


We've tested webhook sending from your store, and it seems to work just fine. You won't see the webhook logs in the Administration dropdown, because webhooks are sent via a separate mechanism based on RabbitMQ. This mechanism ensures that webhooks don't slow down the store. The webhook is triggered immediately, but it can take a few seconds to actually send it.

>  If we are doing something wrong, can you direct us where we mistaken? P.S. webhooks are checked at application permissions


You're doing everything correctly, keep up the great job!


P.S. As far as we can see, you're using CS-Cart as a server. To decode the webhook payload on the CS-Cart side, use this code: json_decode(file_get_contents('php://input'), true);


BTW, you can contact our developers in Russian at https://help.merchium.ru.

Thanks a lot!


Login or Signup to post a comment