Code Duplication    Length = 19-20 lines in 2 locations

includes/gateways/bacs/class-wc-gateway-bacs.php 1 location

@@ 332-351 (lines=20) @@
329
	 * @param int $order_id
330
	 * @return array
331
	 */
332
	public function process_payment( $order_id ) {
333
334
		$order = wc_get_order( $order_id );
335
336
		// Mark as on-hold (we're awaiting the payment)
337
		$order->update_status( 'on-hold', __( 'Awaiting BACS payment', 'woocommerce' ) );
338
339
		// Reduce stock levels
340
		$order->reduce_order_stock();
341
342
		// Remove cart
343
		WC()->cart->empty_cart();
344
345
		// Return thankyou redirect
346
		return array(
347
			'result'    => 'success',
348
			'redirect'  => $this->get_return_url( $order )
349
		);
350
351
	}
352
353
	/**
354
	 * Get country locale if localized.

includes/gateways/cheque/class-wc-gateway-cheque.php 1 location

@@ 111-129 (lines=19) @@
108
     * @param int $order_id
109
     * @return array
110
     */
111
	public function process_payment( $order_id ) {
112
113
		$order = wc_get_order( $order_id );
114
115
		// Mark as on-hold (we're awaiting the cheque)
116
		$order->update_status( 'on-hold', _x( 'Awaiting check payment', 'Check payment method', 'woocommerce' ) );
117
118
		// Reduce stock levels
119
		$order->reduce_order_stock();
120
121
		// Remove cart
122
		WC()->cart->empty_cart();
123
124
		// Return thankyou redirect
125
		return array(
126
			'result' 	=> 'success',
127
			'redirect'	=> $this->get_return_url( $order )
128
		);
129
	}
130
}
131