Failed Conditions
Push — develop ( 22f236...c0dbff )
by Remco
03:29
created

Config::get_api_url()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 0
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Config
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
use Pronamic\WordPress\Pay\Core\Gateway as Core_Gateway;
14
use Pronamic\WordPress\Pay\Core\GatewayConfig;
15
16
/**
17
 * Config
18
 *
19
 * @author  Remco Tolsma
20
 * @version 1.0.0
21
 * @since   1.0.0
22
 */
23
class Config extends GatewayConfig {
24
	/**
25
	 * API Key.
26
	 *
27
	 * @var string
28
	 */
29
	public $api_key;
30
31
	/**
32
	 * API Live URL Prefix.
33
	 *
34
	 * @var string
35
	 */
36
	public $api_live_url_prefix;
37
38
	/**
39
	 * Merchant Account.
40
	 *
41
	 * @var string
42
	 */
43
	public $merchant_account;
44
45
	/**
46
	 * Get API key.
47
	 *
48
	 * @return string
49
	 */
50 1
	public function get_api_key() {
51 1
		return $this->api_key;
52
	}
53
54
	/**
55
	 * Get merchant account.
56
	 *
57
	 * @return string
58
	 */
59 1
	public function get_merchant_account() {
60 1
		return $this->merchant_account;
61
	}
62
63
	/**
64
	 * Get API URL.
65
	 *
66
	 * @return string
67
	 */
68 1
	public function get_api_url() {
69 1
		if ( Core_Gateway::MODE_TEST === $this->mode ) {
70 1
			return Endpoint::API_URL_TEST;
71
		}
72
73 1
		return sprintf( Endpoint::API_URL_LIVE, $this->api_live_url_prefix );
74
	}
75
}
76