Code Duplication    Length = 11-11 lines in 2 locations

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

@@ 626-636 (lines=11) @@
623
						throw new Exception( __( 'Unable to find shipping method for address.', 'woocommerce-gateway-stripe' ) );
624
					}
625
626
					foreach ( $package['rates'] as $key => $rate ) {
627
						$data[] = array(
628
							'id'       => $rate->id,
629
							'label'    => $rate->label,
630
							'amount'   => array(
631
								'currency' => $currency,
632
								'value'    => $rate->cost,
633
							),
634
							'selected' => false,
635
						);
636
					}
637
				}
638
639
				// Auto select the first shipping method.

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

@@ 245-255 (lines=11) @@
242
					break;
243
				}
244
245
				foreach ( $package['rates'] as $key => $rate ) {
246
					$data[] = array(
247
						'id'       => $rate->id,
248
						'label'    => $rate->label,
249
						'amount'   => array(
250
							'currency' => $currency,
251
							'value'    => $rate->cost,
252
						),
253
						'selected' => false,
254
					);
255
				}
256
			}
257
		}
258