PaymentResultRequest::__construct()   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 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 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
/**
3
 * Payment result 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 result request
15
 *
16
 * @link https://docs.adyen.com/api-explorer/#/PaymentSetupAndVerificationService/v41/payments/result
17
 *
18
 * @author  Remco Tolsma
19
 * @version 1.0.0
20
 * @since   1.0.0
21
 */
22
class PaymentResultRequest extends Request {
23
	/**
24
	 * Encrypted and signed payment result data. You should receive this value from the Checkout SDK after the shopper completes the payment.
25
	 *
26
	 * @var string
27
	 */
28
	private $payload;
29
30
	/**
31
	 * Construct a payment result request object.
32
	 *
33
	 * @param string $payload Payload.
34
	 */
35 2
	public function __construct( $payload ) {
36 2
		$this->payload = $payload;
37 2
	}
38
39
	/**
40
	 * Get JSON.
41
	 *
42
	 * @return object
43
	 */
44 2
	public function get_json() {
45
		return (object) array(
46 2
			'payload' => $this->payload,
47
		);
48
	}
49
}
50