diff --git a/src/Resources/Transactions/Operations/ListTransactions.php b/src/Resources/Transactions/Operations/ListTransactions.php index 79c93e2..b15b723 100644 --- a/src/Resources/Transactions/Operations/ListTransactions.php +++ b/src/Resources/Transactions/Operations/ListTransactions.php @@ -22,7 +22,7 @@ class ListTransactions implements HasParameters * @param array $invoiceNumbers * @param array $statuses * @param array $subscriptionIds - * @param array $origin + * @param array $origins */ public function __construct( private readonly ?Pager $pager = null, @@ -36,7 +36,7 @@ public function __construct( private readonly array $statuses = [], private readonly array $subscriptionIds = [], private readonly ?DateComparison $updatedAt = null, - private readonly array $origin = [], + private readonly array $origins = [], ) { if ($invalid = array_filter($this->customerIds, fn ($value): bool => ! is_string($value))) { throw InvalidArgumentException::arrayContainsInvalidTypes('customerIds', 'string', implode(', ', $invalid)); @@ -62,8 +62,8 @@ public function __construct( throw InvalidArgumentException::arrayContainsInvalidTypes('subscriptionIds', 'string', implode(', ', $invalid)); } - if ($invalid = array_filter($this->origin, fn ($value): bool => ! $value instanceof Origin)) { - throw InvalidArgumentException::arrayContainsInvalidTypes('origin', Origin::class, implode(', ', $invalid)); + if ($invalid = array_filter($this->origins, fn ($value): bool => ! $value instanceof Origin)) { + throw InvalidArgumentException::arrayContainsInvalidTypes('origins', Origin::class, implode(', ', $invalid)); } } @@ -84,7 +84,7 @@ public function getParameters(): array 'status' => implode(',', array_map($enumStringify, $this->statuses)), 'subscription_id' => implode(',', $this->subscriptionIds), 'updated_at' . $this->updatedAt?->comparator() => $this->updatedAt?->formatted(), - 'origin' => implode(',', array_map($enumStringify, $this->origin)), + 'origin' => implode(',', array_map($enumStringify, $this->origins)), ]), ); } diff --git a/tests/Functional/Resources/Transactions/TransactionsClientTest.php b/tests/Functional/Resources/Transactions/TransactionsClientTest.php index 6e5554c..f9bf136 100644 --- a/tests/Functional/Resources/Transactions/TransactionsClientTest.php +++ b/tests/Functional/Resources/Transactions/TransactionsClientTest.php @@ -373,8 +373,8 @@ public static function listOperationsProvider(): \Generator sprintf('%s/transactions?include=customer,address,discount', Environment::SANDBOX->baseUrl()), ]; - yield 'With Origin' => [ - new ListTransactions(origin: [Origin::Web, Origin::Api, Origin::SubscriptionRecurring]), + yield 'With Origins' => [ + new ListTransactions(origins: [Origin::Web, Origin::Api, Origin::SubscriptionRecurring]), new Response(200, body: self::readRawJsonFixture('response/list_default')), sprintf('%s/transactions?origin=web,api,subscription_recurring', Environment::SANDBOX->baseUrl()), ];