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 / Framework / PaymentGateways / Commands / PaymentCommand.php

PaymentCommand.php in GiveWP – Donation Plugin and Fundraising Platform 4.16.9, at src/Framework/PaymentGateways/Commands/PaymentCommand.php

71 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\Framework\PaymentGateways\Commands;
4
5 /***
6 * @since 2.18.0
7 */
8 abstract class PaymentCommand implements GatewayCommand
9 {
10 /**
11 * The Gateway Transaction / Charge Record ID
12 *
13 * @var string|null
14 */
15 public $gatewayTransactionId;
16
17 /**
18 * Notes to be added to the payment.
19 *
20 * @var array|string[]
21 */
22 public $paymentNotes = [];
23
24 /**
25 * @param string|null $gatewayTransactionId
26 *
27 * @return static
28 */
29 public static function make(string $gatewayTransactionId = null): PaymentCommand
30 {
31 return new static($gatewayTransactionId);
32 }
33
34 /**
35 * @since 2.18.0
36 * @since 2.23.1 Make constructor final to avoid unsafe usage of `new static()`.
37 *
38 * @param string|null $gatewayTransactionId
39 */
40 final public function __construct(string $gatewayTransactionId = null)
41 {
42 $this->gatewayTransactionId = $gatewayTransactionId;
43 }
44
45 /**
46 * @since 2.22.0 add type, so it is typesafe
47 *
48 * @param string|string[] ...$paymentNotes
49 *
50 * @return $this
51 */
52 public function setPaymentNotes(string ...$paymentNotes): PaymentCommand
53 {
54 $this->paymentNotes = $paymentNotes;
55
56 return $this;
57 }
58
59 /**
60 * @param string $gatewayTransactionId
61 *
62 * @return $this
63 */
64 public function setTransactionId(string $gatewayTransactionId): PaymentCommand
65 {
66 $this->gatewayTransactionId = $gatewayTransactionId;
67
68 return $this;
69 }
70 }
71