From 82adae1eafae53778db87c7e372c3d164c1b444e Mon Sep 17 00:00:00 2001 From: duncanjamesmay Date: Fri, 29 Sep 2023 11:03:43 -0700 Subject: [PATCH] Create CancellationRequest to support handling cancellation requests Adding support Cancellation requests. Copied the same format of FulfillmentRequest just added different key. --- lib/CancellationRequest.php | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 lib/CancellationRequest.php diff --git a/lib/CancellationRequest.php b/lib/CancellationRequest.php new file mode 100644 index 0000000..9d6dc69 --- /dev/null +++ b/lib/CancellationRequest.php @@ -0,0 +1,44 @@ + Child Resources + * -------------------------------------------------------------------------- + * + * -------------------------------------------------------------------------- + * CancellationRequest -> Custom actions + * -------------------------------------------------------------------------- + * @method array accept() Accept a fulfilment order + * @method array reject() Rejects a fulfillment order + */ +class CancellationRequest extends ShopifyResource +{ + /** + * @inheritDoc + */ + protected $resourceKey = 'cancellation_request'; + + /** + * @inheritDoc + */ + public $countEnabled = false; + + /** + * @inheritDoc + */ + protected $customPostActions = array( + 'accept', + 'reject' + ); + + protected function pluralizeKey() + { + return $this->resourceKey; + } +}