Code Duplication    Length = 3-3 lines in 2 locations

modules/widgets/simple-payments.php 2 locations

@@ 182-184 (lines=3) @@
179
			}
180
181
			$post_type_object = get_post_type_object( Jetpack_Simple_Payments::$post_type_product );
182
			if ( ! current_user_can( $post_type_object->cap->create_posts ) || ! current_user_can( $post_type_object->cap->publish_posts ) ) {
183
				wp_send_json_error( 'insufficient_post_permissions', 403 );
184
			}
185
186
			if ( empty( $_POST['params'] ) || ! is_array( $_POST['params'] ) ) {
187
				wp_send_json_error( 'missing_params', 400 );
@@ 147-149 (lines=3) @@
144
			}
145
146
			$post_type_object = get_post_type_object( Jetpack_Simple_Payments::$post_type_product );
147
			if ( ! current_user_can( $post_type_object->cap->create_posts ) || ! current_user_can( $post_type_object->cap->publish_posts ) ) {
148
				wp_send_json_error( 'insufficient_post_permissions', 403 );
149
			}
150
151
			$product_posts = get_posts(
152
				array(