Skip to content

Commit 91ac34d

Browse files
authored
Merge branch 'main' into dependabot/github_actions/actions-cool/issues-helper-3.6.3
2 parents 7ff46c4 + 4b53f9b commit 91ac34d

152 files changed

Lines changed: 30000 additions & 8 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1616

1717
- name: Install PHP with extensions
18-
uses: shivammathur/setup-php@20529878ed81ef8e78ddf08b480401e6101a850f # 2.35.3
18+
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # 2.35.5
1919
with:
2020
php-version: ${{ matrix.php-version }}
2121
tools: composer:v2, phpcs

BREAKING_CHANGES_FOR_V6.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Breaking change notice for version 6.0.0
2+
3+
## Removal of `ApiVersion::LATEST` constant
4+
5+
The `ApiVersion::LATEST` constant has been removed to prevent semantic versioning (semver) breaking changes. Previously, this constant would automatically update every quarter when new API versions were released, causing unintended breaking changes for apps.
6+
7+
### Migration Guide
8+
9+
**If you were using the constant directly:**
10+
11+
```php
12+
// Before (v5 and earlier)
13+
$apiVersion = ApiVersion::LATEST;
14+
15+
// After (v6+)
16+
$apiVersion = '2025-07'; // Explicitly specify the version you want to use
17+
```
18+
19+
**In your Context::initialize():**
20+
21+
The `apiVersion` parameter is now **required** in `Context::initialize()`. You must explicitly specify which API version you want to use:
22+
23+
```php
24+
// Before (v5 and earlier)
25+
Context::initialize(
26+
apiKey: $_ENV['SHOPIFY_API_KEY'],
27+
apiSecretKey: $_ENV['SHOPIFY_API_SECRET'],
28+
scopes: $_ENV['SHOPIFY_APP_SCOPES'],
29+
hostName: $_ENV['SHOPIFY_APP_HOST_NAME'],
30+
sessionStorage: new FileSessionStorage('/tmp/php_sessions'),
31+
// apiVersion was optional with default ApiVersion::LATEST
32+
);
33+
34+
// After (v6+)
35+
Context::initialize(
36+
apiKey: $_ENV['SHOPIFY_API_KEY'],
37+
apiSecretKey: $_ENV['SHOPIFY_API_SECRET'],
38+
scopes: $_ENV['SHOPIFY_APP_SCOPES'],
39+
hostName: $_ENV['SHOPIFY_APP_HOST_NAME'],
40+
sessionStorage: new FileSessionStorage('/tmp/php_sessions'),
41+
apiVersion: '2025-07', // Now required - explicitly specify the version
42+
);
43+
```
44+
45+
**Finding the right API version:**
46+
47+
You can reference the available API versions in the `ApiVersion` class:
48+
49+
```php
50+
use Shopify\ApiVersion;
51+
52+
// Available constants (as of this release):
53+
ApiVersion::UNSTABLE // "unstable"
54+
ApiVersion::JULY_2025 // "2025-07"
55+
ApiVersion::APRIL_2025 // "2025-04"
56+
ApiVersion::JANUARY_2025 // "2025-01"
57+
ApiVersion::OCTOBER_2024 // "2024-10"
58+
// ... and older versions
59+
```
60+
61+
Or you can use string literals directly:
62+
63+
```php
64+
Context::initialize(
65+
// ... other parameters
66+
apiVersion: '2025-07',
67+
);
68+
```
69+
70+
**Why this change?**
71+
72+
By requiring explicit version specification, apps can:
73+
- Control when they upgrade to new API versions
74+
- Test thoroughly before upgrading
75+
- Avoid unexpected breaking changes from automatic version updates
76+
- Follow semantic versioning principles more accurately
77+
78+
**Recommended approach:**
79+
80+
1. Review the [Shopify API Changelog](https://shopify.dev/changelog) to understand changes between versions
81+
2. Choose the API version that best suits your app's needs
82+
3. Explicitly specify that version in your `Context::initialize()` call
83+
4. Test your app thoroughly with the chosen version
84+
5. Upgrade to newer versions on your own schedule after proper testing

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

88
## Unreleased
9+
- ⚠️ [Breaking] Remove `ApiVersion::LATEST` constant to prevent semver violations. The `apiVersion` parameter is now required in `Context::initialize()`. Developers must explicitly specify API versions. See the [migration guide](BREAKING_CHANGES_FOR_V6.md#removal-of-apiversionlatest-constant) for details.
910
- [#425](https://github.com/Shopify/shopify-api-php/pull/425) [Patch] Add compliance webhook topics
11+
- [#433](https://github.com/Shopify/shopify-api-php/pull/433) [Minor] Add support for 2025-10 API version
1012

1113
## v5.11.0 - 2025-07-10
1214
- [#418](https://github.com/Shopify/shopify-api-php/pull/416) [Minor] Add support for 2025-07 API version

docs/getting_started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The first thing your app will need to do to use this library is to set up your c
1919
| `scopes` | `string \| array` | Yes | - | App scopes |
2020
| `hostName` | `string` | Yes | - | App host name e.g. `my-app.my-domain.ca`. You may optionally include `https://` or `http://` to determine which scheme to use |
2121
| `sessionStorage` | `SessionStorage` | Yes | - | Session storage strategy. Read our [notes on session handling](issues.md#notes-on-session-handling) for more information |
22-
| `apiVersion` | `string` | No | `ApiVersion::LATEST` | App API version, defaults to `ApiVersion::LATEST` |
22+
| `apiVersion` | `string` | Yes | - | App API version. You must explicitly specify which API version to use (e.g., `'2025-07'`, `'2024-10'`, etc.) |
2323
| `isEmbeddedApp` | `bool` | No | `true` | Whether the app is an embedded app |
2424
| `isPrivateApp` | `bool` | No | `false` | Whether the app is a private app |
2525
| `userAgentPrefix` | `string` | No | - | Prefix for user agent header sent with a request |

src/ApiVersion.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,5 @@ class ApiVersion
6969
/**
7070
* @var string
7171
*/
72-
public const LATEST = self::JULY_2025;
72+
public const OCTOBER_2025 = "2025-10";
7373
}

src/Context.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class Context
6060
* @param string|array $scopes App scopes
6161
* @param string $hostName App host name e.g. www.google.ca. May include scheme
6262
* @param SessionStorage $sessionStorage Session storage strategy
63-
* @param string $apiVersion App API key, defaults to unstable
63+
* @param string $apiVersion App API version
6464
* @param bool $isEmbeddedApp Whether the app is an embedded app, defaults to true
6565
* @param bool $isPrivateApp Whether the app is a private app, defaults to false
6666
* @param string|null $privateAppStorefrontAccessToken The Storefront API Access Token for a private app
@@ -77,7 +77,7 @@ public static function initialize(
7777
$scopes,
7878
string $hostName,
7979
SessionStorage $sessionStorage,
80-
string $apiVersion = ApiVersion::LATEST,
80+
string $apiVersion,
8181
bool $isEmbeddedApp = true,
8282
bool $isPrivateApp = false,
8383
?string $privateAppStorefrontAccessToken = null,
@@ -93,6 +93,7 @@ public static function initialize(
9393
'apiSecretKey' => $apiSecretKey,
9494
'scopes' => implode((array)$scopes),
9595
'hostName' => $hostName,
96+
'apiVersion' => $apiVersion,
9697
];
9798
$missing = array();
9899
foreach ($requiredValues as $key => $value) {
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<?php
2+
3+
/***********************************************************************************************************************
4+
* This file is auto-generated. If you have an issue, please create a GitHub issue. *
5+
***********************************************************************************************************************/
6+
7+
declare(strict_types=1);
8+
9+
namespace Shopify\Rest\Admin2025_10;
10+
11+
use Shopify\Auth\Session;
12+
use Shopify\Rest\Base;
13+
14+
/**
15+
* @property string|null $abandoned_checkout_url
16+
* @property array|null $billing_address
17+
* @property bool|null $buyer_accepts_marketing
18+
* @property bool|null $buyer_accepts_sms_marketing
19+
* @property string|null $cart_token
20+
* @property string|null $closed_at
21+
* @property string|null $completed_at
22+
* @property string|null $created_at
23+
* @property Currency|null $currency
24+
* @property Customer|null $customer
25+
* @property string|null $customer_locale
26+
* @property int|null $device_id
27+
* @property DiscountCode[]|null $discount_codes
28+
* @property string|null $email
29+
* @property string|null $gateway
30+
* @property int|null $id
31+
* @property string|null $landing_site
32+
* @property array|null $line_items
33+
* @property int|null $location_id
34+
* @property string|null $note
35+
* @property string|null $phone
36+
* @property string|null $presentment_currency
37+
* @property string|null $referring_site
38+
* @property array|null $shipping_address
39+
* @property array|null $shipping_lines
40+
* @property string|null $sms_marketing_phone
41+
* @property string|null $source_name
42+
* @property string|null $subtotal_price
43+
* @property array|null $tax_lines
44+
* @property bool|null $taxes_included
45+
* @property string|null $token
46+
* @property string|null $total_discounts
47+
* @property string|null $total_duties
48+
* @property string|null $total_line_items_price
49+
* @property string|null $total_price
50+
* @property string|null $total_tax
51+
* @property int|null $total_weight
52+
* @property string|null $updated_at
53+
* @property int|null $user_id
54+
*/
55+
class AbandonedCheckout extends Base
56+
{
57+
public static string $API_VERSION = "2025-10";
58+
protected static array $HAS_ONE = [
59+
"currency" => Currency::class,
60+
"customer" => Customer::class
61+
];
62+
protected static array $HAS_MANY = [
63+
"discount_codes" => DiscountCode::class
64+
];
65+
protected static array $PATHS = [
66+
["http_method" => "get", "operation" => "checkouts", "ids" => [], "path" => "checkouts.json"],
67+
["http_method" => "get", "operation" => "checkouts", "ids" => [], "path" => "checkouts.json"]
68+
];
69+
70+
/**
71+
* @param Session $session
72+
* @param array $urlIds
73+
* @param mixed[] $params Allowed indexes:
74+
* since_id,
75+
* created_at_min,
76+
* created_at_max,
77+
* updated_at_min,
78+
* updated_at_max,
79+
* status,
80+
* limit
81+
*
82+
* @return array|null
83+
*/
84+
public static function checkouts(
85+
Session $session,
86+
array $urlIds = [],
87+
array $params = []
88+
): ?array {
89+
$response = parent::request(
90+
"get",
91+
"checkouts",
92+
$session,
93+
[],
94+
$params,
95+
[],
96+
);
97+
98+
return $response->getDecodedBody();
99+
}
100+
101+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
/***********************************************************************************************************************
4+
* This file is auto-generated. If you have an issue, please create a GitHub issue. *
5+
***********************************************************************************************************************/
6+
7+
declare(strict_types=1);
8+
9+
namespace Shopify\Rest\Admin2025_10;
10+
11+
use Shopify\Auth\Session;
12+
use Shopify\Rest\Base;
13+
14+
/**
15+
* @property string $handle
16+
* @property array[]|null $access_scopes
17+
*/
18+
class AccessScope extends Base
19+
{
20+
public static string $API_VERSION = "2025-10";
21+
protected static array $HAS_ONE = [];
22+
protected static array $HAS_MANY = [];
23+
protected static ?string $CUSTOM_PREFIX = "/admin/oauth";
24+
protected static array $PATHS = [
25+
["http_method" => "get", "operation" => "get", "ids" => [], "path" => "access_scopes.json"]
26+
];
27+
28+
/**
29+
* @param Session $session
30+
* @param array $urlIds
31+
* @param mixed[] $params
32+
*
33+
* @return AccessScope[]
34+
*/
35+
public static function all(
36+
Session $session,
37+
array $urlIds = [],
38+
array $params = []
39+
): array {
40+
return parent::baseFind(
41+
$session,
42+
[],
43+
$params,
44+
);
45+
}
46+
47+
}

0 commit comments

Comments
 (0)