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

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