Skip to content

Commit a2b5429

Browse files
committed
Custom actions update
1 parent 51c084f commit a2b5429

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

lib/GiftCard.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,18 @@ class GiftCard extends ShopifyAPI
3434
protected $searchEnabled = true;
3535

3636
/**
37-
* List of custom POST actions
38-
* @example: ['enable', 'disable', 'remove','default' => 'makeDefault']
39-
* Methods can be called like enable(), disable(), remove(), makeDefault() etc.
40-
* If any array item has an associative key => value pair, value will be considered as the method name and key will be the associated path to be used with the action.
37+
* Disable a gift card.
38+
* Disabling a gift card is permanent and cannot be undone.
4139
*
42-
* @var array
40+
* @return array
4341
*/
44-
protected $customPostActions = array(
45-
'disable',
46-
);
42+
public function disable() {
43+
$url = $this->generateUrl(array(), 'disable');
44+
45+
$dataArray = array(
46+
'id' => $this->id,
47+
);
48+
49+
return $this->post($dataArray, $url);
50+
}
4751
}

lib/RecurringApplicationCharge.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ class RecurringApplicationCharge extends ShopifyAPI
6565
* @return array
6666
*
6767
*/
68-
public function customize($data) {
69-
$data = $this->wrapData($data);
68+
public function customize($dataArray) {
69+
$dataArray = $this->wrapData($dataArray);
7070

71-
$url = $this->generateUrl($data, 'customize');
71+
$url = $this->generateUrl($dataArray, 'customize');
7272

7373
return $this->put(array(), $url);
7474
}

0 commit comments

Comments
 (0)