Failed Conditions
Push — master ( cc3467...84f509 )
by Reüel
09:31 queued 01:25
created

PaymentDetailsRequest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 69
ccs 0
cts 21
cp 0
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A set_payment_data() 0 2 1
A get_json() 0 11 1
A set_details() 0 2 1
A get_details() 0 2 1
A get_payment_data() 0 2 1
1
<?php
2
/**
3
 * Payment details request
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 details request
15
 *
16
 * @link https://docs.adyen.com/api-explorer/#/PaymentSetupAndVerificationService/v51/payments/details
17
 *
18
 * @author  Reüel van der Steege
19
 * @version 1.1.0
20
 * @since   1.1.0
21
 */
22
class PaymentDetailsRequest extends Request {
23
	/**
24
	 * Use this collection to submit the details that were returned as a result of the /payments call.
25
	 *
26
	 * @var object|null
27
	 */
28
	private $details;
29
30
	/**
31
	 * The paymentData value that you received in the response to the /payments call.
32
	 *
33
	 * @var string|null
34
	 */
35
	private $payment_data;
36
37
	/**
38
	 * Get details.
39
	 *
40
	 * @return object|null
41
	 */
42
	public function get_details() {
43
		return $this->details;
44
	}
45
46
	/**
47
	 * Set details.
48
	 *
49
	 * @param object|null $details Details.
50
	 * @return void
51
	 */
52
	public function set_details( $details ) {
53
		$this->details = $details;
54
	}
55
56
	/**
57
	 * Get payment data.
58
	 *
59
	 * @return string|null
60
	 */
61
	public function get_payment_data() {
62
		return $this->payment_data;
63
	}
64
65
	/**
66
	 * Set payment data.
67
	 *
68
	 * @param string|null $payment_data Payment data.
69
	 * @return void
70
	 */
71
	public function set_payment_data( $payment_data ) {
72
		$this->payment_data = $payment_data;
73
	}
74
75
	/**
76
	 * Get JSON.
77
	 *
78
	 * @return object
79
	 */
80
	public function get_json() {
81
		$properties = Util::filter_null(
82
			array(
83
				'details'     => $this->get_details(),
84
				'paymentData' => $this->get_payment_data(),
85
			)
86
		);
87
88
		$object = (object) $properties;
89
90
		return $object;
91
	}
92
}
93