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 / PaymentGateways / PayPalCommerce / Models / WebhookConfig.php

WebhookConfig.php in GiveWP – Donation Plugin and Fundraising Platform 4.16.9, at src/PaymentGateways/PayPalCommerce/Models/WebhookConfig.php

74 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\PaymentGateways\PayPalCommerce\Models;
4
5 class WebhookConfig
6 {
7 /**
8 * @since 2.9.0
9 *
10 * @var string
11 */
12 public $id;
13
14 /**
15 * @since 2.9.0
16 *
17 * @var string
18 */
19 public $returnUrl;
20
21 /**
22 * @since 2.9.0
23 *
24 * @var string[]
25 */
26 public $events;
27
28 /**
29 * WebhookConfig constructor.
30 *
31 * @since 2.9.0
32 *
33 * @param string $id
34 * @param string $returnUrl
35 * @param string[] $events
36 */
37 public function __construct($id, $returnUrl, $events)
38 {
39 $this->id = $id;
40 $this->returnUrl = $returnUrl;
41 $this->events = $events;
42 }
43
44 /**
45 * Generates an instance from serialized data
46 *
47 * @since 2.9.0
48 *
49 * @param array $data
50 *
51 * @return WebhookConfig
52 */
53 public static function fromArray(array $data)
54 {
55 return new self($data['id'], $data['returnUrl'], $data['events']);
56 }
57
58 /**
59 * Generates an array for serialization
60 *
61 * @since 2.9.0
62 *
63 * @return array
64 */
65 public function toArray()
66 {
67 return [
68 'id' => $this->id,
69 'returnUrl' => $this->returnUrl,
70 'events' => $this->events,
71 ];
72 }
73 }
74