Code Duplication    Length = 11-11 lines in 2 locations

includes/class-wc-stripe-apple-pay.php 1 location

@@ 611-621 (lines=11) @@
608
						throw new Exception( __( 'Unable to find shipping method for address.', 'woocommerce-gateway-stripe' ) );
609
					}
610
611
					foreach ( $package['rates'] as $key => $rate ) {
612
						$data[] = array(
613
							'id'       => $rate->id,
614
							'label'    => $rate->label,
615
							'amount'   => array(
616
								'currency' => $currency,
617
								'value'    => $rate->cost,
618
							),
619
							'selected' => false,
620
						);
621
					}
622
				}
623
624
				// Auto select the first shipping method.

includes/class-wc-stripe-payment-request.php 1 location

@@ 232-242 (lines=11) @@
229
					break;
230
				}
231
232
				foreach ( $package['rates'] as $key => $rate ) {
233
					$data[] = array(
234
						'id'       => $rate->id,
235
						'label'    => $rate->label,
236
						'amount'   => array(
237
							'currency' => $currency,
238
							'value'    => $rate->cost,
239
						),
240
						'selected' => false,
241
					);
242
				}
243
			}
244
		}
245