Test Failed
Push — develop ( 71e566...6cb854 )
by Remco
04:29
created

PaymentMethodIDeal::get_json()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 12
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Payment method iDEAL
4
 *
5
 * @author    Pronamic <[email protected]>
6
 * @copyright 2005-2019 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 iDEAL
15
 *
16
 * @author  Remco Tolsma
17
 * @version 1.0.0
18
 * @since   1.0.0
19
 */
20
class PaymentMethodIDeal extends PaymentMethod {
21
	/**
22
	 * Issuer.
23
	 *
24
	 * @var string
25
	 */
26
	private $issuer;
27
28
	/**
29
	 * Construct a payment method.
30
	 *
31
	 * @param string $type   Adyen payment method type.
32
	 * @param string $issuer Adyen iDEAL issuer.
33
	 */
34
	public function __construct( $type, $issuer ) {
35
		parent::__construct( $type );
36
37
		$this->issuer = $issuer;
38
	}
39
40
	/**
41
	 * Get JSON.
42
	 *
43
	 * @return object
44
	 */
45
	public function get_json() {
46
		$object = parent::get_json();
47
48
		$properties = (array) $object;
49
50
		// Issuer.
51
		$properties['issuer'] = $this->issuer;
52
53
		// Return object.
54
		$object = (object) $properties;
55
56
		return $object;
57
	}
58
}
59