@@ 494-497 (lines=4) @@ | ||
491 | * @throws WC_Stripe_Exception An exception if the source ID is missing. |
|
492 | */ |
|
493 | public function check_source( $prepared_source ) { |
|
494 | if ( empty( $prepared_source->source ) ) { |
|
495 | $localized_message = __( 'Payment processing failed. Please retry.', 'woocommerce-gateway-stripe' ); |
|
496 | throw new WC_Stripe_Exception( print_r( $prepared_source, true ), $localized_message ); |
|
497 | } |
|
498 | } |
|
499 | ||
500 | /** |
@@ 176-179 (lines=4) @@ | ||
173 | $subscription = wc_get_order( $order_id ); |
|
174 | $prepared_source = $this->prepare_source( get_current_user_id(), true ); |
|
175 | ||
176 | if ( empty( $prepared_source->source ) ) { |
|
177 | $localized_message = __( 'Payment processing failed. Please retry.', 'woocommerce-gateway-stripe' ); |
|
178 | throw new WC_Stripe_Exception( print_r( $prepared_source, true ), $localized_message ); |
|
179 | } |
|
180 | ||
181 | $this->save_source_to_order( $subscription, $prepared_source ); |
|
182 |