Skip to content

Commit e384cb2

Browse files
authored
Fix webhook endpoints (#44)
* Fix webhook endpoints * Fix prefixed paths
1 parent cddb678 commit e384cb2

6 files changed

+13
-13
lines changed

src/Service/OrderService.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function create(Order &$order)
7777
*/
7878
public function close(Order &$order)
7979
{
80-
$endpoint= '/orders/'.$order->id.'/close.json';
80+
$endpoint = 'orders/'.$order->id.'/close.json';
8181
$response = $this->request($endpoint, 'POST');
8282
$order->setData($response['order']);
8383
}
@@ -91,7 +91,7 @@ public function close(Order &$order)
9191
*/
9292
public function open(Order &$order)
9393
{
94-
$endpoint= '/orders/'.$order->id.'/open.json';
94+
$endpoint = 'orders/'.$order->id.'/open.json';
9595
$response = $this->request($endpoint, 'POST');
9696
$order->setData($response['order']);
9797
}
@@ -105,7 +105,7 @@ public function open(Order &$order)
105105
*/
106106
public function cancel(Order &$order)
107107
{
108-
$endpoint= '/orders/'.$order->id.'/cancel.json';
108+
$endpoint = '/orders/'.$order->id.'/cancel.json';
109109
$response = $this->request($endpoint, 'POST');
110110
$order->setData($response['order']);
111111
}
@@ -120,7 +120,7 @@ public function cancel(Order &$order)
120120
public function update(Order &$order)
121121
{
122122
$data = $order->exportData();
123-
$endpoint= '/orders/'.$order->id.'.json';
123+
$endpoint = 'orders/'.$order->id.'.json';
124124
$response = $this->request(
125125
$endpoint, 'POST', array(
126126
'order' => $data
@@ -138,7 +138,7 @@ public function update(Order &$order)
138138
*/
139139
public function delete(Order &$order)
140140
{
141-
$endpoint= '/orders/'.$order->id.'.json';
141+
$endpoint = 'orders/'.$order->id.'.json';
142142
$this->request($endpoint, 'DELETE');
143143
return;
144144
}

src/Service/PageService.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function get($pageId, array $params = [])
5959
public function create(Page &$page)
6060
{
6161
$data = $page->exportData();
62-
$endpoint= '/pages.json';
62+
$endpoint = 'pages.json';
6363
$response = $this->request(
6464
$endpoint, 'POST', array(
6565
'page' => $data
@@ -78,7 +78,7 @@ public function create(Page &$page)
7878
public function update(Page &$page)
7979
{
8080
$data = $page->exportData();
81-
$endpoint= '/pages/'.$page->id.'.json';
81+
$endpoint = 'pages/'.$page->id.'.json';
8282
$response = $this->request(
8383
$endpoint, 'PUT', array(
8484
'page' => $data

src/Service/ProductImageService.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ProductImageService extends AbstractService
1616
*/
1717
public function all($productId, array $params = [])
1818
{
19-
$endpoint= '/products/'.$productId.'/images.json';
19+
$endpoint = 'products/'.$productId.'/images.json';
2020
$response = $this->request($endpoint, 'GET', $params);
2121
return $this->createCollection(ProductImage::class, $response['images']);
2222
}

src/Service/RecurringApplicationChargeService.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function create(RecurringApplicationCharge &$recurringApplicationCharge)
6363
*/
6464
public function delete(RecurringApplicationCharge $recurringApplicationCharge)
6565
{
66-
$endpoint= '/recurring_application_charges/'.$recurringApplicationCharge->id.'.json';
66+
$endpoint = 'recurring_application_charges/'.$recurringApplicationCharge->id.'.json';
6767
$this->request($endpoint, 'DELETE');
6868
return;
6969
}

src/Service/ScriptTagService.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function create(ScriptTag &$scriptTag)
6161
{
6262
$data = $scriptTag->exportData();
6363
$response = $this->request(
64-
'/script_tags.json', 'POST', array(
64+
'script_tags.json', 'POST', array(
6565
'script_tag' => $data
6666
)
6767
);
@@ -79,7 +79,7 @@ public function update(ScriptTag $scriptTag)
7979
{
8080
$data = $scriptTag->exportData();
8181
$response = $this->request(
82-
'/script_tags/'.$scriptTag->id.'.json', 'PUT', array(
82+
'script_tags/'.$scriptTag->id.'.json', 'PUT', array(
8383
'script_tag' => $data
8484
)
8585
);

src/Service/WebhookService.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function create(Webhook &$webhook)
6161
{
6262
$data = $webhook->exportData();
6363
$response = $this->request(
64-
'/webhooks.json', 'POST', array(
64+
'webhooks.json', 'POST', array(
6565
'webhook' => $data
6666
)
6767
);
@@ -79,7 +79,7 @@ public function update(Webhook $webhook)
7979
{
8080
$data = $webhook->exportData();
8181
$response = $this->request(
82-
'/webhooks/'.$webhook->id.'.json', 'PUT', array(
82+
'webhooks/'.$webhook->id.'.json', 'PUT', array(
8383
'webhook' => $data
8484
)
8585
);

0 commit comments

Comments
 (0)