| @@ 104-106 (lines=3) @@ | ||
| 101 | */ |
|
| 102 | public function process_subscription_payment( $order = '', $amount = 0 ) { |
|
| 103 | ||
| 104 | if ( $amount * 100 < WC_Stripe::get_minimum_amount() ) { |
|
| 105 | 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 ) ) ); |
|
| 106 | } |
|
| 107 | ||
| 108 | // Get source from order |
|
| 109 | $source = $this->get_order_source( $order ); |
|
| @@ 150-152 (lines=3) @@ | ||
| 147 | try { |
|
| 148 | $order = wc_get_order( $order_id ); |
|
| 149 | ||
| 150 | if ( $order->get_total() * 100 < WC_Stripe::get_minimum_amount() ) { |
|
| 151 | 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 ) ) ); |
|
| 152 | } |
|
| 153 | ||
| 154 | $source = $this->get_source( get_current_user_id(), true ); |
|
| 155 | ||
| @@ 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 | ||
| @@ 628-630 (lines=3) @@ | ||
| 625 | // Handle payment. |
|
| 626 | if ( $order->get_total() > 0 ) { |
|
| 627 | ||
| 628 | if ( $order->get_total() * 100 < WC_Stripe::get_minimum_amount() ) { |
|
| 629 | 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 ) ) ); |
|
| 630 | } |
|
| 631 | ||
| 632 | WC_Stripe::log( "Info: Begin processing payment for order $order_id for the amount of {$order->get_total()}" ); |
|
| 633 | ||
| @@ 361-363 (lines=3) @@ | ||
| 358 | // Handle payment. |
|
| 359 | if ( $order->get_total() > 0 ) { |
|
| 360 | ||
| 361 | if ( $order->get_total() * 100 < WC_Stripe::get_minimum_amount() ) { |
|
| 362 | 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 ) ) ); |
|
| 363 | } |
|
| 364 | ||
| 365 | WC_Stripe::log( "Info: Begin processing payment for order $order->id for the amount of {$order->get_total()}" ); |
|
| 366 | ||