DataCreditCardHelper::set_expiration_date()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 2
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\Ingenico;
4
5
use DateTime;
6
7
/**
8
 * Title: Ingenico data default helper class
9
 * Description:
10
 * Copyright: 2005-2021 Pronamic
11
 * Company: Pronamic
12
 *
13
 * @author  Remco Tolsma
14
 * @version 2.0.0
15
 * @since   1.0.0
16
 */
17
class DataCreditCardHelper extends DataHelper {
18
	/**
19
	 * Set credit card number.
20
	 *
21
	 * @param int $number Credit card number.
22
	 *
23
	 * @return DataCreditCardHelper
24
	 */
25 1
	public function set_number( $number ) {
26 1
		return $this->set_field( 'CARDNO', $number );
27
	}
28
29
	/**
30
	 * Set expiration date.
31
	 *
32
	 * @param DateTime $date Expiration date.
33
	 *
34
	 * @return DataCreditCardHelper
35
	 */
36 1
	public function set_expiration_date( DateTime $date ) {
37 1
		return $this->set_field( 'ED', $date->format( Ingenico::EXPIRATION_DATE_FORMAT ) );
38
	}
39
40
	/**
41
	 * Set security code.
42
	 *
43
	 * @param string $security_code Security code.
44
	 *
45
	 * @return DataCreditCardHelper
46
	 */
47 1
	public function set_security_code( $security_code ) {
48 1
		return $this->set_field( 'CVC', $security_code );
49
	}
50
}
51