| @@ 178-181 (lines=4) @@ | ||
| 175 | $subscription = wc_get_order( $order_id ); |
|
| 176 | $prepared_source = $this->prepare_source( get_current_user_id(), true ); |
|
| 177 | ||
| 178 | if ( empty( $prepared_source->source ) ) { |
|
| 179 | $localized_message = __( 'Payment processing failed. Please retry.', 'woocommerce-gateway-stripe' ); |
|
| 180 | throw new WC_Stripe_Exception( print_r( $prepared_source, true ), $localized_message ); |
|
| 181 | } |
|
| 182 | ||
| 183 | $this->save_source_to_order( $subscription, $prepared_source ); |
|
| 184 | ||
| @@ 518-521 (lines=4) @@ | ||
| 515 | * @throws WC_Stripe_Exception An exception if the source ID is missing. |
|
| 516 | */ |
|
| 517 | public function check_source( $prepared_source ) { |
|
| 518 | if ( empty( $prepared_source->source ) ) { |
|
| 519 | $localized_message = __( 'Payment processing failed. Please retry.', 'woocommerce-gateway-stripe' ); |
|
| 520 | throw new WC_Stripe_Exception( print_r( $prepared_source, true ), $localized_message ); |
|
| 521 | } |
|
| 522 | } |
|
| 523 | ||
| 524 | /** |
|