diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index b4bfb55b..4bdc5c4b 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -4,7 +4,6 @@ on: push: branches: [ main ] pull_request: - branches: [ main ] jobs: build: diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 0d29f074..41a5f4c9 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,11 +1,7 @@ ### Changes -This release changes the root API client class from `BigCommerce\ApiV3\Client` -to `BigCommerce\ApiV3\BaseApiClient`. The interface is unchanged, this abstract class -has been added to allow for a common parent to both the V3 and V2 apis. + - The JSON output from ResourceModels will no longer include the `$optionObject` that was used to construct them. ### New Features - - Add support for creating Orders via the V2 API. In the future this will be removed in favour of a V3 API when an endpoint is added. - - Add `CustomersApi::getAllPages()` which allows fetching all the Customers matching the filter in one request. - + - Implement Store Information endpoints diff --git a/docs/classes/BigCommerce-ApiV2-Api-StoreInformation-StoreInformationApi.html b/docs/classes/BigCommerce-ApiV2-Api-StoreInformation-StoreInformationApi.html new file mode 100644 index 00000000..76525ec1 --- /dev/null +++ b/docs/classes/BigCommerce-ApiV2-Api-StoreInformation-StoreInformationApi.html @@ -0,0 +1,522 @@ + + + + + Documentation + + + + + + + + + + + + + + + + + + + +
+

Documentation

+ + + + + +
+ +
+
+ + + + +
+ + +
+

+ StoreInformationApi + + + extends V2ApiBase + + + + +

+ + + + +
+ + + + + + + + +

+ Table of Contents + +

+ +
+
+ __construct() + +  : mixed +
+
+ +
+ getClient() + +  : V2ApiClient +
+
+ +
+ getParentResourceId() + +  : int|null +
+
+ +
+ getResourceId() + +  : int|null +
+
+ +
+ storeInformation() + +  : StoreInformation +
+
Returns metadata about a store.
+ +
+ time() + +  : int +
+
Returns the system timestamp at the time of the request.
+ +
+ + + + + + + +
+

+ Methods + +

+
+

+ __construct() + +

+ + + + + public + __construct(V2ApiClient $client[, int|null $resourceId = null ][, int|null $parentResourceId = null ]) : mixed + +
+ +
Parameters
+
+
+ $client + : V2ApiClient +
+
+
+ +
+
+ $resourceId + : int|null + = null
+
+
+ +
+
+ $parentResourceId + : int|null + = null
+
+
+ +
+
+ + + +
Return values
+ mixed + — + + +
+ +
+

+ getParentResourceId() + +

+ + + + + public + getParentResourceId() : int|null + +
+ + + + +
Return values
+ int|null + — + + +
+
+

+ getResourceId() + +

+ + + + + public + getResourceId() : int|null + +
+ + + + +
Return values
+ int|null + — + + +
+ +
+

+ time() + +

+ + +

Returns the system timestamp at the time of the request.

+ + + public + time() : int + +

The time resource is useful for validating API authentication details and testing client connections.

+
+ + + +
+ Tags + +
+
+
+ throws +
+
+ GuzzleException + + +
+
+ +
Return values
+ int + — + + +
+
+ + + + +
+
+
+
+

Search results

+ +
+
+
    +
    +
    +
    +
    +
    + + +
    + + + + + + + + diff --git a/docs/classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html b/docs/classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html new file mode 100644 index 00000000..bb7522b7 --- /dev/null +++ b/docs/classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html @@ -0,0 +1,1757 @@ + + + + + Documentation + + + + + + + + + + + + + + + + + + + +
    +

    Documentation

    + + + + + +
    + +
    +
    + + + + +
    + + +
    +

    + StoreInformation + + + extends ResourceModel + + + + +

    + + + + +
    + + + + + + + + +

    + Table of Contents + +

    + +
    +
    + $active_comparison_modules + +  : array<string|int, mixed> +
    +
    + +
    + $address + +  : string +
    +
    + +
    + $admin_email + +  : string +
    +
    + +
    + $control_panel_base_url + +  : string +
    +
    + +
    + $country + +  : string +
    +
    + +
    + $country_code + +  : string +
    +
    + +
    + $currency + +  : string +
    +
    + +
    + $currency_symbol + +  : string +
    +
    + +
    + $currency_symbol_location + +  : string +
    +
    + +
    + $decimal_places + +  : string +
    +
    + +
    + $decimal_separator + +  : string +
    +
    + +
    + $dimension_decimal_places + +  : string +
    +
    + +
    + $dimension_decimal_token + +  : string +
    +
    + +
    + $dimension_thousands_token + +  : string +
    +
    + +
    + $dimension_units + +  : string +
    +
    + +
    + $domain + +  : string +
    +
    + +
    + $favicon_url + +  : string +
    +
    + +
    + $features + +  : object +
    +
    + +
    + $first_name + +  : string +
    +
    + +
    + $id + +  : string +
    +
    + +
    + $industry + +  : string +
    +
    + +
    + $is_price_entered_with_tax + +  : string +
    +
    + +
    + $language + +  : string +
    +
    + +
    + $last_name + +  : string +
    +
    + +
    + $logo + +  : object +
    +
    + +
    + $name + +  : string +
    +
    + +
    + $order_email + +  : string +
    +
    + +
    + $phone + +  : string +
    +
    + +
    + $plan_level + +  : string +
    +
    + +
    + $plan_name + +  : string +
    +
    + +
    + $secure_url + +  : string +
    +
    + +
    + $status + +  : string +
    +
    + +
    + $thousands_separator + +  : string +
    +
    + +
    + $timezone + +  : object +
    +
    + +
    + $weight_units + +  : string +
    +
    + +
    + __construct() + +  : mixed +
    +
    + +
    + jsonSerialize() + +  : array<string|int, mixed> +
    +
    + +
    + + + + + + +
    +

    + Properties + +

    +
    +

    + $active_comparison_modules + + + +

    + + + + + public + array<string|int, mixed> + $active_comparison_modules + + +
    + +
    + + + +
    +
    +

    + $address + + + +

    + + + + + public + string + $address + + +
    + +
    + + + +
    +
    +

    + $admin_email + + + +

    + + + + + public + string + $admin_email + + +
    + +
    + + + +
    +
    +

    + $control_panel_base_url + + + +

    + + + + + public + string + $control_panel_base_url + + +
    + +
    + + + +
    +
    +

    + $country + + + +

    + + + + + public + string + $country + + +
    + +
    + + + +
    +
    +

    + $country_code + + + +

    + + + + + public + string + $country_code + + +
    + +
    + + + +
    +
    +

    + $currency + + + +

    + + + + + public + string + $currency + + +
    + +
    + + + +
    +
    +

    + $currency_symbol + + + +

    + + + + + public + string + $currency_symbol + + +
    + +
    + + + +
    +
    +

    + $currency_symbol_location + + + +

    + + + + + public + string + $currency_symbol_location + + +
    + +
    + + + +
    +
    +

    + $decimal_places + + + +

    + + + + + public + string + $decimal_places + + +
    + +
    + + + +
    +
    +

    + $decimal_separator + + + +

    + + + + + public + string + $decimal_separator + + +
    + +
    + + + +
    +
    +

    + $dimension_decimal_places + + + +

    + + + + + public + string + $dimension_decimal_places + + +
    + +
    + + + +
    +
    +

    + $dimension_decimal_token + + + +

    + + + + + public + string + $dimension_decimal_token + + +
    + +
    + + + +
    +
    +

    + $dimension_thousands_token + + + +

    + + + + + public + string + $dimension_thousands_token + + +
    + +
    + + + +
    +
    +

    + $dimension_units + + + +

    + + + + + public + string + $dimension_units + + +
    + +
    + + + +
    +
    +

    + $domain + + + +

    + + + + + public + string + $domain + + +
    + +
    + + + +
    +
    +

    + $favicon_url + + + +

    + + + + + public + string + $favicon_url + + +
    + +
    + + + +
    +
    +

    + $features + + + +

    + + + + + public + object + $features + + +
    + +
    + + + +
    +
    +

    + $first_name + + + +

    + + + + + public + string + $first_name + + +
    + +
    + + + +
    +
    +

    + $id + + + +

    + + + + + public + string + $id + + +
    + +
    + + + +
    +
    +

    + $industry + + + +

    + + + + + public + string + $industry + + +
    + +
    + + + +
    +
    +

    + $is_price_entered_with_tax + + + +

    + + + + + public + string + $is_price_entered_with_tax + + +
    + +
    + + + +
    +
    +

    + $language + + + +

    + + + + + public + string + $language + + +
    + +
    + + + +
    +
    +

    + $last_name + + + +

    + + + + + public + string + $last_name + + +
    + +
    + + + +
    +
    + + + + + + public + object + $logo + + +
    + +
    + + + +
    +
    +

    + $name + + + +

    + + + + + public + string + $name + + +
    + +
    + + + +
    +
    +

    + $order_email + + + +

    + + + + + public + string + $order_email + + +
    + +
    + + + +
    +
    +

    + $phone + + + +

    + + + + + public + string + $phone + + +
    + +
    + + + +
    +
    +

    + $plan_level + + + +

    + + + + + public + string + $plan_level + + +
    + +
    + + + +
    +
    +

    + $plan_name + + + +

    + + + + + public + string + $plan_name + + +
    + +
    + + + +
    +
    +

    + $secure_url + + + +

    + + + + + public + string + $secure_url + + +
    + +
    + + + +
    +
    +

    + $status + + + +

    + + + + + public + string + $status + + +
    + +
    + + + +
    +
    +

    + $thousands_separator + + + +

    + + + + + public + string + $thousands_separator + + +
    + +
    + + + +
    +
    +

    + $timezone + + + +

    + + + + + public + object + $timezone + + +
    + +
    + + + +
    +
    +

    + $weight_units + + + +

    + + + + + public + string + $weight_units + + +
    + +
    + + + +
    +
    + +
    +

    + Methods + +

    +
    +

    + __construct() + +

    + + + + + public + __construct([stdClass|null $optionObject = null ]) : mixed + +
    + +
    Parameters
    +
    +
    + $optionObject + : stdClass|null + = null
    +
    +
    + +
    +
    + + + +
    Return values
    + mixed + — + + +
    +
    +

    + jsonSerialize() + +

    + + + + + public + jsonSerialize() : array<string|int, mixed> + +
    + + + + +
    Return values
    + array<string|int, mixed> + — + + +
    +
    + + + + +
    +
    +
    +
    +

    Search results

    + +
    +
    +
      +
      +
      +
      +
      +
      + + +
      + + + + + + + + diff --git a/docs/classes/BigCommerce-ApiV2-V2ApiClient.html b/docs/classes/BigCommerce-ApiV2-V2ApiClient.html index b73ad5ef..266304cf 100644 --- a/docs/classes/BigCommerce-ApiV2-V2ApiClient.html +++ b/docs/classes/BigCommerce-ApiV2-V2ApiClient.html @@ -97,7 +97,7 @@

      @@ -178,7 +178,7 @@

      orders() -  : mixed +  : OrdersApi
      @@ -208,6 +208,13 @@

       : void +
      + +
      + storeInformation() + +  : StoreInformationApi +
      @@ -463,14 +470,14 @@

      public - orders() : mixed + orders() : OrdersApi
      @@ -478,7 +485,7 @@

      Return values
      - mixed + OrdersApi — @@ -636,6 +643,39 @@
      Return values
      — + +
      +

      + storeInformation() + +

      + + + + + public + storeInformation() : StoreInformationApi + +
      + + + + +
      Return values
      + StoreInformationApi + — + +
      diff --git a/docs/files/bigcommercelegacyapi-api-storeinformation-storeinformationapi.html b/docs/files/bigcommercelegacyapi-api-storeinformation-storeinformationapi.html new file mode 100644 index 00000000..efd4e76c --- /dev/null +++ b/docs/files/bigcommercelegacyapi-api-storeinformation-storeinformationapi.html @@ -0,0 +1,139 @@ + + + + + Documentation + + + + + + + + + + + + + + + + + + + +
      +

      Documentation

      + + + + + +
      + +
      +
      + + + + +
      +
        +
      + +
      +

      StoreInformationApi.php

      + + +
      + + + + + + +

      + Interfaces, Classes and Traits + +

      + +
      + +
      StoreInformationApi
      +
      + +
      + + + + + + + + +
      +
      +
      +
      +

      Search results

      + +
      +
      +
        +
        +
        +
        +
        +
        + + +
        + + + + + + + + diff --git a/docs/files/bigcommercelegacyapi-resourcemodels-storeinformation-storeinformation.html b/docs/files/bigcommercelegacyapi-resourcemodels-storeinformation-storeinformation.html new file mode 100644 index 00000000..c1bb118c --- /dev/null +++ b/docs/files/bigcommercelegacyapi-resourcemodels-storeinformation-storeinformation.html @@ -0,0 +1,139 @@ + + + + + Documentation + + + + + + + + + + + + + + + + + + + +
        +

        Documentation

        + + + + + +
        + +
        +
        + + + + +
        +
          +
        + +
        +

        StoreInformation.php

        + + +
        + + + + + + +

        + Interfaces, Classes and Traits + +

        + +
        + +
        StoreInformation
        +
        + +
        + + + + + + + + +
        +
        +
        +
        +

        Search results

        + +
        +
        +
          +
          +
          +
          +
          +
          + + +
          + + + + + + + + diff --git a/docs/indices/files.html b/docs/indices/files.html index 72293d80..85d245be 100644 --- a/docs/indices/files.html +++ b/docs/indices/files.html @@ -215,8 +215,8 @@

          O

        • OptionResponse.php
        • OptionsApi.php
        • OptionsResponse.php
        • -
        • Order.php
        • Order.php
        • +
        • Order.php
        • OrderAddress.php
        • OrderBillingAddress.php
        • OrderMetafield.php
        • @@ -328,6 +328,8 @@

          S

        • ScriptsApi.php
        • ScriptsResponse.php
        • SingleResourceResponse.php
        • +
        • StoreInformation.php
        • +
        • StoreInformationApi.php
        • Subscriber.php
        • SubscriberResponse.php
        • SubscribersApi.php
        • diff --git a/docs/js/searchIndex.js b/docs/js/searchIndex.js index b99e0cf2..6d62c711 100644 --- a/docs/js/searchIndex.js +++ b/docs/js/searchIndex.js @@ -7615,6 +7615,206 @@ Search.appendIndex( "name": "orders", "summary": "", "url": "classes/BigCommerce-ApiV2-V2ApiClient.html#method_orders" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\V2ApiClient\u003A\u003AstoreInformation\u0028\u0029", + "name": "storeInformation", + "summary": "", + "url": "classes/BigCommerce-ApiV2-V2ApiClient.html#method_storeInformation" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\Api\\StoreInformation\\StoreInformationApi", + "name": "StoreInformationApi", + "summary": "", + "url": "classes/BigCommerce-ApiV2-Api-StoreInformation-StoreInformationApi.html" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\Api\\StoreInformation\\StoreInformationApi\u003A\u003AstoreInformation\u0028\u0029", + "name": "storeInformation", + "summary": "Returns\u0020metadata\u0020about\u0020a\u0020store.", + "url": "classes/BigCommerce-ApiV2-Api-StoreInformation-StoreInformationApi.html#method_storeInformation" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\Api\\StoreInformation\\StoreInformationApi\u003A\u003Atime\u0028\u0029", + "name": "time", + "summary": "Returns\u0020the\u0020system\u0020timestamp\u0020at\u0020the\u0020time\u0020of\u0020the\u0020request.", + "url": "classes/BigCommerce-ApiV2-Api-StoreInformation-StoreInformationApi.html#method_time" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation", + "name": "StoreInformation", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024id", + "name": "id", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_id" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024domain", + "name": "domain", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_domain" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024secure_url", + "name": "secure_url", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_secure_url" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024control_panel_base_url", + "name": "control_panel_base_url", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_control_panel_base_url" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024status", + "name": "status", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_status" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024name", + "name": "name", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_name" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024first_name", + "name": "first_name", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_first_name" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024last_name", + "name": "last_name", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_last_name" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024address", + "name": "address", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_address" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024country", + "name": "country", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_country" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024country_code", + "name": "country_code", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_country_code" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024phone", + "name": "phone", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_phone" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024admin_email", + "name": "admin_email", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_admin_email" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024order_email", + "name": "order_email", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_order_email" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024favicon_url", + "name": "favicon_url", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_favicon_url" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024timezone", + "name": "timezone", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_timezone" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024language", + "name": "language", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_language" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024currency", + "name": "currency", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_currency" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024currency_symbol", + "name": "currency_symbol", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_currency_symbol" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024decimal_separator", + "name": "decimal_separator", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_decimal_separator" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024thousands_separator", + "name": "thousands_separator", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_thousands_separator" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024decimal_places", + "name": "decimal_places", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_decimal_places" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024currency_symbol_location", + "name": "currency_symbol_location", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_currency_symbol_location" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024weight_units", + "name": "weight_units", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_weight_units" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024dimension_units", + "name": "dimension_units", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_dimension_units" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024dimension_decimal_places", + "name": "dimension_decimal_places", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_dimension_decimal_places" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024dimension_decimal_token", + "name": "dimension_decimal_token", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_dimension_decimal_token" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024dimension_thousands_token", + "name": "dimension_thousands_token", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_dimension_thousands_token" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024plan_name", + "name": "plan_name", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_plan_name" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024plan_level", + "name": "plan_level", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_plan_level" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024industry", + "name": "industry", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_industry" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024logo", + "name": "logo", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_logo" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024is_price_entered_with_tax", + "name": "is_price_entered_with_tax", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_is_price_entered_with_tax" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024active_comparison_modules", + "name": "active_comparison_modules", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_active_comparison_modules" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation\\StoreInformation\u003A\u003A\u0024features", + "name": "features", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_features" }, { "fqsen": "\\", "name": "\\", @@ -7910,6 +8110,11 @@ Search.appendIndex( "name": "Orders", "summary": "", "url": "namespaces/bigcommerce-apiv2-api-orders.html" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\Api\\StoreInformation", + "name": "StoreInformation", + "summary": "", + "url": "namespaces/bigcommerce-apiv2-api-storeinformation.html" }, { "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\Order", "name": "Order", @@ -7920,6 +8125,11 @@ Search.appendIndex( "name": "ResourceModels", "summary": "", "url": "namespaces/bigcommerce-apiv2-resourcemodels.html" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\StoreInformation", + "name": "StoreInformation", + "summary": "", + "url": "namespaces/bigcommerce-apiv2-resourcemodels-storeinformation.html" }, { "fqsen": "\\BigCommerce\\ApiV2", "name": "ApiV2", diff --git a/docs/namespaces/bigcommerce-apiv2-api-storeinformation.html b/docs/namespaces/bigcommerce-apiv2-api-storeinformation.html new file mode 100644 index 00000000..288802b2 --- /dev/null +++ b/docs/namespaces/bigcommerce-apiv2-api-storeinformation.html @@ -0,0 +1,134 @@ + + + + + Documentation + + + + + + + + + + + + + + + + + + + +
          +

          Documentation

          + + + + + +
          + +
          +
          + + + + +
          + + +
          +

          StoreInformation

          + + + +

          + Interfaces, Classes and Traits + +

          + +
          + +
          StoreInformationApi
          +
          + +
          + + + + + + +
          +
          +
          +
          +

          Search results

          + +
          +
          +
            +
            +
            +
            +
            +
            + + +
            + + + + + + + + diff --git a/docs/namespaces/bigcommerce-apiv2-api.html b/docs/namespaces/bigcommerce-apiv2-api.html index 625e1835..df4d2a22 100644 --- a/docs/namespaces/bigcommerce-apiv2-api.html +++ b/docs/namespaces/bigcommerce-apiv2-api.html @@ -94,6 +94,7 @@

            Generic
            Orders
            +
            StoreInformation
            diff --git a/docs/namespaces/bigcommerce-apiv2-resourcemodels-storeinformation.html b/docs/namespaces/bigcommerce-apiv2-resourcemodels-storeinformation.html new file mode 100644 index 00000000..cf4a2d97 --- /dev/null +++ b/docs/namespaces/bigcommerce-apiv2-resourcemodels-storeinformation.html @@ -0,0 +1,134 @@ + + + + + Documentation + + + + + + + + + + + + + + + + + + + +
            +

            Documentation

            + + + + + +
            + +
            +
            + + + + +
            + + +
            +

            StoreInformation

            + + + +

            + Interfaces, Classes and Traits + +

            + +
            + +
            StoreInformation
            +
            + +
            + + + + + + +
            +
            +
            +
            +

            Search results

            + +
            +
            +
              +
              +
              +
              +
              +
              + + +
              + + + + + + + + diff --git a/docs/namespaces/bigcommerce-apiv2-resourcemodels.html b/docs/namespaces/bigcommerce-apiv2-resourcemodels.html index 288f28e0..4fae66d6 100644 --- a/docs/namespaces/bigcommerce-apiv2-resourcemodels.html +++ b/docs/namespaces/bigcommerce-apiv2-resourcemodels.html @@ -93,6 +93,7 @@

              Order
              +
              StoreInformation
              diff --git a/docs/packages/BigCommerce.html b/docs/packages/BigCommerce.html index 154003c0..827307cb 100644 --- a/docs/packages/BigCommerce.html +++ b/docs/packages/BigCommerce.html @@ -575,6 +575,10 @@

              V2ApiClient
              Class for accessing BigCommerce V2 Endpoints
              +
              StoreInformationApi
              +
              +
              StoreInformation
              +
              ProductsSubResourceApi
              diff --git a/docs/reports/markers.html b/docs/reports/markers.html index 6d93aebc..66803fb8 100644 --- a/docs/reports/markers.html +++ b/docs/reports/markers.html @@ -359,17 +359,17 @@

              V2ApiClient.php - 12 + 14 developer.bigcommerce.com/api-reference/store-management/orders/orders/createanorder) - 21 + 23 set order details... - 32 + 34 api.bigcommerce.com/stores/%s/v2/'; diff --git a/src/BigCommerce/ResourceModels/ResourceModel.php b/src/BigCommerce/ResourceModels/ResourceModel.php index d4422436..12ab1877 100644 --- a/src/BigCommerce/ResourceModels/ResourceModel.php +++ b/src/BigCommerce/ResourceModels/ResourceModel.php @@ -26,7 +26,7 @@ public function jsonSerialize(): array { $data = []; foreach ($this as $key => $value) { - if (isset($this->$key)) { + if (isset($this->$key) && $key !== 'optionObject') { $data[$key] = $value; } } diff --git a/src/BigCommerceLegacyApi/Api/StoreInformation/StoreInformationApi.php b/src/BigCommerceLegacyApi/Api/StoreInformation/StoreInformationApi.php new file mode 100644 index 00000000..45b209dd --- /dev/null +++ b/src/BigCommerceLegacyApi/Api/StoreInformation/StoreInformationApi.php @@ -0,0 +1,44 @@ +getClient()->getRestClient()->get( + self::STORE_INFORMATION_ENDPOINT + ); + + return new StoreInformation(json_decode($response->getBody())); + } + + /** + * Returns the system timestamp at the time of the request. + * + * The time resource is useful for validating API authentication details and testing client connections. + * + * @return int + * @throws \GuzzleHttp\Exception\GuzzleException + */ + public function time(): int + { + $response = $this->getClient()->getRestClient()->get( + self::SYSTEM_TIMESTAMP_ENDPOINT + ); + + return json_decode($response->getBody())->time; + } +} diff --git a/src/BigCommerceLegacyApi/ResourceModels/StoreInformation/StoreInformation.php b/src/BigCommerceLegacyApi/ResourceModels/StoreInformation/StoreInformation.php new file mode 100644 index 00000000..e66b002c --- /dev/null +++ b/src/BigCommerceLegacyApi/ResourceModels/StoreInformation/StoreInformation.php @@ -0,0 +1,44 @@ +setReturnData('storeinformation_time.json'); + + $this->assertEquals(1529512970, $this->getApi()->storeInformation()->time()); + } + + public function testCanGetStoreInformation(): void + { + $this->setReturnData('storeinformation_store.json'); + + $information = $this->getApi()->storeInformation()->storeInformation(); + + $this->assertEquals('BigCommerce', $information->name); + $this->assertEquals('my-awesome.store', $information->domain); + } +} diff --git a/tests/BigCommerceLegacyApi/responses/storeinformation_store.json b/tests/BigCommerceLegacyApi/responses/storeinformation_store.json new file mode 100644 index 00000000..a2ee3481 --- /dev/null +++ b/tests/BigCommerceLegacyApi/responses/storeinformation_store.json @@ -0,0 +1,54 @@ +{ + "id": "abc123", + "domain": "my-awesome.store", + "secure_url": "https://my-awesome.stor", + "control_panel_base_url": "https://store-{store_hash}.mybigcommerce.com", + "status": "live", + "name": "BigCommerce", + "first_name": "Jane", + "last_name": "Doe", + "address": "BigCommerce", + "country": "United States", + "country_code": "US", + "phone": "", + "admin_email": "jane.does@example.com", + "order_email": "info@janedoes.mybigcommerce.com", + "favicon_url": "https://cdn8.bigcommerce.com/r-8816ba2f48b0bcf4bec0c1a954c00e0fc36b/img/bc_favicon.ico", + "timezone": { + "name": "America/Chicago", + "raw_offset": -21600, + "dst_offset": -18000, + "dst_correction": true, + "date_format": { + "display": "M jS Y", + "export": "M jS Y", + "extended_display": "M jS Y @ g:i A" + } + }, + "language": "en", + "currency": "USD", + "currency_symbol": "$", + "decimal_separator": ".", + "thousands_separator": ",", + "decimal_places": 2, + "currency_symbol_location": "left", + "weight_units": "Ounces", + "dimension_units": "Inches", + "dimension_decimal_places": 2, + "dimension_decimal_token": ".", + "dimension_thousands_token": ",", + "plan_name": "Standard", + "plan_level": "Standard", + "industry": "", + "logo": { + "url": "https://cdn8.bigcommerce.com/s-{store_hash}/product_images/screen_shot_2018-05-15_at_12.22.26_pm__05547_1529512135.png" + }, + "is_price_entered_with_tax": false, + "active_comparison_modules": [], + "features": { + "stencil_enabled": true, + "sitewidehttps_enabled": false, + "facebook_catalog_id": "", + "checkout_type": "optimized" + } +} diff --git a/tests/BigCommerceLegacyApi/responses/storeinformation_time.json b/tests/BigCommerceLegacyApi/responses/storeinformation_time.json new file mode 100644 index 00000000..6628e42a --- /dev/null +++ b/tests/BigCommerceLegacyApi/responses/storeinformation_time.json @@ -0,0 +1,3 @@ +{ + "time": 1529512970 +}