| @@ 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 | ||
| @@ 757-759 (lines=3) @@ | ||
| 754 | // Handle payment. |
|
| 755 | if ( $order->get_total() > 0 ) { |
|
| 756 | ||
| 757 | if ( $order->get_total() * 100 < WC_Stripe::get_minimum_amount() ) { |
|
| 758 | 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 ) ) ); |
|
| 759 | } |
|
| 760 | ||
| 761 | $this->log( "Info: Begin processing payment for order $order_id for the amount of {$order->get_total()}" ); |
|
| 762 | ||
| @@ 447-449 (lines=3) @@ | ||
| 444 | // Handle payment |
|
| 445 | if ( $order->get_total() > 0 ) { |
|
| 446 | ||
| 447 | if ( $order->get_total() * 100 < WC_Stripe::get_minimum_amount() ) { |
|
| 448 | 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 ) ) ); |
|
| 449 | } |
|
| 450 | ||
| 451 | WC_Stripe::log( "Info: Begin processing payment for order $order_id for the amount of {$order->get_total()}" ); |
|
| 452 | ||
| @@ 711-713 (lines=3) @@ | ||
| 708 | // Handle payment. |
|
| 709 | if ( $order->get_total() > 0 ) { |
|
| 710 | ||
| 711 | if ( $order->get_total() * 100 < WC_Stripe::get_minimum_amount() ) { |
|
| 712 | 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 ) ) ); |
|
| 713 | } |
|
| 714 | ||
| 715 | $this->log( "Info: Begin processing payment for order {$order_id} for the amount of {$order->get_total()}" ); |
|
| 716 | ||