Skip to content

Commit

Permalink
check for key param
Browse files Browse the repository at this point in the history
  • Loading branch information
notbakaneko committed Feb 10, 2025
1 parent 4bd31dd commit 0deda4e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/Console/Commands/StoreGetShopifyOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Shopify\Auth\FileSessionStorage;
use Shopify\Clients\Storefront;
use Shopify\Context;
use Shopify\Utils;

class StoreGetShopifyOrder extends Command
{
Expand Down Expand Up @@ -75,8 +76,14 @@ public function handle()
return static::INVALID;
}

$gid = $order->reference;
$this->info("Getting details for Order {$order->getKey()}");

$gid = $order->reference;
if (!isset(Utils::getQueryParams($gid)['key'])) {
$this->error('Missing key param in id for querying');
return static::INVALID;
}

$this->warn('The id and statusUrl returned are private and should not be shared!');

if (str_starts_with($gid, 'gid://shopify/Checkout')) {
Expand Down

0 comments on commit 0deda4e

Please sign in to comment.