Skip to content

Commit

Permalink
Fix webhook endpoints (#44)
Browse files Browse the repository at this point in the history
* Fix webhook endpoints

* Fix prefixed paths
  • Loading branch information
robwittman authored May 10, 2020
1 parent cddb678 commit e384cb2
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions src/Service/OrderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function create(Order &$order)
*/
public function close(Order &$order)
{
$endpoint= '/orders/'.$order->id.'/close.json';
$endpoint = 'orders/'.$order->id.'/close.json';
$response = $this->request($endpoint, 'POST');
$order->setData($response['order']);
}
Expand All @@ -91,7 +91,7 @@ public function close(Order &$order)
*/
public function open(Order &$order)
{
$endpoint= '/orders/'.$order->id.'/open.json';
$endpoint = 'orders/'.$order->id.'/open.json';
$response = $this->request($endpoint, 'POST');
$order->setData($response['order']);
}
Expand All @@ -105,7 +105,7 @@ public function open(Order &$order)
*/
public function cancel(Order &$order)
{
$endpoint= '/orders/'.$order->id.'/cancel.json';
$endpoint = '/orders/'.$order->id.'/cancel.json';
$response = $this->request($endpoint, 'POST');
$order->setData($response['order']);
}
Expand All @@ -120,7 +120,7 @@ public function cancel(Order &$order)
public function update(Order &$order)
{
$data = $order->exportData();
$endpoint= '/orders/'.$order->id.'.json';
$endpoint = 'orders/'.$order->id.'.json';
$response = $this->request(
$endpoint, 'POST', array(
'order' => $data
Expand All @@ -138,7 +138,7 @@ public function update(Order &$order)
*/
public function delete(Order &$order)
{
$endpoint= '/orders/'.$order->id.'.json';
$endpoint = 'orders/'.$order->id.'.json';
$this->request($endpoint, 'DELETE');
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Service/PageService.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function get($pageId, array $params = [])
public function create(Page &$page)
{
$data = $page->exportData();
$endpoint= '/pages.json';
$endpoint = 'pages.json';
$response = $this->request(
$endpoint, 'POST', array(
'page' => $data
Expand All @@ -78,7 +78,7 @@ public function create(Page &$page)
public function update(Page &$page)
{
$data = $page->exportData();
$endpoint= '/pages/'.$page->id.'.json';
$endpoint = 'pages/'.$page->id.'.json';
$response = $this->request(
$endpoint, 'PUT', array(
'page' => $data
Expand Down
2 changes: 1 addition & 1 deletion src/Service/ProductImageService.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ProductImageService extends AbstractService
*/
public function all($productId, array $params = [])
{
$endpoint= '/products/'.$productId.'/images.json';
$endpoint = 'products/'.$productId.'/images.json';
$response = $this->request($endpoint, 'GET', $params);
return $this->createCollection(ProductImage::class, $response['images']);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Service/RecurringApplicationChargeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function create(RecurringApplicationCharge &$recurringApplicationCharge)
*/
public function delete(RecurringApplicationCharge $recurringApplicationCharge)
{
$endpoint= '/recurring_application_charges/'.$recurringApplicationCharge->id.'.json';
$endpoint = 'recurring_application_charges/'.$recurringApplicationCharge->id.'.json';
$this->request($endpoint, 'DELETE');
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Service/ScriptTagService.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function create(ScriptTag &$scriptTag)
{
$data = $scriptTag->exportData();
$response = $this->request(
'/script_tags.json', 'POST', array(
'script_tags.json', 'POST', array(
'script_tag' => $data
)
);
Expand All @@ -79,7 +79,7 @@ public function update(ScriptTag $scriptTag)
{
$data = $scriptTag->exportData();
$response = $this->request(
'/script_tags/'.$scriptTag->id.'.json', 'PUT', array(
'script_tags/'.$scriptTag->id.'.json', 'PUT', array(
'script_tag' => $data
)
);
Expand Down
4 changes: 2 additions & 2 deletions src/Service/WebhookService.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function create(Webhook &$webhook)
{
$data = $webhook->exportData();
$response = $this->request(
'/webhooks.json', 'POST', array(
'webhooks.json', 'POST', array(
'webhook' => $data
)
);
Expand All @@ -79,7 +79,7 @@ public function update(Webhook $webhook)
{
$data = $webhook->exportData();
$response = $this->request(
'/webhooks/'.$webhook->id.'.json', 'PUT', array(
'webhooks/'.$webhook->id.'.json', 'PUT', array(
'webhook' => $data
)
);
Expand Down

0 comments on commit e384cb2

Please sign in to comment.