Failed Conditions
Push — develop ( a45adf...0344f1 )
by Reüel
08:46
created

NotifyRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 10
c 1
b 0
f 0
dl 0
loc 35
ccs 0
cts 12
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get_signature_data() 0 13 1
A __construct() 0 6 1
1
<?php
2
/**
3
 * Notify return request
4
 *
5
 * @author    Pronamic <[email protected]>
6
 * @copyright 2005-2019 Pronamic
7
 * @license   GPL-3.0-or-later
8
 * @package   Pronamic\WordPress\Pay\Payments
9
 */
10
11
namespace Pronamic\WordPress\Pay\Gateways\Sisow;
12
13
/**
14
 * Title: Sisow notify return request
15
 * Description:
16
 * Copyright: Copyright (c) 2019
17
 * Company: Pronamic
18
 *
19
 * @author  Reüel van der Steege
20
 * @version 2.0.4
21
 * @since   2.0.4
22
 */
23
class NotifyRequest extends Request {
24
	/**
25
	 * Constructor.
26
	 *
27
	 * @param string $transaction_id Transaction ID.
28
	 * @param string $entrance_code  Entrance code.
29
	 * @param string $status         Status.
30
	 * @param string $merchant_id    Merchant ID.
31
	 */
32
	public function __construct( $transaction_id, $entrance_code, $status, $merchant_id ) {
33
		parent::__construct( $merchant_id );
34
35
		$this->set_parameter( 'trxid', $transaction_id );
36
		$this->set_parameter( 'ec', $entrance_code );
37
		$this->set_parameter( 'status', $status );
38
	}
39
40
	/**
41
	 * Get signature data.
42
	 *
43
	 * @return array
44
	 */
45
	public function get_signature_data() {
46
		return array(
47
			// Transaction ID.
48
			$this->get_parameter( 'trxid' ),
49
50
			// Entrance code.
51
			$this->get_parameter( 'ec' ),
52
53
			// Status.
54
			$this->get_parameter( 'status' ),
55
56
			// Merchant ID.
57
			$this->get_parameter( 'merchantid' ),
58
		);
59
	}
60
}
61