PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 2.19.6
GiveWP – Donation Plugin and Fundraising Platform v2.19.6
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 2.31.0 2.31.1 All 253 releases
give / src / PaymentGateways / DataTransferObjects / GatewayPaymentData.php
GatewayPaymentData.php
101 lines 2.0 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\DataTransferObjects;
4
5 use Give\ValueObjects\Address;
6 use Give\ValueObjects\CardInfo;
7 use Give\ValueObjects\DonorInfo;
8
9 /**
10 * Class GatewayPaymentData
11 * @since 2.18.0
12 */
13 class GatewayPaymentData
14 {
15 /**
16 * @var string
17 */
18 public $gatewayId;
19 /**
20 * @var string
21 */
22 public $donationId;
23 /**
24 * @var float
25 */
26 public $price;
27 /**
28 * @var string
29 */
30 public $priceId;
31 /**
32 * @var string
33 */
34 public $date;
35 /**
36 * @var string
37 */
38 public $purchaseKey;
39 /**
40 * @var string
41 */
42 public $currency;
43 /**
44 * @var DonorInfo
45 */
46 public $donorInfo;
47 /**
48 * @var CardInfo|null
49 */
50 public $cardInfo;
51 /**
52 * @var string
53 */
54 public $amount;
55 /**
56 * @var Address|null
57 */
58 public $billingAddress;
59 /**
60 * @var string
61 */
62 public $redirectUrl;
63 /**
64 * We are using this property internally to gracefully deprecate filter and action hooks.
65 * We do not recommend using this property in logic. This will be removed in the future.
66 *
67 * @deprecated
68 *
69 * @var array
70 */
71 public $legacyPaymentData;
72
73 /**
74 * Convert data from array into DTO
75 *
76 * @since 2.18.0
77 *
78 * @return self
79 */
80 public static function fromArray(array $array)
81 {
82 $self = new static();
83
84 $self->legacyPaymentData = $array['legacyPaymentData'];
85 $self->price = $array['price'];
86 $self->priceId = $array['priceId'];
87 $self->currency = $array['currency'];
88 $self->amount = $array['amount'];
89 $self->date = $array['date'];
90 $self->gatewayId = $array['gatewayId'];
91 $self->donationId = $array['donationId'];
92 $self->purchaseKey = $array['purchaseKey'];
93 $self->donorInfo = $array['donorInfo'];
94 $self->cardInfo = $array['cardInfo'];
95 $self->billingAddress = $array['billingAddress'];
96 $self->redirectUrl = give_get_success_page_uri();
97
98 return $self;
99 }
100 }
101