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

PaymentDetailsRequest::set_payment_data()   A

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 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 2
ccs 0
cts 2
cp 0
crap 2
rs 10
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