PluginProbe
Pay with Vipps and MobilePay for WooCommerce / 5.4.2
Pay with Vipps and MobilePay for WooCommerce v5.4.2
6.2.3 6.2.2 6.2.1 6.2.0 6.1.10 6.1.9 6.1.8 6.1.7 6.1.6 6.1.5 6.1.4 6.1.3 6.1.2 6.1.1 6.1.0 6.0.5 6.0.4 6.0.3 6.0.2 6.0.1 6.0.0 5.4.3 5.4.2 5.4.1 5.4.0 All 185 releases
woo-vipps / recurring / includes / models / WC_Vipps_Checkout_Session_Customer.php

WC_Vipps_Checkout_Session_Customer.php in Pay with Vipps and MobilePay for WooCommerce 5.4.2, at recurring/includes/models/WC_Vipps_Checkout_Session_Customer.php

83 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 defined( 'ABSPATH' ) || exit;
4
5 class WC_Vipps_Checkout_Session_Customer extends WC_Vipps_Model {
6 public ?string $first_name = null;
7 public ?string $last_name = null;
8 public ?string $email = null;
9 public ?string $phone_number = null;
10 public ?string $street_address = null;
11 public ?string $city = null;
12 public ?string $postal_code = null;
13 public ?string $country = null;
14
15 public function set_first_name( string $first_name ): self {
16 $this->first_name = $first_name;
17
18 return $this;
19 }
20
21 public function set_last_name( string $last_name ): self {
22 $this->last_name = $last_name;
23
24 return $this;
25 }
26
27 public function set_email( string $email ): self {
28 $this->email = $email;
29
30 return $this;
31 }
32
33 public function set_phone_number( string $phone_number ): self {
34 $this->phone_number = $phone_number;
35
36 return $this;
37 }
38
39 public function set_street_address( string $street_address ): self {
40 $this->street_address = $street_address;
41
42 return $this;
43 }
44
45 public function set_city( string $city ): self {
46 $this->city = $city;
47
48 return $this;
49 }
50
51 public function set_postal_code( string $postal_code ): self {
52 $this->postal_code = $postal_code;
53
54 return $this;
55 }
56
57 public function set_country( string $country ): self {
58 $this->country = $country;
59
60 return $this;
61 }
62
63 /**
64 * @throws WC_Vipps_Recurring_Missing_Value_Exception
65 */
66 public function to_array( bool $check_required = false ): array {
67 if ( $check_required ) {
68 $this->check_required();
69 }
70
71 return array_merge(
72 $this->conditional( "firstName", $this->first_name ),
73 $this->conditional( "lastName", $this->last_name ),
74 $this->conditional( "email", $this->email ),
75 $this->conditional( "phoneNumber", $this->phone_number ),
76 $this->conditional( "streetAddress", $this->street_address ),
77 $this->conditional( "city", $this->city ),
78 $this->conditional( "postalCode", $this->postal_code ),
79 $this->conditional( "country", $this->country ),
80 );
81 }
82 }
83