PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.15.5
GiveWP – Donation Plugin and Fundraising Platform v4.15.5
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 / Framework / FieldsAPI / BillingAddress.php
BillingAddress.php
76 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 declare(strict_types=1);
4
5 namespace Give\Framework\FieldsAPI;
6
7 /**
8 * @since 3.0.0
9 */
10 class BillingAddress extends Group
11 {
12 const TYPE = 'billingAddress';
13
14 /**
15 * @since 3.0.0
16 */
17 public $apiUrl;
18
19 /**
20 * @since 3.0.0
21 */
22 public $groupLabel;
23
24 /**
25 * @since 3.0.0
26 */
27 public function setApiUrl(string $url): BillingAddress
28 {
29 $this->apiUrl = $url;
30
31 return $this;
32 }
33
34 /**
35 * @since 3.0.0
36 */
37 public function setGroupLabel(string $groupLabel): BillingAddress
38 {
39 $this->groupLabel = $groupLabel;
40
41 return $this;
42 }
43
44 /**
45 * @since 3.0.0
46 *
47 * @throws Exceptions\EmptyNameException|Exceptions\NameCollisionException
48 */
49 public static function make($name): BillingAddress
50 {
51 return parent::make($name)
52 ->append(
53 Select::make('country')
54 ->label(__('Country', 'give'))
55 ->options([
56 ['value', 'label'],
57 ]),
58
59 Text::make('address1')
60 ->label(__('Address Line 1', 'give')),
61
62 Text::make('address2')
63 ->label(__('Address Line 2', 'give')),
64
65 Text::make('city')
66 ->label(__('City', 'give')),
67
68 Hidden::make('state')
69 ->label(__('State/Province/Country', 'give')),
70
71 Text::make('zip')
72 ->label(__('Zip/Postal Code', 'give'))
73 );
74 }
75 }
76