From 18ffb7867005752430e314d7e2dfeda3655fef87 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 30 Sep 2025 03:39:40 +0000 Subject: [PATCH] Add convenience headers for child account requests Co-authored-by: luisarmando1234 --- src/Api/PrintNode/Util/RequestOptions.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Api/PrintNode/Util/RequestOptions.php b/src/Api/PrintNode/Util/RequestOptions.php index f90e7c8..1909c87 100644 --- a/src/Api/PrintNode/Util/RequestOptions.php +++ b/src/Api/PrintNode/Util/RequestOptions.php @@ -73,6 +73,22 @@ public static function parse(RequestOptions|array|string|null $options, bool $st unset($options['api_base']); } + // Integrator Child Account headers convenience options + if (array_key_exists('child_account_id', $options)) { + $headers['X-Child-Account-By-Id'] = (string) $options['child_account_id']; + unset($options['child_account_id']); + } + + if (array_key_exists('child_account_email', $options)) { + $headers['X-Child-Account-By-Email'] = (string) $options['child_account_email']; + unset($options['child_account_email']); + } + + if (array_key_exists('child_account_creator_ref', $options)) { + $headers['X-Child-Account-By-CreatorRef'] = (string) $options['child_account_creator_ref']; + unset($options['child_account_creator_ref']); + } + if ($strict && ! empty($options)) { $message = 'Got unexpected keys in options array: ' . implode(', ', array_keys($options));