Skip to content

Commit 170bc1e

Browse files
committed
Fix unspecified properties in resource classes
Fix mistake in metafields response data aligent#201
1 parent 1e71e40 commit 170bc1e

File tree

9 files changed

+124
-12
lines changed

9 files changed

+124
-12
lines changed

src/BigCommerce/ResourceModels/Catalog/Product/Product.php

+2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ class Product extends ResourceModel
8181
public bool $open_graph_use_image;
8282
public int $reviews_rating_sum;
8383
public int $total_sold;
84+
85+
8486
/**
8587
* @var CustomField[]|null
8688
*/

src/BigCommerceLegacyApi/ResourceModels/StoreInformation/StoreInformation.php

+5
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ class StoreInformation extends ResourceModel
4242
public string $is_price_entered_with_tax;
4343
public array $active_comparison_modules;
4444
public object $features;
45+
public int $default_channel_id;
46+
public int $default_site_id;
47+
public int $store_id;
48+
public bool $plan_is_trial;
49+
public string $account_uuid;
4550

4651
public function __construct(?stdClass $optionObject = null)
4752
{

src/BigCommerceLegacyApi/ResponseModels/Order/Order.php

+8
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class Order extends ResourceModel
5959
public string $handling_cost_ex_tax;
6060
public string $handling_cost_inc_tax;
6161
public string $ip_address;
62+
public string $ip_address_v6;
6263
public bool $is_deleted;
6364
public int $items_shipped;
6465
public int $items_total;
@@ -77,6 +78,13 @@ class Order extends ResourceModel
7778
public string $total_inc_tax;
7879
public string $wrapping_cost_ex_tax;
7980
public string $wrapping_cost_inc_tax;
81+
public string $custom_status;
82+
public string $total_tax;
83+
public ?string $credit_card_type;
84+
public ?string $external_merchant_id;
85+
public string $store_default_currency_code;
86+
public string $store_default_to_transactional_exchange_rate;
87+
8088

8189

8290
public function __construct(?stdClass $optionObject = null)

src/BigCommerceLegacyApi/ResponseModels/Order/OrderProduct.php

+9
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ class OrderProduct extends \BigCommerce\ApiV3\ResourceModels\ResourceModel
5252
public ?string $upc;
5353
public ?int $variant_id;
5454
public string $name_merchant;
55+
public int $product_id;
56+
public string $base_total;
57+
public string $total_ex_tax;
58+
public string $total_inc_tax;
59+
public string $total_tax;
60+
public string $quantity_refunded;
61+
public string $refund_amount;
62+
public string $fulfillment_source;
63+
public array $configurable_fields;
5564

5665
public function __construct(?stdClass $optionObject = null)
5766
{

tests/BigCommerce/Api/Catalog/ProductsApiTest.php

+8
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ public function testCanGetProduct(): void
3535
$this->assertEquals('include_fields=weight%2Cwidth', $this->getLastRequest()->getUri()->getQuery());
3636
}
3737

38+
public function testCanGetProductWithoutError(): void
39+
{
40+
$this->setReturnData('catalog__products__77__get.json');
41+
$product = $this->getApi()->catalog()->product(77)->get()->getProduct();
42+
$this->assertEquals(77, $product->id);
43+
$this->assertEquals('SLCTBS', $product->sku);
44+
}
45+
3846
public function testCanGetAllPagesForProducts(): void
3947
{
4048
$this->setReturnData('catalog__products__get_all.json');

tests/BigCommerce/responses/catalog__brands__11__metafields__get_all.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"resource_type": "brand",
1010
"resource_id": 111,
1111
"id": 6,
12-
"created_at": "1973-01-20T21:34:57.903Z",
13-
"updated_at": "1990-12-30T00:29:23.515Z"
12+
"date_created": "1973-01-20T21:34:57.903Z",
13+
"date_updated": "1990-12-30T00:29:23.515Z"
1414
},
1515
{
1616
"permission_set": "read",
@@ -21,8 +21,8 @@
2121
"resource_type": "brand",
2222
"resource_id": 111,
2323
"id": 6,
24-
"created_at": "1973-01-20T21:34:57.903Z",
25-
"updated_at": "1990-12-30T00:29:23.515Z"
24+
"date_created": "1973-01-20T21:34:57.903Z",
25+
"date_updated": "1990-12-30T00:29:23.515Z"
2626
}
2727
],
2828
"meta": {

tests/BigCommerce/responses/catalog__categories__111__metafields__get_all.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"resource_type": "brand",
1010
"resource_id": 111,
1111
"id": 6,
12-
"created_at": "1973-01-20T21:34:57.903Z",
13-
"updated_at": "1990-12-30T00:29:23.515Z"
12+
"date_created": "1973-01-20T21:34:57.903Z",
13+
"date_updated": "1990-12-30T00:29:23.515Z"
1414
},
1515
{
1616
"permission_set": "read",
@@ -21,8 +21,8 @@
2121
"resource_type": "brand",
2222
"resource_id": 111,
2323
"id": 6,
24-
"created_at": "1973-01-20T21:34:57.903Z",
25-
"updated_at": "1990-12-30T00:29:23.515Z"
24+
"date_created": "1973-01-20T21:34:57.903Z",
25+
"date_updated": "1990-12-30T00:29:23.515Z"
2626
}
2727
],
2828
"meta": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
"data": {
3+
"id": 77,
4+
"name": "[Sample] Fog Linen Chambray Towel - Beige Stripe",
5+
"type": "physical",
6+
"sku": "SLCTBS",
7+
"description": "<p>The perfect beach towel: thin, lightweight and highly absorbent. Crafted by Fog Linen in Japan using soft Lithuanian linen, each towel rolls up for compact stowaway. Dry off after a refreshing dip in the ocean and stretch out on it for a sun bath. The thinness ensures a quick dry so you can have it rolled back up in your bag without soaking your belongings.</p>\n<p>Measures 75 x 145 cm/29.5 x 57 in</p>\n<p>100% Linen</p>",
8+
"weight": 1,
9+
"width": 0,
10+
"depth": 0,
11+
"height": 0,
12+
"price": 49,
13+
"cost_price": 0,
14+
"retail_price": 0,
15+
"sale_price": 0,
16+
"map_price": 0,
17+
"tax_class_id": 0,
18+
"product_tax_code": "",
19+
"calculated_price": 49,
20+
"categories": [
21+
18,
22+
23
23+
],
24+
"brand_id": 70,
25+
"option_set_id": 18,
26+
"option_set_display": "right",
27+
"inventory_level": 0,
28+
"inventory_warning_level": 0,
29+
"inventory_tracking": "none",
30+
"reviews_rating_sum": 0,
31+
"reviews_count": 0,
32+
"total_sold": 4,
33+
"fixed_cost_shipping_price": 0,
34+
"is_free_shipping": false,
35+
"is_visible": true,
36+
"is_featured": false,
37+
"related_products": [
38+
-1
39+
],
40+
"warranty": "",
41+
"bin_picking_number": "",
42+
"layout_file": "product.html",
43+
"upc": "",
44+
"mpn": "",
45+
"gtin": "",
46+
"search_keywords": "",
47+
"availability": "available",
48+
"availability_description": "",
49+
"gift_wrapping_options_type": "any",
50+
"gift_wrapping_options_list": [],
51+
"sort_order": 0,
52+
"condition": "New",
53+
"is_condition_shown": false,
54+
"order_quantity_minimum": 0,
55+
"order_quantity_maximum": 0,
56+
"page_title": "",
57+
"meta_keywords": [],
58+
"meta_description": "",
59+
"date_created": "2015-07-03T17:57:10+00:00",
60+
"date_modified": "2022-03-29T22:55:46+00:00",
61+
"view_count": 79,
62+
"preorder_release_date": null,
63+
"preorder_message": "",
64+
"is_preorder_only": false,
65+
"is_price_hidden": false,
66+
"price_hidden_label": "",
67+
"custom_url": {
68+
"url": "/fog-linen-chambray-towel-beige-stripe/",
69+
"is_customized": false
70+
},
71+
"base_variant_id": null,
72+
"open_graph_type": "product",
73+
"open_graph_title": "",
74+
"open_graph_description": "",
75+
"open_graph_use_meta_description": true,
76+
"open_graph_use_product_name": true,
77+
"open_graph_use_image": true
78+
},
79+
"meta": {}
80+
}

tests/BigCommerce/responses/orders__1__metafields__get_all.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"resource_type": "brand",
1010
"resource_id": 1,
1111
"id": 6,
12-
"created_at": "1973-01-20T21:34:57.903Z",
13-
"updated_at": "1990-12-30T00:29:23.515Z"
12+
"date_created": "1973-01-20T21:34:57.903Z",
13+
"date_updated": "1990-12-30T00:29:23.515Z"
1414
},
1515
{
1616
"permission_set": "read",
@@ -21,8 +21,8 @@
2121
"resource_type": "order",
2222
"resource_id": 1,
2323
"id": 6,
24-
"created_at": "1973-01-20T21:34:57.903Z",
25-
"updated_at": "1990-12-30T00:29:23.515Z"
24+
"date_created": "1973-01-20T21:34:57.903Z",
25+
"date_updated": "1990-12-30T00:29:23.515Z"
2626
}
2727
],
2828
"meta": {

0 commit comments

Comments
 (0)