Failed Conditions
Push — develop ( d3f65e...bf2dba )
by Remco
04:24
created

CreditCardGateway::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 9
nc 1
nop 0
dl 0
loc 12
ccs 0
cts 10
cp 0
crap 2
rs 9.9666
c 0
b 0
f 0
1
<?php
2
/**
3
 * Credit card gateway
4
 *
5
 * @author    Pronamic <[email protected]>
6
 * @copyright 2005-2019 Pronamic
7
 * @license   GPL-3.0-or-later
8
 * @package   Pronamic\WordPress\Pay\Extensions\MemberPress
9
 */
10
11
namespace Pronamic\WordPress\Pay\Extensions\MemberPress\Gateways;
12
13
use Pronamic\WordPress\Pay\Core\PaymentMethods;
14
15
/**
16
 * WordPress pay MemberPress credit card gateway
17
 *
18
 * @author  Remco Tolsma
19
 * @version 2.0.1
20
 * @since   1.0.0
21
 */
22
class CreditCardGateway extends Gateway {
23
	/**
24
	 * Payment method.
25
	 *
26
	 * @var string
27
	 */
28
	protected $payment_method = PaymentMethods::CREDIT_CARD;
29
30
	/**
31
	 * Constructs and initialize credit card gateway.
32
	 */
33
	public function __construct() {
34
		parent::__construct();
35
36
		// Capabilities.
37
		$this->capabilities = array(
38
			'process-payments',
39
			'create-subscriptions',
40
			'cancel-subscriptions',
41
			'update-subscriptions',
42
			'suspend-subscriptions',
43
			'resume-subscriptions',
44
			'subscription-trial-payment',
45
		);
46
	}
47
48
	/**
49
	 * Get alias class name of this gateway.
50
	 *
51
	 * @return string
52
	 */
53
	public function get_alias() {
54
		return 'MeprCreditCardGateway';
55
	}
56
}
57