WC_Shipping_Shipcloud_Webhook
in package
Table of Contents
- $api : mixed
- __construct() : void
- Constructor.
- process_webhook_call() : void
- Processing shipcloud webhook calls
- add_admin_notice() : void
- Output an admin notice.
- delete_shipment_from_database() : void
- Delete shipment data from database.
- get_tracking_event() : array<string|int, mixed>|bool
- Extract matching tracking event from shipment.
- log() : void
- Output a debug message.
- process_all_event() : void
- Processes a not related event notified via webhook.
- process_shipment_event() : void
- Processes a shipment event notified via webhook.
Properties
$api
private
mixed
$api
Methods
__construct()
Constructor.
public
__construct() : void
Return values
void —process_webhook_call()
Processing shipcloud webhook calls
public
process_webhook_call() : void
Return values
void —add_admin_notice()
Output an admin notice.
private
add_admin_notice(string $message[, string $type = 'info' ][, bool $dismissible = true ]) : void
Parameters
- $message : string
-
Debug message.
- $type : string = 'info'
-
Message type.
- $dismissible : bool = true
-
Message type.
Return values
void —delete_shipment_from_database()
Delete shipment data from database.
private
delete_shipment_from_database(string $order_id, string $shipment_id, string $event) : void
Parameters
- $order_id : string
-
The order ID.
- $shipment_id : string
-
The shipment ID.
- $event : string
-
The fired event.
Return values
void —get_tracking_event()
Extract matching tracking event from shipment.
private
get_tracking_event(array<string|int, mixed> $shipment, string $timestamp) : array<string|int, mixed>|bool
Parameters
- $shipment : array<string|int, mixed>
-
The shipment.
- $timestamp : string
-
The timestamp to match.
Return values
array<string|int, mixed>|bool —log()
Output a debug message.
private
log(string $message[, string $level = 'info' ][, mixed $context = [] ]) : void
Parameters
- $message : string
-
Debug message.
- $level : string = 'info'
-
Debug level.
- $context : mixed = []
-
The Debug context.
Return values
void —process_all_event()
Processes a not related event notified via webhook.
private
process_all_event(object $event) : void
Parameters
- $event : object
-
The webhook event.
Return values
void —process_shipment_event()
Processes a shipment event notified via webhook.
private
process_shipment_event(object $event) : void
Parameters
- $event : object
-
The webhook event.
