| @@ 445-447 (lines=3) @@ | ||
| 442 | // Handle payment |
|
| 443 | if ( $order->get_total() > 0 ) { |
|
| 444 | ||
| 445 | if ( $order->get_total() * 100 < WC_Stripe::get_minimum_amount() ) { |
|
| 446 | throw new Exception( sprintf( __( 'Sorry, the minimum allowed order total is %1$s to use this payment method.', 'woocommerce-gateway-stripe' ), wc_price( WC_Stripe::get_minimum_amount() / 100 ) ) ); |
|
| 447 | } |
|
| 448 | ||
| 449 | WC_Stripe::log( "Info: Begin processing payment for order $order_id for the amount of {$order->get_total()}" ); |
|
| 450 | ||
| @@ 393-395 (lines=3) @@ | ||
| 390 | // Handle payment. |
|
| 391 | if ( $order->get_total() > 0 ) { |
|
| 392 | ||
| 393 | if ( $order->get_total() * 100 < WC_Stripe::get_minimum_amount() ) { |
|
| 394 | return new WP_Error( 'stripe_error', sprintf( __( 'Sorry, the minimum allowed order total is %1$s to use this payment method.', 'woocommerce-gateway-stripe' ), wc_price( WC_Stripe::get_minimum_amount() / 100 ) ) ); |
|
| 395 | } |
|
| 396 | ||
| 397 | WC_Stripe::log( "Info: Begin processing payment for order $order->id for the amount of {$order->get_total()}" ); |
|
| 398 | ||
| @@ 103-105 (lines=3) @@ | ||
| 100 | * @param bool initial_payment |
|
| 101 | */ |
|
| 102 | public function process_subscription_payment( $order = '', $amount = 0 ) { |
|
| 103 | if ( $amount * 100 < WC_Stripe::get_minimum_amount() ) { |
|
| 104 | return new WP_Error( 'stripe_error', sprintf( __( 'Sorry, the minimum allowed order total is %1$s to use this payment method.', 'woocommerce-gateway-stripe' ), wc_price( WC_Stripe::get_minimum_amount() / 100 ) ) ); |
|
| 105 | } |
|
| 106 | ||
| 107 | // Get source from order |
|
| 108 | $source = $this->get_order_source( $order ); |
|
| @@ 149-151 (lines=3) @@ | ||
| 146 | try { |
|
| 147 | $order = wc_get_order( $order_id ); |
|
| 148 | ||
| 149 | if ( $order->get_total() * 100 < WC_Stripe::get_minimum_amount() ) { |
|
| 150 | throw new Exception( sprintf( __( 'Sorry, the minimum allowed order total is %1$s to use this payment method.', 'woocommerce-gateway-stripe' ), wc_price( WC_Stripe::get_minimum_amount() / 100 ) ) ); |
|
| 151 | } |
|
| 152 | ||
| 153 | $source = $this->get_source( get_current_user_id(), true ); |
|
| 154 | ||
| @@ 634-636 (lines=3) @@ | ||
| 631 | // Handle payment. |
|
| 632 | if ( $order->get_total() > 0 ) { |
|
| 633 | ||
| 634 | if ( $order->get_total() * 100 < WC_Stripe::get_minimum_amount() ) { |
|
| 635 | throw new Exception( sprintf( __( 'Sorry, the minimum allowed order total is %1$s to use this payment method.', 'woocommerce-gateway-stripe' ), wc_price( WC_Stripe::get_minimum_amount() / 100 ) ) ); |
|
| 636 | } |
|
| 637 | ||
| 638 | $this->log( "Info: Begin processing payment for order $order_id for the amount of {$order->get_total()}" ); |
|
| 639 | ||