Completed
Push — feature/post-pay ( d7c068...b02c6c )
by Reüel
06:10
created
src/Error.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 	 * @param string $code    Code.
42 42
 	 * @param string $message Message.
43 43
 	 */
44
-	public function __construct( $code, $message ) {
44
+	public function __construct($code, $message) {
45 45
 		$this->code    = $code;
46 46
 		$this->message = $message;
47 47
 	}
Please login to merge, or discard this patch.
src/Methods.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -192,13 +192,13 @@
 block discarded – undo
192 192
 	 * @param string|null $default        Value to return if method could not be transformed.
193 193
 	 * @return string|null
194 194
 	 */
195
-	public static function transform( $payment_method, $default = null ) {
196
-		if ( ! is_scalar( $payment_method ) ) {
195
+	public static function transform($payment_method, $default = null) {
196
+		if ( ! is_scalar($payment_method)) {
197 197
 			return null;
198 198
 		}
199 199
 
200
-		if ( isset( self::$map[ $payment_method ] ) ) {
201
-			return self::$map[ $payment_method ];
200
+		if (isset(self::$map[$payment_method])) {
201
+			return self::$map[$payment_method];
202 202
 		}
203 203
 
204 204
 		return $default;
Please login to merge, or discard this patch.
src/XML/Parser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,5 +28,5 @@
 block discarded – undo
28 28
 	 *
29 29
 	 * @param SimpleXMLElement $xml XML element to parse.
30 30
 	 */
31
-	public static function parse( SimpleXMLElement $xml );
31
+	public static function parse(SimpleXMLElement $xml);
32 32
 }
Please login to merge, or discard this patch.
src/XML/ErrorParser.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@
 block discarded – undo
30 30
 	 *
31 31
 	 * @param SimpleXMLElement $xml XML element to parse.
32 32
 	 */
33
-	public static function parse( SimpleXMLElement $xml ) {
33
+	public static function parse(SimpleXMLElement $xml) {
34 34
 		$error = new Sisow_Error(
35
-			Security::filter( $xml->errorcode ),
36
-			Security::filter( $xml->errormessage )
35
+			Security::filter($xml->errorcode),
36
+			Security::filter($xml->errormessage)
37 37
 		);
38 38
 
39 39
 		return $error;
Please login to merge, or discard this patch.
src/Settings.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
 	 * Construct settings.
28 28
 	 */
29 29
 	public function __construct() {
30
-		add_filter( 'pronamic_pay_gateway_sections', array( $this, 'sections' ) );
31
-		add_filter( 'pronamic_pay_gateway_fields', array( $this, 'fields' ) );
30
+		add_filter('pronamic_pay_gateway_sections', array($this, 'sections'));
31
+		add_filter('pronamic_pay_gateway_fields', array($this, 'fields'));
32 32
 	}
33 33
 
34 34
 	/**
@@ -37,15 +37,15 @@  discard block
 block discarded – undo
37 37
 	 * @param array $sections Sections.
38 38
 	 * @return array
39 39
 	 */
40
-	public function sections( array $sections ) {
40
+	public function sections(array $sections) {
41 41
 		// Sisow.
42 42
 		$sections['sisow'] = array(
43
-			'title'       => __( 'Sisow', 'pronamic_ideal' ),
44
-			'methods'     => array( 'sisow' ),
43
+			'title'       => __('Sisow', 'pronamic_ideal'),
44
+			'methods'     => array('sisow'),
45 45
 			'description' => sprintf(
46 46
 				/* translators: %s: Sisow */
47
-				__( 'Account details are provided by %1$s after registration. These settings need to match with the %1$s dashboard.', 'pronamic_ideal' ),
48
-				__( 'Sisow', 'pronamic_ideal' )
47
+				__('Account details are provided by %1$s after registration. These settings need to match with the %1$s dashboard.', 'pronamic_ideal'),
48
+				__('Sisow', 'pronamic_ideal')
49 49
 			),
50 50
 		);
51 51
 
@@ -58,55 +58,55 @@  discard block
 block discarded – undo
58 58
 	 * @param array $fields Fields.
59 59
 	 * @return array
60 60
 	 */
61
-	public function fields( array $fields ) {
61
+	public function fields(array $fields) {
62 62
 		// Merchant ID.
63 63
 		$fields[] = array(
64 64
 			'filter'   => FILTER_SANITIZE_STRING,
65 65
 			'section'  => 'sisow',
66
-			'methods'  => array( 'sisow' ),
66
+			'methods'  => array('sisow'),
67 67
 			'meta_key' => '_pronamic_gateway_sisow_merchant_id',
68
-			'title'    => _x( 'Merchant ID', 'sisow', 'pronamic_ideal' ),
68
+			'title'    => _x('Merchant ID', 'sisow', 'pronamic_ideal'),
69 69
 			'type'     => 'text',
70
-			'classes'  => array( 'code' ),
71
-			'tooltip'  => __( 'Merchant ID as mentioned at <strong>My Profile</strong> in the Sisow dashboard.', 'pronamic_ideal' ),
70
+			'classes'  => array('code'),
71
+			'tooltip'  => __('Merchant ID as mentioned at <strong>My Profile</strong> in the Sisow dashboard.', 'pronamic_ideal'),
72 72
 		);
73 73
 
74 74
 		// Merchant Key.
75 75
 		$fields[] = array(
76 76
 			'filter'   => FILTER_SANITIZE_STRING,
77 77
 			'section'  => 'sisow',
78
-			'methods'  => array( 'sisow' ),
78
+			'methods'  => array('sisow'),
79 79
 			'meta_key' => '_pronamic_gateway_sisow_merchant_key',
80
-			'title'    => _x( 'Merchant Key', 'sisow', 'pronamic_ideal' ),
80
+			'title'    => _x('Merchant Key', 'sisow', 'pronamic_ideal'),
81 81
 			'type'     => 'text',
82
-			'classes'  => array( 'regular-text', 'code' ),
83
-			'tooltip'  => __( 'Merchant Key as mentioned at <strong>My Profile</strong> in the Sisow dashboard.', 'pronamic_ideal' ),
82
+			'classes'  => array('regular-text', 'code'),
83
+			'tooltip'  => __('Merchant Key as mentioned at <strong>My Profile</strong> in the Sisow dashboard.', 'pronamic_ideal'),
84 84
 		);
85 85
 
86 86
 		// Shop ID.
87 87
 		$fields[] = array(
88 88
 			'filter'      => FILTER_SANITIZE_STRING,
89 89
 			'section'     => 'sisow',
90
-			'methods'     => array( 'sisow' ),
90
+			'methods'     => array('sisow'),
91 91
 			'meta_key'    => '_pronamic_gateway_sisow_shop_id',
92
-			'title'       => _x( 'Shop ID', 'sisow', 'pronamic_ideal' ),
92
+			'title'       => _x('Shop ID', 'sisow', 'pronamic_ideal'),
93 93
 			'type'        => 'text',
94
-			'classes'     => array( 'regular-text', 'code' ),
95
-			'tooltip'     => __( 'Shop ID as mentioned at <strong>My Profile</strong> in the Sisow dashboard.', 'pronamic_ideal' ),
94
+			'classes'     => array('regular-text', 'code'),
95
+			'tooltip'     => __('Shop ID as mentioned at <strong>My Profile</strong> in the Sisow dashboard.', 'pronamic_ideal'),
96 96
 			/* translators: %s: 0 */
97
-			'description' => sprintf( __( 'Default: <code>%s</code>', 'pronamic_ideal' ), 0 ),
97
+			'description' => sprintf(__('Default: <code>%s</code>', 'pronamic_ideal'), 0),
98 98
 			'default'     => 0,
99 99
 		);
100 100
 
101 101
 		// Transaction feedback.
102 102
 		$fields[] = array(
103 103
 			'section' => 'sisow',
104
-			'methods' => array( 'sisow' ),
105
-			'title'   => __( 'Transaction feedback', 'pronamic_ideal' ),
104
+			'methods' => array('sisow'),
105
+			'title'   => __('Transaction feedback', 'pronamic_ideal'),
106 106
 			'type'    => 'description',
107 107
 			'html'    => sprintf(
108 108
 				'<span class="dashicons dashicons-yes"></span> %s',
109
-				__( 'Payment status updates will be processed without any additional configuration.', 'pronamic_ideal' )
109
+				__('Payment status updates will be processed without any additional configuration.', 'pronamic_ideal')
110 110
 			),
111 111
 		);
112 112
 
Please login to merge, or discard this patch.
src/ConfigFactory.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,13 +29,13 @@
 block discarded – undo
29 29
 	 * @param int $post_id Post ID.
30 30
 	 * @return Config
31 31
 	 */
32
-	public function get_config( $post_id ) {
32
+	public function get_config($post_id) {
33 33
 		$config = new Config();
34 34
 
35
-		$config->merchant_id  = $this->get_meta( $post_id, 'sisow_merchant_id' );
36
-		$config->merchant_key = $this->get_meta( $post_id, 'sisow_merchant_key' );
37
-		$config->shop_id      = $this->get_meta( $post_id, 'sisow_shop_id' );
38
-		$config->mode         = $this->get_meta( $post_id, 'mode' );
35
+		$config->merchant_id  = $this->get_meta($post_id, 'sisow_merchant_id');
36
+		$config->merchant_key = $this->get_meta($post_id, 'sisow_merchant_key');
37
+		$config->shop_id      = $this->get_meta($post_id, 'sisow_shop_id');
38
+		$config->mode         = $this->get_meta($post_id, 'mode');
39 39
 
40 40
 		return $config;
41 41
 	}
Please login to merge, or discard this patch.
src/TransactionRequest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,24 +31,24 @@
 block discarded – undo
31 31
 	 */
32 32
 	public function get_signature_data() {
33 33
 		return array(
34
-			$this->get_parameter( 'purchaseid' ),
34
+			$this->get_parameter('purchaseid'),
35 35
 
36 36
 			/*
37 37
 			 * Wordt er geen gebruik gemaakt van de entrancecode dan dient er twee keer de purchaseid te worden opgenomen, u krijgt dan onderstaande volgorde.
38 38
 			 * purchaseid/purchaseid/amount/shopid/merchantid/merchantkey
39 39
 			 */
40
-			null !== $this->get_parameter( 'entrancecode' ) ? $this->get_parameter( 'entrancecode' ) : $this->get_parameter( 'purchaseid' ),
40
+			null !== $this->get_parameter('entrancecode') ? $this->get_parameter('entrancecode') : $this->get_parameter('purchaseid'),
41 41
 
42
-			$this->get_parameter( 'amount' ),
42
+			$this->get_parameter('amount'),
43 43
 
44 44
 			/*
45 45
 			 * Indien er geen gebruik wordt gemaakt van de shopid dan kunt u deze weglaten uit de berekening.
46 46
 			 */
47
-			$this->get_parameter( 'shopid' ),
47
+			$this->get_parameter('shopid'),
48 48
 
49
-			$this->get_parameter( 'merchantid' ),
49
+			$this->get_parameter('merchantid'),
50 50
 
51
-			$this->get_parameter( 'merchantkey' ),
51
+			$this->get_parameter('merchantkey'),
52 52
 		);
53 53
 	}
54 54
 }
Please login to merge, or discard this patch.
src/StatusRequest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -28,10 +28,10 @@  discard block
 block discarded – undo
28 28
 	 * @param string      $merchant_id    Merchant ID.
29 29
 	 * @param string|null $shop_id        Shop ID.
30 30
 	 */
31
-	public function __construct( $transaction_id, $merchant_id, $shop_id = null ) {
32
-		parent::__construct( $merchant_id, $shop_id );
31
+	public function __construct($transaction_id, $merchant_id, $shop_id = null) {
32
+		parent::__construct($merchant_id, $shop_id);
33 33
 
34
-		$this->set_parameter( 'trxid', $transaction_id );
34
+		$this->set_parameter('trxid', $transaction_id);
35 35
 	}
36 36
 
37 37
 	/**
@@ -41,16 +41,16 @@  discard block
 block discarded – undo
41 41
 	 */
42 42
 	public function get_signature_data() {
43 43
 		return array(
44
-			$this->get_parameter( 'trxid' ),
44
+			$this->get_parameter('trxid'),
45 45
 
46 46
 			/*
47 47
 			 * Indien er geen gebruik wordt gemaakt van de shopid dan kunt u deze weglaten uit de berekening.
48 48
 			 */
49
-			$this->get_parameter( 'shopid' ),
49
+			$this->get_parameter('shopid'),
50 50
 
51
-			$this->get_parameter( 'merchantid' ),
51
+			$this->get_parameter('merchantid'),
52 52
 
53
-			$this->get_parameter( 'merchantkey' ),
53
+			$this->get_parameter('merchantkey'),
54 54
 		);
55 55
 	}
56 56
 }
Please login to merge, or discard this patch.
src/Request.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
 	 * @param string      $merchant_id    Merchant ID.
38 38
 	 * @param string|null $shop_id        Shop ID.
39 39
 	 */
40
-	public function __construct( $merchant_id, $shop_id = null ) {
41
-		$this->set_parameter( 'merchantid', $merchant_id );
42
-		$this->set_parameter( 'shopid', $shop_id );
40
+	public function __construct($merchant_id, $shop_id = null) {
41
+		$this->set_parameter('merchantid', $merchant_id);
42
+		$this->set_parameter('shopid', $shop_id);
43 43
 	}
44 44
 
45 45
 	/**
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 	 * @param string $parameter Parameter.
49 49
 	 * @return string|null
50 50
 	 */
51
-	public function get_parameter( $parameter ) {
52
-		if ( isset( $this->parameters[ $parameter ] ) ) {
53
-			return $this->parameters[ $parameter ];
51
+	public function get_parameter($parameter) {
52
+		if (isset($this->parameters[$parameter])) {
53
+			return $this->parameters[$parameter];
54 54
 		}
55 55
 
56 56
 		return null;
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 	 * @param string      $parameter Parameter.
63 63
 	 * @param string|null $value     Value.
64 64
 	 */
65
-	public function set_parameter( $parameter, $value ) {
66
-		$this->parameters[ $parameter ] = $value;
65
+	public function set_parameter($parameter, $value) {
66
+		$this->parameters[$parameter] = $value;
67 67
 	}
68 68
 
69 69
 	/**
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
 	 *
81 81
 	 * @param array $parameters Parameters.
82 82
 	 */
83
-	public function merge_parameters( $parameters ) {
84
-		$this->parameters = array_merge( $this->parameters, $parameters );
83
+	public function merge_parameters($parameters) {
84
+		$this->parameters = array_merge($this->parameters, $parameters);
85 85
 	}
86 86
 
87 87
 	/**
@@ -99,14 +99,14 @@  discard block
 block discarded – undo
99 99
 	 * @param string $merchant_key Merchant key.
100 100
 	 * @return string
101 101
 	 */
102
-	public function get_signature( $merchant_key ) {
102
+	public function get_signature($merchant_key) {
103 103
 		$data = $this->get_signature_data();
104 104
 
105 105
 		$data[] = $merchant_key;
106 106
 
107
-		$string = implode( '', $data );
107
+		$string = implode('', $data);
108 108
 
109
-		$signature = sha1( $string );
109
+		$signature = sha1($string);
110 110
 
111 111
 		return $signature;
112 112
 	}
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
 	 *
117 117
 	 * @param string $merchant_key Merchant key.
118 118
 	 */
119
-	public function sign( $merchant_key ) {
120
-		$signature = $this->get_signature( $merchant_key );
119
+	public function sign($merchant_key) {
120
+		$signature = $this->get_signature($merchant_key);
121 121
 
122
-		$this->set_parameter( 'sha1', $signature );
122
+		$this->set_parameter('sha1', $signature);
123 123
 	}
124 124
 }
Please login to merge, or discard this patch.