| @@ 519-528 (lines=10) @@ | ||
| 516 | if ( $response->captured ) { |
|
| 517 | $order->payment_complete( $response->id ); |
|
| 518 | WC_Stripe::log( "Successful charge: $response->id" ); |
|
| 519 | } else { |
|
| 520 | add_post_meta( $order->id, '_transaction_id', $response->id, true ); |
|
| 521 | ||
| 522 | if ( $order->has_status( array( 'pending', 'failed' ) ) ) { |
|
| 523 | $order->reduce_order_stock(); |
|
| 524 | } |
|
| 525 | ||
| 526 | $order->update_status( 'on-hold', sprintf( __( 'Stripe charge authorized (Charge ID: %s). Process order to take payment, or cancel to remove the pre-authorization.', 'woocommerce-gateway-stripe' ), $response->id ) ); |
|
| 527 | WC_Stripe::log( "Successful auth: $response->id" ); |
|
| 528 | } |
|
| 529 | ||
| 530 | return $response; |
|
| 531 | } |
|
| @@ 657-666 (lines=10) @@ | ||
| 654 | $order->add_order_note( $message ); |
|
| 655 | WC_Stripe::log( 'Success: ' . $message ); |
|
| 656 | ||
| 657 | } else { |
|
| 658 | add_post_meta( $order->id, '_transaction_id', $response->id, true ); |
|
| 659 | ||
| 660 | if ( $order->has_status( array( 'pending', 'failed' ) ) ) { |
|
| 661 | $order->reduce_order_stock(); |
|
| 662 | } |
|
| 663 | ||
| 664 | $order->update_status( 'on-hold', sprintf( __( 'Stripe charge authorized (Charge ID: %s). Process order to take payment, or cancel to remove the pre-authorization.', 'woocommerce-gateway-stripe' ), $response->id ) ); |
|
| 665 | WC_Stripe::log( "Successful auth: $response->id" ); |
|
| 666 | } |
|
| 667 | ||
| 668 | return $response; |
|
| 669 | } |
|