PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.9
GiveWP – Donation Plugin and Fundraising Platform v4.16.9
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
give / src / API / REST / V3 / Routes / Subscriptions / Actions / GetSubscriptionCollectionParams.php

GetSubscriptionCollectionParams.php in GiveWP – Donation Plugin and Fundraising Platform 4.16.9, at src/API/REST/V3/Routes/Subscriptions/Actions/GetSubscriptionCollectionParams.php

68 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\API\REST\V3\Routes\Subscriptions\Actions;
4
5 use Give\Subscriptions\ValueObjects\SubscriptionStatus;
6
7 /**
8 * @since 4.8.0
9 */
10 class GetSubscriptionCollectionParams
11 {
12 /**
13 * @since 4.8.0
14 */
15 public function __invoke(): array
16 {
17 return [
18 'sort' => [
19 'description' => esc_html__('Sort field for subscription results', 'give'),
20 'type' => 'string',
21 'default' => 'id',
22 'enum' => [
23 'id',
24 'createdAt',
25 'renewsAt',
26 'status',
27 'amount',
28 'feeAmountRecovered',
29 'donorId',
30 'firstName',
31 'lastName',
32 ],
33 ],
34 'direction' => [
35 'description' => esc_html__('Sort direction for subscription results', 'give'),
36 'type' => 'string',
37 'default' => 'DESC',
38 'enum' => ['ASC', 'DESC'],
39 ],
40 'mode' => [
41 'description' => esc_html__('Subscription mode (live or test)', 'give'),
42 'type' => 'string',
43 'default' => 'live',
44 'enum' => ['live', 'test'],
45 ],
46 'status' => [
47 'description' => esc_html__('Filter subscriptions by status', 'give'),
48 'type' => 'array',
49 'items' => [
50 'type' => 'string',
51 'enum' => ['any', ...array_values(SubscriptionStatus::toArray())],
52 ],
53 'default' => ['any'],
54 ],
55 'campaignId' => [
56 'description' => esc_html__('Filter subscriptions by campaign ID', 'give'),
57 'type' => 'integer',
58 'default' => 0,
59 ],
60 'donorId' => [
61 'description' => esc_html__('Filter subscriptions by donor ID', 'give'),
62 'type' => 'integer',
63 'default' => 0,
64 ],
65 ];
66 }
67 }
68