Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions woocommerce/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*** SkyVerge WooCommerce Plugin Framework Changelog ***

2026.nn.nn - version 6.2.2
* Fix - Failed transaction attempt causes future attempts to fail when using Block checkout

2026.05.18 - version 6.2.1
* Fix - Protect against `ScriptHelper` fatal errors on plugin upgrades
Expand Down
28 changes: 20 additions & 8 deletions woocommerce/payment-gateway/class-sv-wc-payment-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -3070,17 +3070,22 @@ public function mark_order_as_failed( $order, $error_message, $response = null )

$this->add_debug_message( $error_message, 'error' );

$user_message = '';
// In Store API / REST context the message is returned in the process_payment()
// result and surfaced via RouteException; adding a session notice here leaks
// into the next request's cart validation (woocommerce_rest_cart_item_error 409).
if ( ! SV_WC_Helper::is_rest_api_request() ) {
$user_message = '';

if ( $response && $this->is_detailed_customer_decline_messages_enabled() ) {
$user_message = $response->get_user_message();
}

if ( $response && $this->is_detailed_customer_decline_messages_enabled() ) {
$user_message = $response->get_user_message();
}
if ( ! $user_message ) {
$user_message = esc_html__( 'An error occurred, please try again or try an alternate form of payment.', 'woocommerce-plugin-framework' );
}

if ( ! $user_message ) {
$user_message = esc_html__( 'An error occurred, please try again or try an alternate form of payment.', 'woocommerce-plugin-framework' );
SV_WC_Helper::wc_add_notice( $user_message, 'error' );
}
Comment thread
agibson-godaddy marked this conversation as resolved.

SV_WC_Helper::wc_add_notice( $user_message, 'error' );
}


Expand Down Expand Up @@ -3750,6 +3755,13 @@ public function add_debug_message( $message, ?string $type = 'message' ) : void
return;
}

// avoid adding notices on Store API / REST requests; the message is already returned in the
// response body and a session notice would leak into the next cart-validation request and
// surface as a 409 woocommerce_rest_cart_item_error.
if ( SV_WC_Helper::is_rest_api_request() ) {
return;
}
Comment thread
agibson-godaddy marked this conversation as resolved.

// add debug message to woocommerce->errors/messages if checkout or both is enabled, the admin/Ajax check ensures capture charge transactions aren't logged as notices to the front end
if ( ( $this->debug_checkout() || ( 'error' === $type && $this->is_test_environment() ) ) && ( ! is_admin() || wp_doing_ajax() ) ) {

Expand Down