DataCustomerHelper::set_town()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 2
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\Ingenico;
4
5
/**
6
 * Title: Ingenico data customer helper class
7
 * Description:
8
 * Copyright: 2005-2021 Pronamic
9
 * Company: Pronamic
10
 *
11
 * @see     https://payment-services.ingenico.com/int/en/ogone/support/guides/integration%20guides/e-commerce
12
 * @author  Remco Tolsma
13
 * @version 2.0.0
14
 * @since   1.3.0
15
 */
16
class DataCustomerHelper extends DataHelper {
17
	/**
18
	 * Set customer name.
19
	 *
20
	 * Will be pre-initialised (but still editable) in the Customer Name field of the credit card details.
21
	 *
22
	 * @param string $name Customer name.
23
	 *
24
	 * @return DataCustomerHelper
25
	 */
26
	public function set_name( $name ) {
27
		return $this->set_field( 'CN', $name );
28
	}
29
30
	/**
31
	 * Set customer email address.
32
	 *
33
	 * @param string $email Email address.
34
	 *
35
	 * @return DataCustomerHelper
36
	 */
37
	public function set_email( $email ) {
38
		return $this->set_field( 'EMAIL', $email );
39
	}
40
41
	/**
42
	 * Set customer street name and number.
43
	 *
44
	 * @param string $address Street name and house number.
45
	 *
46
	 * @return DataCustomerHelper
47
	 */
48
	public function set_address( $address ) {
49
		return $this->set_field( 'OWNERADDRESS', $address );
50
	}
51
52
	/**
53
	 * Set customer postcode or ZIP code.
54
	 *
55
	 * @param string $zip ZIP.
56
	 *
57
	 * @return DataCustomerHelper
58
	 */
59
	public function set_zip( $zip ) {
60
		return $this->set_field( 'OWNERZIP', $zip );
61
	}
62
63
	/**
64
	 * Set customer town/city/...
65
	 *
66
	 * @param string $town Town.
67
	 *
68
	 * @return DataCustomerHelper
69
	 */
70
	public function set_town( $town ) {
71
		return $this->set_field( 'OWNERTOWN', $town );
72
	}
73
74
	/**
75
	 * Set customer country.
76
	 *
77
	 * @param string $country Country.
78
	 *
79
	 * @return DataCustomerHelper
80
	 */
81
	public function set_country( $country ) {
82
		return $this->set_field( 'OWNERCTY', $country );
83
	}
84
85
	/**
86
	 * Set customer telephone number.
87
	 *
88
	 * @param string $number Telephone number.
89
	 *
90
	 * @return DataCustomerHelper
91
	 */
92
	public function set_telephone_number( $number ) {
93
		return $this->set_field( 'OWNERTELNO', $number );
94
	}
95
}
96