-
Notifications
You must be signed in to change notification settings - Fork 212
/
Copy pathGiftCard.php
55 lines (47 loc) · 1.16 KB
/
GiftCard.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* Created by PhpStorm.
* @author Tareq Mahmood <tareqtms@yahoo.com>
* Created at 8/19/16 5:35 PM UTC+06:00
*
* @see https://help.shopify.com/api/reference/gift_card Shopify API Reference for GiftCard
*/
namespace PHPShopify;
/**
* --------------------------------------------------------------------------
* GiftCard -> Custom actions
* --------------------------------------------------------------------------
* @method array search() Search for gift cards matching supplied query
*
*/
class GiftCard extends ShopifyResource
{
/**
* @inheritDoc
*/
protected $resourceKey = 'gift_card';
/**
* @inheritDoc
*/
public $searchEnabled = true;
/**
* Disable a gift card.
* Disabling a gift card is permanent and cannot be undone.
*
* @return array
*/
public function disable()
{
$url = $this->generateUrl(array(), 'disable');
$dataArray = array(
'id' => $this->id,
);
return $this->post($dataArray, $url);
}
/**
* @inheritDoc
*/
protected $childResource = array(
'GiftCardAdjustment' => 'Adjustment'
);
}