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

PaymentMethodsRequest::get_json()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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