Test Failed
Push — develop ( ee5b51...397f1c )
by Reüel
05:20
created

PaymentMethodSepaDirectDebit   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
dl 0
loc 43
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A get_json() 0 9 1
1
<?php
2
/**
3
 * Payment method SEPA Direct Debit
4
 *
5
 * @author    Pronamic <[email protected]>
6
 * @copyright 2005-2020 Pronamic
7
 * @license   GPL-3.0-or-later
8
 * @package   Pronamic\WordPress\Pay\Gateways\Adyen
9
 */
10
11
namespace Pronamic\WordPress\Pay\Gateways\Adyen;
12
13
/**
14
 * Payment method SEPA Direct Debit
15
 *
16
 * @author  Reüel van der Steege
17
 * @version 1.1.0
18
 * @since   1.1.0
19
 */
20
class PaymentMethodSepaDirectDebit extends PaymentMethod {
21
	/**
22
	 * IBAN.
23
	 *
24
	 * @var string
25
	 */
26
	private $iban;
27
28
	/**
29
	 * Owner name.
30
	 *
31
	 * @var string
32
	 */
33
	private $owner_name;
34
35
	/**
36
	 * Construct a payment method.
37
	 *
38
	 * @param string $type       Adyen payment method type.
39
	 * @param string $iban       IBAN.
40
	 * @param string $owner_name Owner name.
41
	 */
42
	public function __construct( $type, $iban, $owner_name ) {
43
		parent::__construct( $type );
44
45
		$this->iban       = $iban;
46
		$this->owner_name = $owner_name;
47
	}
48
49
	/**
50
	 * Get JSON.
51
	 *
52
	 * @return object
53
	 */
54
	public function get_json() {
55
		$object = parent::get_json();
56
57
		// Properties.
58
		$object->iban      = $this->iban;
59
		$object->ownerName = $this->owner_name;
60
61
		// Return object.
62
		return $object;
63
	}
64
}
65