Code Duplication    Length = 9-9 lines in 3 locations

includes/gateways/simplify-commerce/class-wc-addons-gateway-simplify-commerce.php 2 locations

@@ 93-101 (lines=9) @@
90
	 */
91
	protected function process_subscription( $order, $cart_token = '' ) {
92
		try {
93
			if ( empty( $cart_token ) ) {
94
				$error_msg = __( 'Please make sure your card details have been entered correctly and that your browser supports JavaScript.', 'woocommerce' );
95
96
				if ( 'yes' == $this->sandbox ) {
97
					$error_msg .= ' ' . __( 'Developers: Please make sure that you\'re including jQuery and there are no JavaScript errors on the page.', 'woocommerce' );
98
				}
99
100
				throw new Simplify_ApiException( $error_msg );
101
			}
102
103
			// Create customer
104
			$customer = Simplify_Customer::createCustomer( array(
@@ 187-195 (lines=9) @@
184
					throw new Simplify_ApiException( $error_msg );
185
				}
186
187
				if ( empty( $cart_token ) ) {
188
					$error_msg = __( 'Please make sure your card details have been entered correctly and that your browser supports JavaScript.', 'woocommerce' );
189
190
					if ( 'yes' == $this->sandbox ) {
191
						$error_msg .= ' ' . __( 'Developers: Please make sure that you\'re including jQuery and there are no JavaScript errors on the page.', 'woocommerce' );
192
					}
193
194
					throw new Simplify_ApiException( $error_msg );
195
				}
196
197
				// Create customer
198
				$customer = Simplify_Customer::createCustomer( array(

includes/gateways/simplify-commerce/class-wc-gateway-simplify-commerce.php 1 location

@@ 315-323 (lines=9) @@
312
	protected function process_standard_payments( $order, $cart_token = '' ) {
313
		try {
314
315
			if ( empty( $cart_token ) ) {
316
				$error_msg = __( 'Please make sure your card details have been entered correctly and that your browser supports JavaScript.', 'woocommerce' );
317
318
				if ( 'yes' == $this->sandbox ) {
319
					$error_msg .= ' ' . __( 'Developers: Please make sure that you\'re including jQuery and there are no JavaScript errors on the page.', 'woocommerce' );
320
				}
321
322
				throw new Simplify_ApiException( $error_msg );
323
			}
324
325
			$payment = Simplify_Payment::createPayment( array(
326
				'amount'              => $order->order_total * 100, // In cents.