-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Support notification settings pagination and active filter
- Loading branch information
1 parent
a148262
commit 6549884
Showing
7 changed files
with
361 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/Resources/NotificationSettings/Operations/ListNotificationSettings.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Paddle\SDK\Resources\NotificationSettings\Operations; | ||
|
||
use Paddle\SDK\HasParameters; | ||
use Paddle\SDK\Resources\Shared\Operations\List\Pager; | ||
|
||
class ListNotificationSettings implements HasParameters | ||
{ | ||
public function __construct( | ||
private readonly Pager|null $pager = null, | ||
private readonly bool|null $active = null, | ||
) { | ||
} | ||
|
||
public function getParameters(): array | ||
{ | ||
return array_merge( | ||
$this->pager?->getParameters() ?? [], | ||
array_filter([ | ||
'active' => isset($this->active) ? ($this->active ? 'true' : 'false') : null, | ||
]), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
115 changes: 115 additions & 0 deletions
115
...Functional/Resources/NotificationSettings/_fixtures/response/list_paginated_page_one.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
{ | ||
"data": [ | ||
{ | ||
"id": "ntfset_01gkpjp8bkm3tm53kdgkx6sms7", | ||
"description": "Slack notifications", | ||
"type": "url", | ||
"destination": "https://hooks.slack.com/example", | ||
"active": true, | ||
"api_version": 1, | ||
"include_sensitive_fields": false, | ||
"subscribed_events": [ | ||
{ | ||
"name": "transaction.billed", | ||
"description": "Occurs when a transaction is billed.", | ||
"group": "Transaction", | ||
"available_versions": [1] | ||
}, | ||
{ | ||
"name": "transaction.canceled", | ||
"description": "Occurs when a transaction is canceled.", | ||
"group": "Transaction", | ||
"available_versions": [1] | ||
}, | ||
{ | ||
"name": "transaction.completed", | ||
"description": "Occurs when a transaction is completed.", | ||
"group": "Transaction", | ||
"available_versions": [1] | ||
}, | ||
{ | ||
"name": "transaction.created", | ||
"description": "Occurs when a transaction is created.", | ||
"group": "Transaction", | ||
"available_versions": [1] | ||
}, | ||
{ | ||
"name": "transaction.payment_failed", | ||
"description": "Occurs when a payment fails for a transaction.", | ||
"group": "Transaction", | ||
"available_versions": [1] | ||
}, | ||
{ | ||
"name": "transaction.ready", | ||
"description": "Occurs when a transaction is ready.", | ||
"group": "Transaction", | ||
"available_versions": [1] | ||
}, | ||
{ | ||
"name": "transaction.updated", | ||
"description": "Occurs when a transaction is updated.", | ||
"group": "Transaction", | ||
"available_versions": [1] | ||
}, | ||
{ | ||
"name": "subscription.activated", | ||
"description": "Occurs when a subscription is activated.", | ||
"group": "Subscription", | ||
"available_versions": [1] | ||
}, | ||
{ | ||
"name": "subscription.canceled", | ||
"description": "Occurs when a subscription is canceled.", | ||
"group": "Subscription", | ||
"available_versions": [1] | ||
}, | ||
{ | ||
"name": "subscription.created", | ||
"description": "Occurs when a subscription is created.", | ||
"group": "Subscription", | ||
"available_versions": [1] | ||
}, | ||
{ | ||
"name": "subscription.past_due", | ||
"description": "Occurs when a subscription is past due.", | ||
"group": "Subscription", | ||
"available_versions": [1] | ||
}, | ||
{ | ||
"name": "subscription.paused", | ||
"description": "Occurs when a subscription is paused.", | ||
"group": "Subscription", | ||
"available_versions": [1] | ||
}, | ||
{ | ||
"name": "subscription.resumed", | ||
"description": "Occurs when a subscription is resumed.", | ||
"group": "Subscription", | ||
"available_versions": [1] | ||
}, | ||
{ | ||
"name": "subscription.trialing", | ||
"description": "Occurs when a subscription is trialing.", | ||
"group": "Subscription", | ||
"available_versions": [1] | ||
}, | ||
{ | ||
"name": "subscription.updated", | ||
"description": "Occurs when a subscription is updated.", | ||
"group": "Subscription", | ||
"available_versions": [1] | ||
} | ||
], | ||
"endpoint_secret_key": "pdl_ntfset_01gkpjp8bkm3tm53kdgkx6sms7_6h3qd3uFSi9YCD3OLYAShQI90XTI5vEI" | ||
} | ||
], | ||
"meta": { | ||
"request_id": "cf039cbb-6c2a-485d-b244-501894b797a6", | ||
"pagination": { | ||
"per_page": 1, | ||
"next": "https://api.paddle.com/notification-settings?after=ntfset_01gkpjp8bkm3tm53kdgkx6sms7", | ||
"has_more": true, | ||
"estimated_total": 2 | ||
} | ||
} | ||
} |
Oops, something went wrong.