Failed Conditions
Push — develop ( 5eea29...22f236 )
by Remco
03:28
created

PaymentMethodsRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 29
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get_json() 0 7 1
A __construct() 0 2 1
1
<?php
2
/**
3
 * Payment methods request
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 methods request
15
 *
16
 * @link https://docs.adyen.com/api-explorer/#/PaymentSetupAndVerificationService/v41/paymentMethods
17
 *
18
 * @author  Remco Tolsma
19
 * @version 1.0.0
20
 * @since   1.0.0
21
 */
22
class PaymentMethodsRequest {
23
	/**
24
	 * The merchant account identifier, with which you want to process the transaction.
25
	 *
26
	 * @var string
27
	 */
28
	private $merchant_account;
29
30
	/**
31
	 * Construct a payment request object.
32
	 *
33
	 * @param string $merchant_account The merchant account identifier.
34
	 */
35
	public function __construct( $merchant_account ) {
36
		$this->merchant_account = $merchant_account;
37
	}
38
39
	/**
40
	 * Get JSON.
41
	 *
42
	 * @return object
43
	 */
44
	public function get_json() {
45
		$object = (object) array(
46
			'merchantAccount' => $this->merchant_account,
47
		);
48
49
		// Return object.
50
		return $object;
51
	}
52
}
53