| @@ 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 | ||
| @@ 728-730 (lines=3) @@ | ||
| 725 | // Handle payment. |
|
| 726 | if ( $order->get_total() > 0 ) { |
|
| 727 | ||
| 728 | if ( $order->get_total() * 100 < WC_Stripe::get_minimum_amount() ) { |
|
| 729 | 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 ) ) ); |
|
| 730 | } |
|
| 731 | ||
| 732 | $this->log( "Info: Begin processing payment for order $order_id for the amount of {$order->get_total()}" ); |
|
| 733 | ||
| @@ 105-107 (lines=3) @@ | ||
| 102 | * @param bool initial_payment |
|
| 103 | */ |
|
| 104 | public function process_subscription_payment( $order = '', $amount = 0 ) { |
|
| 105 | if ( $amount * 100 < WC_Stripe::get_minimum_amount() ) { |
|
| 106 | 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 ) ) ); |
|
| 107 | } |
|
| 108 | ||
| 109 | // Get source from order |
|
| 110 | $source = $this->get_order_source( $order ); |
|
| @@ 152-154 (lines=3) @@ | ||
| 149 | try { |
|
| 150 | $order = wc_get_order( $order_id ); |
|
| 151 | ||
| 152 | if ( $order->get_total() * 100 < WC_Stripe::get_minimum_amount() ) { |
|
| 153 | 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 ) ) ); |
|
| 154 | } |
|
| 155 | ||
| 156 | $source = $this->get_source( get_current_user_id(), true ); |
|
| 157 | ||
| @@ 683-685 (lines=3) @@ | ||
| 680 | // Handle payment. |
|
| 681 | if ( $order->get_total() > 0 ) { |
|
| 682 | ||
| 683 | if ( $order->get_total() * 100 < WC_Stripe::get_minimum_amount() ) { |
|
| 684 | 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 ) ) ); |
|
| 685 | } |
|
| 686 | ||
| 687 | $this->log( "Info: Begin processing payment for order {$order_id} for the amount of {$order->get_total()}" ); |
|
| 688 | ||