@@ -31,10 +31,10 @@ |
||
31 | 31 | $this->provider = 'rabobank'; |
32 | 32 | |
33 | 33 | // Actions. |
34 | - $webhook_listener_function = array( __NAMESPACE__ . '\WebhookListener', 'listen' ); |
|
34 | + $webhook_listener_function = array(__NAMESPACE__ . '\WebhookListener', 'listen'); |
|
35 | 35 | |
36 | - if ( ! has_action( 'wp_loaded', $webhook_listener_function ) ) { |
|
37 | - add_action( 'wp_loaded', $webhook_listener_function ); |
|
36 | + if ( ! has_action('wp_loaded', $webhook_listener_function)) { |
|
37 | + add_action('wp_loaded', $webhook_listener_function); |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | * @param string $status Status. |
45 | 45 | * @param string $signature Signature. |
46 | 46 | */ |
47 | - public function __construct( $order_id, $status, $signature ) { |
|
48 | - parent::__construct( $signature ); |
|
47 | + public function __construct($order_id, $status, $signature) { |
|
48 | + parent::__construct($signature); |
|
49 | 49 | |
50 | 50 | $this->order_id = $order_id; |
51 | 51 | $this->status = $status; |
@@ -89,13 +89,13 @@ discard block |
||
89 | 89 | * @param array $data Data array. |
90 | 90 | * @return bool True if array contains return parameters, false otherwise. |
91 | 91 | */ |
92 | - public static function contains( array $data ) { |
|
92 | + public static function contains(array $data) { |
|
93 | 93 | return ( |
94 | - array_key_exists( 'order_id', $data ) |
|
94 | + array_key_exists('order_id', $data) |
|
95 | 95 | && |
96 | - array_key_exists( 'status', $data ) |
|
96 | + array_key_exists('status', $data) |
|
97 | 97 | && |
98 | - array_key_exists( 'signature', $data ) |
|
98 | + array_key_exists('signature', $data) |
|
99 | 99 | ); |
100 | 100 | } |
101 | 101 | |
@@ -106,17 +106,17 @@ discard block |
||
106 | 106 | * @return ReturnParameters |
107 | 107 | * @throws InvalidArgumentException Throws invalid argument exception when array does not contains the required keys. |
108 | 108 | */ |
109 | - public static function from_array( array $data ) { |
|
110 | - if ( ! array_key_exists( 'order_id', $data ) ) { |
|
111 | - throw new InvalidArgumentException( 'Data array must contain `order_id` field.' ); |
|
109 | + public static function from_array(array $data) { |
|
110 | + if ( ! array_key_exists('order_id', $data)) { |
|
111 | + throw new InvalidArgumentException('Data array must contain `order_id` field.'); |
|
112 | 112 | } |
113 | 113 | |
114 | - if ( ! array_key_exists( 'status', $data ) ) { |
|
115 | - throw new InvalidArgumentException( 'Data array must contain `status` field.' ); |
|
114 | + if ( ! array_key_exists('status', $data)) { |
|
115 | + throw new InvalidArgumentException('Data array must contain `status` field.'); |
|
116 | 116 | } |
117 | 117 | |
118 | - if ( ! array_key_exists( 'signature', $data ) ) { |
|
119 | - throw new InvalidArgumentException( 'Data array must contain `signature` field.' ); |
|
118 | + if ( ! array_key_exists('signature', $data)) { |
|
119 | + throw new InvalidArgumentException('Data array must contain `signature` field.'); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | return new self( |
@@ -23,7 +23,7 @@ |
||
23 | 23 | * |
24 | 24 | * @param string $signature Signature. |
25 | 25 | */ |
26 | - public function __construct( $signature ) { |
|
27 | - $this->set_signature( $signature ); |
|
26 | + public function __construct($signature) { |
|
27 | + $this->set_signature($signature); |
|
28 | 28 | } |
29 | 29 | } |
@@ -61,10 +61,10 @@ |
||
61 | 61 | * @return bool True if valid, false otherwise. |
62 | 62 | */ |
63 | 63 | public function is_access_token_valid() { |
64 | - if ( empty( $this->access_token ) ) { |
|
64 | + if (empty($this->access_token)) { |
|
65 | 65 | return false; |
66 | 66 | } |
67 | 67 | |
68 | - return strtotime( $this->access_token_valid_until ) > time(); |
|
68 | + return strtotime($this->access_token_valid_until) > time(); |
|
69 | 69 | } |
70 | 70 | } |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | * Constructs and initialize settings. |
25 | 25 | */ |
26 | 26 | public function __construct() { |
27 | - add_filter( 'pronamic_pay_gateway_sections', array( $this, 'sections' ) ); |
|
28 | - add_filter( 'pronamic_pay_gateway_fields', array( $this, 'fields' ) ); |
|
27 | + add_filter('pronamic_pay_gateway_sections', array($this, 'sections')); |
|
28 | + add_filter('pronamic_pay_gateway_fields', array($this, 'fields')); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -34,26 +34,26 @@ discard block |
||
34 | 34 | * @param array $sections Sections. |
35 | 35 | * @return array |
36 | 36 | */ |
37 | - public function sections( array $sections ) { |
|
37 | + public function sections(array $sections) { |
|
38 | 38 | $sections['omnikassa-2'] = array( |
39 | - 'title' => __( 'OmniKassa 2.0', 'pronamic_ideal' ), |
|
40 | - 'methods' => array( 'omnikassa-2' ), |
|
39 | + 'title' => __('OmniKassa 2.0', 'pronamic_ideal'), |
|
40 | + 'methods' => array('omnikassa-2'), |
|
41 | 41 | ); |
42 | 42 | |
43 | 43 | // Advanced. |
44 | 44 | $sections['omnikassa-2_advanced'] = array( |
45 | - 'title' => __( 'Advanced', 'pronamic_ideal' ), |
|
46 | - 'methods' => array( 'omnikassa-2' ), |
|
45 | + 'title' => __('Advanced', 'pronamic_ideal'), |
|
46 | + 'methods' => array('omnikassa-2'), |
|
47 | 47 | ); |
48 | 48 | |
49 | 49 | // Transaction feedback. |
50 | 50 | $sections['omnikassa-2_feedback'] = array( |
51 | - 'title' => __( 'Transaction feedback', 'pronamic_ideal' ), |
|
52 | - 'methods' => array( 'omnikassa-2' ), |
|
51 | + 'title' => __('Transaction feedback', 'pronamic_ideal'), |
|
52 | + 'methods' => array('omnikassa-2'), |
|
53 | 53 | 'description' => sprintf( |
54 | 54 | /* translators: %s: OmniKassa 2 */ |
55 | - __( 'Set the Webhook URL in the %s dashboard to receive automatic transaction status updates.', 'pronamic_ideal' ), |
|
56 | - __( 'OmniKassa 2.0', 'pronamic_ideal' ) |
|
55 | + __('Set the Webhook URL in the %s dashboard to receive automatic transaction status updates.', 'pronamic_ideal'), |
|
56 | + __('OmniKassa 2.0', 'pronamic_ideal') |
|
57 | 57 | ), |
58 | 58 | ); |
59 | 59 | |
@@ -66,15 +66,15 @@ discard block |
||
66 | 66 | * @param array $fields Fields. |
67 | 67 | * @return array |
68 | 68 | */ |
69 | - public function fields( array $fields ) { |
|
69 | + public function fields(array $fields) { |
|
70 | 70 | // Refresh Token. |
71 | 71 | $fields[] = array( |
72 | 72 | 'filter' => FILTER_SANITIZE_STRING, |
73 | 73 | 'section' => 'omnikassa-2', |
74 | 74 | 'meta_key' => '_pronamic_gateway_omnikassa_2_refresh_token', |
75 | - 'title' => _x( 'Refresh Token', 'omnikassa', 'pronamic_ideal' ), |
|
75 | + 'title' => _x('Refresh Token', 'omnikassa', 'pronamic_ideal'), |
|
76 | 76 | 'type' => 'textarea', |
77 | - 'classes' => array( 'code' ), |
|
77 | + 'classes' => array('code'), |
|
78 | 78 | ); |
79 | 79 | |
80 | 80 | // Signing Key. |
@@ -82,19 +82,19 @@ discard block |
||
82 | 82 | 'filter' => FILTER_SANITIZE_STRING, |
83 | 83 | 'section' => 'omnikassa-2', |
84 | 84 | 'meta_key' => '_pronamic_gateway_omnikassa_2_signing_key', |
85 | - 'title' => _x( 'Signing Key', 'omnikassa', 'pronamic_ideal' ), |
|
85 | + 'title' => _x('Signing Key', 'omnikassa', 'pronamic_ideal'), |
|
86 | 86 | 'type' => 'text', |
87 | - 'classes' => array( 'large-text', 'code' ), |
|
87 | + 'classes' => array('large-text', 'code'), |
|
88 | 88 | ); |
89 | 89 | |
90 | 90 | // Transaction feedback. |
91 | 91 | $fields[] = array( |
92 | 92 | 'section' => 'omnikassa-2', |
93 | - 'title' => __( 'Transaction feedback', 'pronamic_ideal' ), |
|
93 | + 'title' => __('Transaction feedback', 'pronamic_ideal'), |
|
94 | 94 | 'type' => 'description', |
95 | 95 | 'html' => sprintf( |
96 | 96 | '<span class="dashicons dashicons-warning"></span> %s', |
97 | - __( 'Receiving payment status updates needs additional configuration, if not yet completed.', 'pronamic_ideal' ) |
|
97 | + __('Receiving payment status updates needs additional configuration, if not yet completed.', 'pronamic_ideal') |
|
98 | 98 | ), |
99 | 99 | ); |
100 | 100 | |
@@ -103,17 +103,17 @@ discard block |
||
103 | 103 | 'filter' => FILTER_SANITIZE_STRING, |
104 | 104 | 'section' => 'omnikassa-2_advanced', |
105 | 105 | 'meta_key' => '_pronamic_gateway_omnikassa_2_order_id', |
106 | - 'title' => __( 'Order ID', 'pronamic_ideal' ), |
|
106 | + 'title' => __('Order ID', 'pronamic_ideal'), |
|
107 | 107 | 'type' => 'text', |
108 | - 'classes' => array( 'regular-text', 'code' ), |
|
108 | + 'classes' => array('regular-text', 'code'), |
|
109 | 109 | 'tooltip' => sprintf( |
110 | 110 | /* translators: %s: Parameter */ |
111 | - __( 'The OmniKassa %s parameter.', 'pronamic_ideal' ), |
|
112 | - sprintf( '<code>%s</code>', 'orderId' ) |
|
111 | + __('The OmniKassa %s parameter.', 'pronamic_ideal'), |
|
112 | + sprintf('<code>%s</code>', 'orderId') |
|
113 | 113 | ), |
114 | 114 | 'description' => sprintf( |
115 | 115 | '%s %s<br />%s', |
116 | - __( 'Available tags:', 'pronamic_ideal' ), |
|
116 | + __('Available tags:', 'pronamic_ideal'), |
|
117 | 117 | sprintf( |
118 | 118 | '<code>%s</code> <code>%s</code>', |
119 | 119 | '{order_id}', |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | ), |
122 | 122 | sprintf( |
123 | 123 | /* translators: %s: {payment_id} */ |
124 | - __( 'Default: <code>%s</code>', 'pronamic_ideal' ), |
|
124 | + __('Default: <code>%s</code>', 'pronamic_ideal'), |
|
125 | 125 | '{payment_id}' |
126 | 126 | ) |
127 | 127 | ), |
@@ -130,13 +130,13 @@ discard block |
||
130 | 130 | // Webhook. |
131 | 131 | $fields[] = array( |
132 | 132 | 'section' => 'omnikassa-2_feedback', |
133 | - 'title' => __( 'Webhook URL', 'pronamic_ideal' ), |
|
133 | + 'title' => __('Webhook URL', 'pronamic_ideal'), |
|
134 | 134 | 'type' => 'text', |
135 | - 'classes' => array( 'large-text', 'code' ), |
|
136 | - 'value' => add_query_arg( 'omnikassa2_webhook', '', home_url( '/' ) ), |
|
135 | + 'classes' => array('large-text', 'code'), |
|
136 | + 'value' => add_query_arg('omnikassa2_webhook', '', home_url('/')), |
|
137 | 137 | 'readonly' => true, |
138 | - 'methods' => array( 'omnikassa-2' ), |
|
139 | - 'tooltip' => __( 'The Webhook URL as sent with each transaction to receive automatic payment status updates on.', 'pronamic_ideal' ), |
|
138 | + 'methods' => array('omnikassa-2'), |
|
139 | + 'tooltip' => __('The Webhook URL as sent with each transaction to receive automatic payment status updates on.', 'pronamic_ideal'), |
|
140 | 140 | ); |
141 | 141 | |
142 | 142 | return $fields; |
@@ -54,8 +54,8 @@ |
||
54 | 54 | * @param string $status OmniKassa 2.0 status. |
55 | 55 | * @return string|null |
56 | 56 | */ |
57 | - public static function transform( $status ) { |
|
58 | - switch ( $status ) { |
|
57 | + public static function transform($status) { |
|
58 | + switch ($status) { |
|
59 | 59 | case self::CANCELLED: |
60 | 60 | return Core_Statuses::CANCELLED; |
61 | 61 | case self::COMPLETED: |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | * @param array $order_results Order results. |
48 | 48 | * @param string $signature Signature. |
49 | 49 | */ |
50 | - public function __construct( $more_available, array $order_results, $signature ) { |
|
51 | - parent::__construct( $signature ); |
|
50 | + public function __construct($more_available, array $order_results, $signature) { |
|
51 | + parent::__construct($signature); |
|
52 | 52 | |
53 | 53 | $this->more_available = $more_available; |
54 | 54 | $this->order_results = $order_results; |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | $data[] = $this->more_available() ? 'true' : 'false'; |
75 | 75 | |
76 | - foreach ( $this->order_results as $order_result ) { |
|
76 | + foreach ($this->order_results as $order_result) { |
|
77 | 77 | $data[] = $order_result->get_merchant_order_id(); |
78 | 78 | $data[] = $order_result->get_omnikassa_order_id(); |
79 | 79 | $data[] = $order_result->get_poi_id(); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @return ArrayIterator |
96 | 96 | */ |
97 | 97 | public function getIterator() { |
98 | - return new ArrayIterator( $this->order_results ); |
|
98 | + return new ArrayIterator($this->order_results); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -105,27 +105,27 @@ discard block |
||
105 | 105 | * @return OrderResults |
106 | 106 | * @throws InvalidArgumentException Throws invalid argument exception when object does not contains the required properties. |
107 | 107 | */ |
108 | - public static function from_object( stdClass $object ) { |
|
109 | - if ( ! isset( $object->signature ) ) { |
|
110 | - throw new InvalidArgumentException( 'Object must contain `signature` property.' ); |
|
108 | + public static function from_object(stdClass $object) { |
|
109 | + if ( ! isset($object->signature)) { |
|
110 | + throw new InvalidArgumentException('Object must contain `signature` property.'); |
|
111 | 111 | } |
112 | 112 | |
113 | - if ( ! isset( $object->moreOrderResultsAvailable ) ) { |
|
114 | - throw new InvalidArgumentException( 'Object must contain `moreOrderResultsAvailable` property.' ); |
|
113 | + if ( ! isset($object->moreOrderResultsAvailable)) { |
|
114 | + throw new InvalidArgumentException('Object must contain `moreOrderResultsAvailable` property.'); |
|
115 | 115 | } |
116 | 116 | |
117 | - if ( ! isset( $object->orderResults ) ) { |
|
118 | - throw new InvalidArgumentException( 'Object must contain `orderResults` property.' ); |
|
117 | + if ( ! isset($object->orderResults)) { |
|
118 | + throw new InvalidArgumentException('Object must contain `orderResults` property.'); |
|
119 | 119 | } |
120 | 120 | |
121 | - if ( ! is_array( $object->orderResults ) ) { |
|
122 | - throw new InvalidArgumentException( 'The `orderResults` property must be an array.' ); |
|
121 | + if ( ! is_array($object->orderResults)) { |
|
122 | + throw new InvalidArgumentException('The `orderResults` property must be an array.'); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | $order_results = array(); |
126 | 126 | |
127 | - foreach ( $object->orderResults as $o ) { |
|
128 | - $order_results[] = OrderResult::from_object( $o ); |
|
127 | + foreach ($object->orderResults as $o) { |
|
128 | + $order_results[] = OrderResult::from_object($o); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | return new self( |
@@ -142,19 +142,19 @@ discard block |
||
142 | 142 | * @return OrderResults |
143 | 143 | * @throws \JsonSchema\Exception\ValidationException Throws JSON schema validation exception when JSON is invalid. |
144 | 144 | */ |
145 | - public static function from_json( $json ) { |
|
146 | - $data = json_decode( $json ); |
|
145 | + public static function from_json($json) { |
|
146 | + $data = json_decode($json); |
|
147 | 147 | |
148 | 148 | $validator = new Validator(); |
149 | 149 | |
150 | 150 | $validator->validate( |
151 | 151 | $data, |
152 | 152 | (object) array( |
153 | - '$ref' => 'file://' . realpath( __DIR__ . '/../json-schemas/order-results.json' ), |
|
153 | + '$ref' => 'file://' . realpath(__DIR__ . '/../json-schemas/order-results.json'), |
|
154 | 154 | ), |
155 | 155 | Constraint::CHECK_MODE_EXCEPTIONS |
156 | 156 | ); |
157 | 157 | |
158 | - return self::from_object( $data ); |
|
158 | + return self::from_object($data); |
|
159 | 159 | } |
160 | 160 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * |
86 | 86 | * @param string $url URL. |
87 | 87 | */ |
88 | - public function set_url( $url ) { |
|
88 | + public function set_url($url) { |
|
89 | 89 | $this->url = $url; |
90 | 90 | } |
91 | 91 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * |
104 | 104 | * @param string $refresh_token Refresh token. |
105 | 105 | */ |
106 | - public function set_refresh_token( $refresh_token ) { |
|
106 | + public function set_refresh_token($refresh_token) { |
|
107 | 107 | $this->refresh_token = $refresh_token; |
108 | 108 | } |
109 | 109 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | * |
122 | 122 | * @param string $signing_key Signing key. |
123 | 123 | */ |
124 | - public function set_signing_key( $signing_key ) { |
|
124 | + public function set_signing_key($signing_key) { |
|
125 | 125 | $this->signing_key = $signing_key; |
126 | 126 | } |
127 | 127 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | * @param string $token Authorization token. |
134 | 134 | * @param object|null $object Object. |
135 | 135 | */ |
136 | - private function request( $method, $endpoint, $token, $object = null ) { |
|
136 | + private function request($method, $endpoint, $token, $object = null) { |
|
137 | 137 | // URL. |
138 | 138 | $url = $this->get_url() . $endpoint; |
139 | 139 | |
@@ -145,45 +145,45 @@ discard block |
||
145 | 145 | ), |
146 | 146 | ); |
147 | 147 | |
148 | - if ( null !== $object ) { |
|
148 | + if (null !== $object) { |
|
149 | 149 | $args['headers']['Content-Type'] = 'application/json'; |
150 | 150 | |
151 | - $args['body'] = wp_json_encode( $object ); |
|
151 | + $args['body'] = wp_json_encode($object); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | // Request. |
155 | - $response = wp_remote_request( $url, $args ); |
|
155 | + $response = wp_remote_request($url, $args); |
|
156 | 156 | |
157 | - if ( $response instanceof WP_Error ) { |
|
157 | + if ($response instanceof WP_Error) { |
|
158 | 158 | $this->error = $response; |
159 | 159 | |
160 | - $this->error->add( 'omnikassa_2_error', 'HTTP Request Failed' ); |
|
160 | + $this->error->add('omnikassa_2_error', 'HTTP Request Failed'); |
|
161 | 161 | |
162 | 162 | return false; |
163 | 163 | } |
164 | 164 | |
165 | 165 | // Body. |
166 | - $body = wp_remote_retrieve_body( $response ); |
|
166 | + $body = wp_remote_retrieve_body($response); |
|
167 | 167 | |
168 | - $data = json_decode( $body ); |
|
168 | + $data = json_decode($body); |
|
169 | 169 | |
170 | - if ( ! is_object( $data ) ) { |
|
171 | - $this->error = new WP_Error( 'omnikassa_2_error', 'Could not parse response.', $data ); |
|
170 | + if ( ! is_object($data)) { |
|
171 | + $this->error = new WP_Error('omnikassa_2_error', 'Could not parse response.', $data); |
|
172 | 172 | |
173 | 173 | return false; |
174 | 174 | } |
175 | 175 | |
176 | 176 | // Error. |
177 | - if ( isset( $data->errorCode ) ) { |
|
177 | + if (isset($data->errorCode)) { |
|
178 | 178 | $message = 'Unknown error.'; |
179 | 179 | |
180 | - if ( isset( $data->consumerMessage ) ) { |
|
180 | + if (isset($data->consumerMessage)) { |
|
181 | 181 | $message = $data->consumerMessage; |
182 | - } elseif ( isset( $data->errorMessage ) ) { |
|
182 | + } elseif (isset($data->errorMessage)) { |
|
183 | 183 | $message = $data->errorMessage; |
184 | 184 | } |
185 | 185 | |
186 | - $this->error = new WP_Error( 'omnikassa_2_error', $message, $data ); |
|
186 | + $this->error = new WP_Error('omnikassa_2_error', $message, $data); |
|
187 | 187 | |
188 | 188 | return false; |
189 | 189 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | * @return object|false |
199 | 199 | */ |
200 | 200 | public function get_access_token_data() { |
201 | - return $this->request( 'GET', 'gatekeeper/refresh', $this->get_refresh_token() ); |
|
201 | + return $this->request('GET', 'gatekeeper/refresh', $this->get_refresh_token()); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | /** |
@@ -208,12 +208,12 @@ discard block |
||
208 | 208 | * @param Order $order Order. |
209 | 209 | * @return object|bool |
210 | 210 | */ |
211 | - public function order_announce( $config, Order $order ) { |
|
211 | + public function order_announce($config, Order $order) { |
|
212 | 212 | $object = $order->get_json(); |
213 | 213 | |
214 | - $object->signature = Security::get_signature( $order, $config->signing_key ); |
|
214 | + $object->signature = Security::get_signature($order, $config->signing_key); |
|
215 | 215 | |
216 | - return $this->request( 'POST', 'order/server/api/order', $config->access_token, $object ); |
|
216 | + return $this->request('POST', 'order/server/api/order', $config->access_token, $object); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | /** |
@@ -223,13 +223,13 @@ discard block |
||
223 | 223 | * |
224 | 224 | * @return OrderResults|false |
225 | 225 | */ |
226 | - public function get_order_results( $notification_token ) { |
|
227 | - $result = $this->request( 'GET', 'order/server/api/events/results/merchant.order.status.changed', $notification_token ); |
|
226 | + public function get_order_results($notification_token) { |
|
227 | + $result = $this->request('GET', 'order/server/api/events/results/merchant.order.status.changed', $notification_token); |
|
228 | 228 | |
229 | - if ( ! is_object( $result ) ) { |
|
229 | + if ( ! is_object($result)) { |
|
230 | 230 | return false; |
231 | 231 | } |
232 | 232 | |
233 | - return OrderResults::from_object( $result ); |
|
233 | + return OrderResults::from_object($result); |
|
234 | 234 | } |
235 | 235 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * |
40 | 40 | * @param string $signature Signature. |
41 | 41 | */ |
42 | - protected function set_signature( $signature ) { |
|
42 | + protected function set_signature($signature) { |
|
43 | 43 | $this->signature = $signature; |
44 | 44 | } |
45 | 45 | |
@@ -49,13 +49,13 @@ discard block |
||
49 | 49 | * @param string $signing_key Signing key. |
50 | 50 | * @return bool True if valid, false otherwise. |
51 | 51 | */ |
52 | - public function is_valid( $signing_key ) { |
|
53 | - $signature = Security::get_signature( $this, $signing_key ); |
|
52 | + public function is_valid($signing_key) { |
|
53 | + $signature = Security::get_signature($this, $signing_key); |
|
54 | 54 | |
55 | - if ( empty( $signature ) ) { |
|
55 | + if (empty($signature)) { |
|
56 | 56 | return false; |
57 | 57 | } |
58 | 58 | |
59 | - return Security::validate_signature( $signature, $this->get_signature() ); |
|
59 | + return Security::validate_signature($signature, $this->get_signature()); |
|
60 | 60 | } |
61 | 61 | } |