Commit Graph

107 Commits

Author SHA1 Message Date
Claudio Sanches d48f1d4e2e Fixed package tag usage 2020-08-05 13:36:24 -03:00
Peter Fabian 5ba2cdafa5
Merge pull request #25183 from om4james/webhook-de-duplication
Fix for Duplicate Webhook deliveries
2020-02-05 18:38:15 +01:00
Christopher Allford 1d1413b4ee Replaced direct access of many constants with the Constants library 2020-01-31 22:18:47 -08:00
Christopher Allford 6ad091a9b7 Changed all of the constant accesses into corresponding Automattic\Jetpack\Constants usages 2020-01-28 21:21:29 -08:00
James Collins b262ac8e53 Fix for duplicate webhook deliveries 2019-12-06 09:54:24 +08:00
Daniël van der Linden 0c885b8c24
Fix typo webhopk -> webhook in WC_Webhook 2019-08-20 08:43:50 +02:00
Mike Jolley 833ad116c6 Update webhooks 2019-06-21 13:59:32 +01:00
Rodrigo Primo 0785f2b72a Bump default WC API version used when creating webhook
This commit bumps the default WC API version used when users are creating a new webhook. Before this change the default version would be v2, and after this change it is v3 which is the latest API version.

In the future we might want to create a method in WC_API class or somewhere else that returns the latest WC API version and use it in `includes/class-wc-webhook.php` instead of hard-coding the version number.
2019-04-25 11:41:31 -03:00
Gerhard 53cabdf5fe Include check for order type args when checking if webhook is valid resource. 2019-04-23 10:43:49 +02:00
Mike Jolley 588b5903f7 Ignore old pre-crud actions 2019-02-13 17:55:47 +00:00
Mike Jolley 311449e943 Create is_valid_resource method to check for invalid statuses 2019-02-13 16:46:49 +00:00
Mike Jolley cf0e9f925c Refactor should_deliver logic into managable chunks 2019-02-13 16:20:09 +00:00
Mike Jolley 1451f6101d
Merge pull request #22721 from woocommerce/fix/webhooks-payload
Load REST API endpoints before generate webhook payload
2019-02-13 13:59:55 +00:00
Claudio Sanches 00651bbc76 Fix special chars on webhook secret
By default some values are encoded before saved into the database, so it's required to decode those chars before generate the webhook signature.

Fixes #22500
2019-02-12 16:21:29 -02:00
Claudio Sanches 2f13a048d9 Load REST API endpoints before generate webhook payload 2019-02-12 16:08:03 -02:00
Mike Jolley 57ae0bec9d
Merge pull request #22073 from bekarice/fix/partial-refund-webhooks
Send webhooks for partial refund creation
2019-01-23 13:02:44 +00:00
Mike Jolley 6367d19615 phpcs 2019-01-21 08:11:40 -08:00
Rodrigo Primo 3b3da24546 Fix typo in inline comment 2019-01-10 16:38:58 -02:00
Rodrigo Primo c2b49dc6e3 fix phpcs violation 2019-01-10 16:38:26 -02:00
Beka Rice e64c5e1077 Send webhooks for refund creation 2018-11-28 13:32:36 -05:00
Gerhard 77309a86c3 When dynamic choosing API class, the comparison should be !== as the lastest version has no v3 in the class name. 2018-11-15 11:15:42 +02:00
claudiulodro 0fa1448cfe Topic blacklist 2018-11-02 10:21:30 -07:00
Claudio Sanches f765b47cbf Make easy to register new REST API versions into webhooks
Closes #21697
2018-10-29 19:31:47 -03:00
JD 0871ad8627
Update class-wc-webhook.php 2018-10-03 21:38:53 +01:00
JD b0b2b34884
Avoid treating HTTP 301 and 302 Codes as Failures
As per:

https://github.com/woocommerce/woocommerce/issues/21490

Change the definition of a Webhook Delivery Failure to exclude HTTP/301 and HTTP/302 responses. This allows webhook handlers (such as Google Apps Script) to avoid breaching failure limits and disabling webhooks.
2018-10-03 16:40:49 +01:00
Mike Jolley 59866b679c Do not log body for webhooks unless debug mode is turned on. 2018-04-30 16:24:23 +01:00
Claudio Sanches 7f5e5a3ca4 Short ABSPATH check in includes/class-wc-webhook.php 2018-03-21 00:22:04 -03:00
Claudio Sanches 16f3858472 Fixed "end if" comment 2018-03-19 20:22:39 -03:00
Rodrigo Primo c2c1501acc PHPCS fixes in includes/class-wc-webhook.php 2018-03-13 08:35:25 -03:00
Mike Jolley 8631e981e1
Merge pull request #17987 from woocommerce/feature/12439-process-delivery-hook
Introduces woocommerce_webhook_process_delivery hook
2017-12-04 13:08:42 +00:00
Claudiu Lodromanean 19969636f3
Merge pull request #17985 from woocommerce/refactor/12439-improve-duration
Improve webhook delivery duration
2017-12-01 14:33:49 -08:00
Claudiu Lodromanean 6b8b93d66c
Merge pull request #17984 from woocommerce/refactor/12439-falied-delivery
Updated webhook failed delivery code and introduced new hook
2017-12-01 10:28:25 -08:00
Claudiu Lodromanean 1a2a332f54
Merge pull request #17939 from woocommerce/feature/17734
Apply Webhooks CRUD into REST API
2017-12-01 10:07:21 -08:00
Claudio Sanches b1fd3134c3 Introduces woocommerce_webhook_process_delivery hook 2017-12-01 14:33:30 -02:00
Claudio Sanches d6f54afbe5 Improve webhook delivery duration
Improved to conside the amount of time spent gathering all data and time sending request.

Closes #17010
2017-12-01 13:48:31 -02:00
Claudio Sanches 022f9a10a3 Updated webhook failed delivery code and introduced new hook 2017-12-01 12:08:13 -02:00
Claudio Sanches 01b3f2bac4 Trigger webhook when delivery URL is changed 2017-11-30 16:48:16 -02:00
Claudio Sanches 4d9203b841 Soft deprecated webhook deliveries REST API endpoints 2017-11-30 16:20:20 -02:00
Claudio Sanches 9b5d5b684b Fixed coding standards 2017-11-30 16:05:36 -02:00
Gerhard Potgieter 1e887c5afa Add deprecated param to docbloc 2017-11-20 08:13:55 +02:00
Gerhard Potgieter 0360801994 Add deprecated param to deprecated functions, use wc_print_r instead of print_r, PHPCS fix 2017-11-20 08:11:10 +02:00
Gerhard Potgieter ba451f68e4 Remove unused filter and deprecate get_delivery_log function. 2017-11-17 14:43:44 +02:00
Gerhard Potgieter 2ec3e5d045 Return url when requesting logs 2017-11-17 09:41:14 +02:00
Gerhard Potgieter 3adb2d8fce Use this as class reference, use info method for logging, use consistant log filename. 2017-11-17 09:03:32 +02:00
Gerhard Potgieter b11ab6d8d6 Convert comments to wc_logger logging, remove and deprecate unused functions and introduce a wc_get_log_file_name helper function. Still a couple of todos left regarding deprecating or removing filters related to comments. 2017-11-10 12:20:59 +02:00
Gerhard Potgieter e61160fabe PHPCS fixes for class-wc-webhook.php 2017-11-08 14:46:23 +02:00
Claudio Sanches b93a9732df Fixed validation of set_status and set_topic 2017-08-17 18:36:42 -03:00
Claudio Sanches 568aae5e0f Validate webhook topic before set 2017-08-17 17:57:09 -03:00
Claudio Sanches bf674bce6e Validate webhook status 2017-08-17 17:54:31 -03:00
Claudio Sanches d02a7655fd Allow numeric api version on Webhook CRUD 2017-08-17 12:18:32 -03:00