Skip to content

Commit f5f4fe4

Browse files
authored
Merge pull request #297 from Shopify/melaniew/custom-json-body-names-to-array
getJsonResponseBodyName is now an array
2 parents d368eef + 0ef5a22 commit f5f4fe4

18 files changed

Lines changed: 163 additions & 38 deletions

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

88
## Unreleased
99

10+
- [#297](https://github.com/Shopify/shopify-api-php/pull/297) [Patch] Fix CustomerAddress methods, FulfillmentRequest save method
11+
1012
## v5.1.0 - 2023-07-11
1113

1214
- [#285](https://github.com/Shopify/shopify-api-php/pull/285) [Minor] Adding support for 2023-07 API version

src/Rest/Admin2022_10/AssignedFulfillmentOrder.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ class AssignedFulfillmentOrder extends Base
3333
/**
3434
3535
*
36-
* @return string
36+
* @return string[]
3737
*/
38-
protected static function getJsonResponseBodyName(): string
38+
protected static function getJsonResponseBodyNames(): array
3939
{
40-
return "fulfillment_order";
40+
return [
41+
"fulfillment_order"
42+
];
4143
}
4244

4345
/**

src/Rest/Admin2022_10/CustomerAddress.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ protected static function getJsonBodyName(): string
5454
return "address";
5555
}
5656

57+
/**
58+
59+
*
60+
* @return string[]
61+
*/
62+
protected static function getJsonResponseBodyNames(): array
63+
{
64+
return [
65+
"customer_address",
66+
"address"
67+
];
68+
}
69+
5770
/**
5871
* @param Session $session
5972
* @param int|string $id

src/Rest/Admin2022_10/FulfillmentRequest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@ class FulfillmentRequest extends Base
2525
["http_method" => "post", "operation" => "reject", "ids" => ["fulfillment_order_id"], "path" => "fulfillment_orders/<fulfillment_order_id>/fulfillment_request/reject.json"]
2626
];
2727

28+
/**
29+
30+
*
31+
* @return string[]
32+
*/
33+
protected static function getJsonResponseBodyNames(): array
34+
{
35+
return [
36+
"submitted_fulfillment_order",
37+
"fulfillment_order"
38+
];
39+
}
40+
2841
/**
2942
* @param mixed[] $params Allowed indexes:
3043
* message

src/Rest/Admin2022_10/OrderRisk.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ protected static function getJsonBodyName(): string
4949
/**
5050
5151
*
52-
* @return string
52+
* @return string[]
5353
*/
54-
protected static function getJsonResponseBodyName(): string
54+
protected static function getJsonResponseBodyNames(): array
5555
{
56-
return "risk";
56+
return [
57+
"risk"
58+
];
5759
}
5860

5961
/**

src/Rest/Admin2023_01/AssignedFulfillmentOrder.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ class AssignedFulfillmentOrder extends Base
3333
/**
3434
3535
*
36-
* @return string
36+
* @return string[]
3737
*/
38-
protected static function getJsonResponseBodyName(): string
38+
protected static function getJsonResponseBodyNames(): array
3939
{
40-
return "fulfillment_order";
40+
return [
41+
"fulfillment_order"
42+
];
4143
}
4244

4345
/**

src/Rest/Admin2023_01/CustomerAddress.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ protected static function getJsonBodyName(): string
5454
return "address";
5555
}
5656

57+
/**
58+
59+
*
60+
* @return string[]
61+
*/
62+
protected static function getJsonResponseBodyNames(): array
63+
{
64+
return [
65+
"customer_address",
66+
"address"
67+
];
68+
}
69+
5770
/**
5871
* @param Session $session
5972
* @param int|string $id

src/Rest/Admin2023_01/FulfillmentRequest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@ class FulfillmentRequest extends Base
2525
["http_method" => "post", "operation" => "reject", "ids" => ["fulfillment_order_id"], "path" => "fulfillment_orders/<fulfillment_order_id>/fulfillment_request/reject.json"]
2626
];
2727

28+
/**
29+
30+
*
31+
* @return string[]
32+
*/
33+
protected static function getJsonResponseBodyNames(): array
34+
{
35+
return [
36+
"submitted_fulfillment_order",
37+
"fulfillment_order"
38+
];
39+
}
40+
2841
/**
2942
* @param mixed[] $params Allowed indexes:
3043
* message

src/Rest/Admin2023_01/OrderRisk.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ protected static function getJsonBodyName(): string
4949
/**
5050
5151
*
52-
* @return string
52+
* @return string[]
5353
*/
54-
protected static function getJsonResponseBodyName(): string
54+
protected static function getJsonResponseBodyNames(): array
5555
{
56-
return "risk";
56+
return [
57+
"risk"
58+
];
5759
}
5860

5961
/**

src/Rest/Admin2023_04/AssignedFulfillmentOrder.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ class AssignedFulfillmentOrder extends Base
3333
/**
3434
3535
*
36-
* @return string
36+
* @return string[]
3737
*/
38-
protected static function getJsonResponseBodyName(): string
38+
protected static function getJsonResponseBodyNames(): array
3939
{
40-
return "fulfillment_order";
40+
return [
41+
"fulfillment_order"
42+
];
4143
}
4244

4345
/**

0 commit comments

Comments
 (0)