Code Duplication    Length = 19-19 lines in 2 locations

woocommerce-gateway-stripe.php 2 locations

@@ 303-321 (lines=19) @@
300
			$show_request_api_notice = get_option( 'wc_stripe_show_request_api_notice' );
301
			$show_apple_pay_notice   = get_option( 'wc_stripe_show_apple_pay_notice' );
302
303
			if ( empty( $show_apple_pay_notice ) || 'yes' === $show_apple_pay_notice ) {
304
				// @TODO remove this notice in the future.
305
				?>
306
				<div class="notice notice-warning wc-stripe-apple-pay-notice is-dismissible"><p><?php esc_html_e( 'New Feature! Stripe now supports Apple Pay. Your customers can now purchase your products even faster. Apple Pay has been enabled by default.', 'woocommerce-gateway-stripe' ); ?></p></div>
307
308
				<script type="application/javascript">
309
					window.onload = function() {
310
						jQuery( '.wc-stripe-apple-pay-notice' ).on( 'click', '.notice-dismiss', function () {
311
							var data = {
312
								action: 'stripe_dismiss_apple_pay_notice'
313
							};
314
315
							jQuery.post( '<?php echo admin_url( 'admin-ajax.php' ); ?>', data );
316
						});
317
					}
318
				</script>
319
320
				<?php
321
			}
322
323
			if ( empty( $show_request_api_notice ) || 'yes' === $show_request_api_notice ) {
324
				// @TODO remove this notice in the future.
@@ 323-341 (lines=19) @@
320
				<?php
321
			}
322
323
			if ( empty( $show_request_api_notice ) || 'yes' === $show_request_api_notice ) {
324
				// @TODO remove this notice in the future.
325
				?>
326
				<div class="notice notice-warning wc-stripe-request-api-notice is-dismissible"><p><?php esc_html_e( 'New Feature! Stripe now supports Google Payment Request. Your customers can now use mobile phones with supported browsers such as Chrome to make purchases easier and faster.', 'woocommerce-gateway-stripe' ); ?></p></div>
327
				
328
				<script type="application/javascript">
329
					window.onload = function() {
330
						jQuery( '.wc-stripe-request-api-notice' ).on( 'click', '.notice-dismiss', function () {
331
							var data = {
332
								action: 'stripe_dismiss_request_api_notice'
333
							};
334
335
							jQuery.post( '<?php echo admin_url( 'admin-ajax.php' ); ?>', data );
336
						});
337
					}
338
				</script>
339
340
				<?php
341
			}
342
			
343
			foreach ( (array) $this->notices as $notice_key => $notice ) {
344
				echo "<div class='" . esc_attr( $notice['class'] ) . "'><p>";