Skip to content

Commit 1452794

Browse files
committed
Custom actions for Order
1 parent 1ca5963 commit 1452794

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,14 @@ The custom methods are specific to some resources which may not be available for
365365
Disable a gift card.
366366
- [search()](https://help.shopify.com/api/reference/gift_card#search)
367367
Search for gift cards matching supplied query
368+
369+
- Order ->
370+
- [close()](https://help.shopify.com/api/reference/order#close)
371+
Close an Order
372+
- [open()](https://help.shopify.com/api/reference/order#open)
373+
Re-open a closed Order
374+
- [cancel($data)](https://help.shopify.com/api/reference/order#cancel)
375+
Cancel an Order
368376

369377
- Order -> Refund ->
370378
- [calculate()](https://help.shopify.com/api/reference/refund#calculate)

lib/Order.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@
2929
* @method ShopifyResource Event(integer $id = null)
3030
* @method ShopifyResource Metafield(integer $id = null)
3131
*
32+
* --------------------------------------------------------------------------
33+
* Order -> Custom actions
34+
* --------------------------------------------------------------------------
35+
* @method array close() Close an Order
36+
* @method array open() Re-open a closed Order
37+
* @method array cancel($data) Cancel an Order
38+
*
3239
*/
3340
class Order extends ShopifyResource
3441
{
@@ -48,4 +55,13 @@ class Order extends ShopifyResource
4855
'Event',
4956
'Metafield',
5057
);
58+
59+
/**
60+
* @inheritDoc
61+
*/
62+
protected $customPostActions = array(
63+
'close',
64+
'open',
65+
'cancel',
66+
);
5167
}

0 commit comments

Comments
 (0)