Skip to content

Commit c6e5068

Browse files
committed
Fixed Call to undefined method Shopify\Object\Fulfillment::getId()
1 parent 27f2e13 commit c6e5068

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Service/FulfillmentService.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ public function create($orderId, Fulfillment &$fulfillment)
4444
public function update($orderId, Fulfillment &$fulfillment)
4545
{
4646
$data = $fulfillment->exportData();
47-
$endpoint = 'orders/' . $orderId . '/fulfillments/' . $fulfillment->getId() . '.json';
47+
$endpoint = 'orders/' . $orderId . '/fulfillments/' . $fulfillment->id . '.json';
4848
$response = $this->request(
4949
$endpoint,
50-
'POST',
50+
'PUT',
5151
[
5252
'fulfillment' => $data
5353
]
@@ -57,21 +57,21 @@ public function update($orderId, Fulfillment &$fulfillment)
5757

5858
public function complete($orderId, Fulfillment &$fulfillment)
5959
{
60-
$endpoint = 'orders/' . $orderId . '/fulfillments/' . $fulfillment->getId() . '/complete.json';
60+
$endpoint = 'orders/' . $orderId . '/fulfillments/' . $fulfillment->id . '/complete.json';
6161
$response = $this->request($endpoint, 'POST');
6262
$fulfillment->setData($response['fulfillment']);
6363
}
6464

6565
public function cancel($orderId, Fulfillment &$fulfillment)
6666
{
67-
$endpoint = 'orders/' . $orderId . '/fulfillments/' . $fulfillment->getId() . '/cancel.json';
67+
$endpoint = 'orders/' . $orderId . '/fulfillments/' . $fulfillment->id . '/cancel.json';
6868
$response = $this->request($endpoint, 'POST');
6969
$fulfillment->setData($response['fulfillment']);
7070
}
7171

7272
public function open($orderId, Fulfillment &$fulfillment)
7373
{
74-
$endpoint = 'orders/' . $orderId . '/fulfillments/' . $fulfillment->getId() . '/open.json';
74+
$endpoint = 'orders/' . $orderId . '/fulfillments/' . $fulfillment->id . '/open.json';
7575
$response = $this->request($endpoint, 'POST');
7676
$fulfillment->setData($response->fulfillment);
7777
}

0 commit comments

Comments
 (0)