woocommerce/woocommerce-gateway-stripe

Uncaught WC_Stripe_Exception and successfully paid order marked as failed.

Closed this issue · 0 comments

Describe the bug

An error of type E_ERROR was caused in line 156 of the file plugins/woocommerce-gateway-stripe/includes/class-wc-stripe-api.php. 

Error message: Uncaught WC_Stripe_Exception: WP_Error Object
(
    [errors] => Array
        (
            [http_request_failed] => Array
                (
                    [0] => cURL error 28: Resolving timed out after 10000 milliseconds
                )
        )
    [error_data] => Array
        (
        )
    [additional_data:protected] => Array
        (
        )
)
in plugins/woocommerce-gateway-stripe/includes/class-wc-stripe-api.php:156

Stack trace:
#0 plugins/woocommerce-gateway-stripe/includes/abstracts/abstract-wc-stripe-payment-gateway.php(1636): WC_Stripe_API::request(Array, 'payment_intents...', 'GET')

#1 plugins/woocommerce-gateway-stripe/includes/abstracts/abstract-wc-stripe-payment-gateway.php(1610): WC_Stripe_Payment_Gateway->get_intent('payment_intents', 'pi_3PilwHGTWu8R...')

#2 plugins/woocommerce-gateway-stripe/includes/admin/class-wc-stripe-settings-controller.php(53): WC_Stripe_Payment_Gateway->get_intent_from_order(Object(Automattic\WooCommerce\Admin\Overrides\Order))

#3 wp-includes/class-wp-hook.php(324): WC_Stripe_Settings_Controller->hide_refund_button_for_uncaptured_orders(Object(Automattic\WooCommerce\Admin\Overrides\Order))

#4 wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)

#5 wp-includes/plugin.php(517): WP_Hook->do_action(Array)

#6 plugins/woocommerce/includes/admin/meta-boxes/views/html-order-items.php(301): do_action('woocommerce_ord...', Object(Automattic\WooCommerce\Admin\Overrides\Order))

#7 plugins/woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-items.php(40): include('/srv/www/redacted...')

#8 wp-admin/includes/template.php(1456): WC_Meta_Box_Order_Items::output(NULL, Array)

#9 plugins/woocommerce/src/Internal/Admin/Orders/Edit.php(501): do_meta_boxes(Object(WP_Screen), 'normal', Object(Automattic\WooCommerce\Admin\Overrides\Order))

#10 plugins/woocommerce/src/Internal/Admin/Orders/Edit.php(405): Automattic\WooCommerce\Internal\Admin\Orders\Edit->render_meta_boxes()

#11 plugins/woocommerce/src/Internal/Admin/Orders/PageController.php(293): Automattic\WooCommerce\Internal\Admin\Orders\Edit->display()

#12 wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Internal\Admin\Orders\PageController->output('')

#13 wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)

#14 wp-includes/plugin.php(517): WP_Hook->do_action(Array)

#15 wp-admin/admin.php(259): do_action('woocommerce_pag...')

#16 {main}
thrown

To Reproduce
Steps to reproduce the behavior:

Sadly not sure. The payment intent in question completed successfully in Stripe at 0928, but was marked as failed in WooCommerce immediately. This error was triggered at 0953, some 25 minutes after the order. It appears this might coincide with the shop owner opening the order in the WP Admin, judging from the server error logs.

Expected behavior
Order to be marked as complete. No errors.

Screenshots
Screenshot 2024-08-01 at 11 54 47 AM

Screenshot 2024-08-01 at 11 55 56 AM

Environment (please complete the following information):

System Status Report
### WordPress Environment ###

WordPress address (URL): [Redacted]
Site address (URL): [Redacted]
WC Version: 9.1.4
Legacy REST API Package Version: The Legacy REST API plugin is not installed on this site.
Action Scheduler Version: ✔ 3.7.4
Log Directory Writable: ✔
WP Version: 6.6.1
WP Multisite: –
WP Memory Limit: 512 MB
WP Debug Mode: –
WP Cron: –
Language: en_AU
External object cache: ✔

### Server Environment ###

Server Info: nginx/1.23.4
PHP Version: 8.2.20
PHP Post Max Size: 30 MB
PHP Time Limit: 300
PHP Max Input Vars: 3000
cURL Version: 7.81.0
OpenSSL/3.0.2

SUHOSIN Installed: –
MySQL Version: 10.6.18-MariaDB-0ubuntu0.22.04.1
Max Upload Size: 30 MB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ❌ Your server does not have the SoapClient class enabled - some gateway plugins which use SOAP may not work as expected.
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

### Database ###

[REDACTED]

### Post Type Counts ###

attachment: 650
custom_css: 2
espresso_events: 1
et_footer_layout: 2
et_pb_layout: 27
et_template: 2
et_theme_builder: 1
event: 9
event_ticket: 307
event_ticket_email: 9
host: 11
memberpresscoupon: 41
memberpressproduct: 4
memberpressrule: 2
mp-reminder: 4
nav_menu_item: 31
oembed_cache: 6
page: 146
post: 77
product: 9
product_variation: 6
revision: 474
shop_coupon: 50
shop_order: 1217
shop_order_refund: 24
shop_subscription: 679
sp_lc_shortcodes: 1
sp_logo_carousel: 28
sponsor: 1
wc_membership_plan: 3
wc_user_membership: 700

### Security ###

Secure connection (HTTPS): ✔
Hide errors from visitors: ✔

### Active Plugins (38) ###

Gravity Forms: by Gravity Forms – 2.8.15
ACF OpenStreetMap Field: by Jörn Lund – 1.5.6
ActiveCampaign for WooCommerce: by ActiveCampaign – 2.7.5
Advanced Custom Fields PRO: by WP Engine – 6.3.4
The SEO Framework: by The SEO Framework Team – 5.0.6
Bloom: by Elegant Themes – 1.3.12
Classic Editor: by WordPress Contributors – 1.6.4
Yoast Duplicate Post: by Enrico Battocchi & Team Yoast – 4.5
EWWW Image Optimizer: by Exactly WWW – 7.8.0
Export Users to CSV: by Matt Cromwell – 1.1.1
Redacted Events: by Code& – 1.0.0
Good News Bear: by Code& – 1.3.0
Google Analytics for WordPress by MonsterInsights: by MonsterInsights – 9.0.0
Gravity PDF: by Blue Liquid Designs – 6.11.1
Gravity Forms Zero Spam: by GravityKit – 1.4.1
Gravity Forms ActiveCampaign Add-On: by Gravity Forms – 2.1.0
Gravity Forms Coupons Add-On: by Gravity Forms – 3.1
Gravity Forms Stripe Add-On: by Gravity Forms – 5.1.0
Smash Balloon Instagram Feed: by Smash Balloon – 6.4.3
KK Divi Blogger: by James King – 0.1.6
Logo Carousel: by ShapedPlugin LLC – 3.5.2
ActiveCampaign Postmark (Official): by Andrew Yates & Matt Gibbs – 1.20.0
Redirection: by John Godley – 5.4.2
Surbma | Divi & Gravity Forms: by Surbma – 5.1
Title Remover: by WPGurus – 1.2.1
UpdraftPlus - Backup/Restore: by UpdraftPlus.Com
DavidAnderson – 1.24.4

User Switching: by John Blackbourn – 1.8.0
WooCommerce Box Office: by WooCommerce – 1.2.6
WooCommerce Stripe Gateway: by WooCommerce – 8.5.2
WooCommerce Memberships: by SkyVerge – 1.26.7
WooCommerce Print Invoices/Packing Lists: by SkyVerge – 3.13.5
WooCommerce Subscriptions: by WooCommerce – 6.5.0
WooCommerce: by Automattic – 9.1.4
Code& WP Heartbeat: by Code& – 0.3
WP Migrate: by WP Engine – 2.6.13
WP-Optimize - Clean, Compress, Cache: by David Anderson
Ruhani Rabin
Team Updraft – 3.4.2

WP Redis: by Pantheon
Josh Koenig
Matthew Boynes
Daniel Bachhuber
Alley Interactive – 1.4.4

WP Statistics: by VeronaLabs – 14.9.3

### Inactive Plugins (2) ###

Akismet Anti-spam: Spam Protection: by Automattic - Anti-spam Team – 5.3.3
Classic Widgets: by WordPress Contributors – 0.3

### Dropin Plugins () ###

object-cache.php: object-cache.php

### Must Use Plugins (8) ###

Bedrock Autoloader: by Roots – 1.0.3
Block Editor Cleanup: by joshuafredrickson – 1.0.1
Disable Admin Notification of User Password Change: by Code& – 1.0.1
FW Migrate Subscriptions: by  –
ManageWP - Worker Loader: by GoDaddy – 1.0.0
PHPMailer SMTP: by Log1x & Code& – 1.0.0e
Remove 'Custom Fields' Meta Box: by Code& – 1.0.0
Version Control Developer Details: by Code& – 1.0.0

### Settings ###

API Enabled: –
Force SSL: –
Currency: AUD ($)
Currency Position: left
Thousand Separator: ,
Decimal Separator: .
Number of Decimals: 2
Taxonomies: Product Types: external (external)
grouped (grouped)
simple (simple)
subscription (subscription)
variable (variable)
variable subscription (variable-subscription)

Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
exclude-from-search (exclude-from-search)
featured (featured)
outofstock (outofstock)
rated-1 (rated-1)
rated-2 (rated-2)
rated-3 (rated-3)
rated-4 (rated-4)
rated-5 (rated-5)

Connected to WooCommerce.com: –
Enforce Approved Product Download Directories: ✔
HPOS feature enabled: ✔
Order datastore: Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore
HPOS data sync enabled: ✔

### Logging ###

Enabled: ✔
Handler: Automattic\WooCommerce\Internal\Admin\Logging\LogHandlerFileV2
Retention period: 30 days
Level threshold: –
Log directory size: 49 KB

### WC Pages ###

Shop base: #8594 - /shop/
Cart: #8595 - /cart/ -  Contains the woocommerce/cart block
Checkout: #8596 - /checkout/ -  Contains the [woocommerce_checkout] shortcode
My account: #8597 - /my-account/
Terms and conditions: ❌ Page not set

### Theme ###

Name: Redacted
Version: 1.0.1
Author URL: https://expertagency.com.au
Child Theme: ✔
Parent Theme Name: Divi
Parent Theme Version: 4.27.0
Parent Theme Author URL: http://www.elegantthemes.com
WooCommerce Support: ✔

### Templates ###

Overrides: –

### Memberships ###

Restriction mode:: Hide content only
Public content:: –
Excluded from discounts:: 4 products
Membership plans:: 3
Lifetime:: Members: 27Access method: Manual assignment onlyAccess length: Unlimited Subscription: No
Professional:: Members: 555Access method: Product(s) purchaseAccess length: Unlimited Subscription: YesInstallment plan: No No access-granting products are purchasable
Student:: Members: 118Access method: Product(s) purchaseAccess length: Unlimited Subscription: YesInstallment plan: No

### Subscriptions ###

WCS_DEBUG: ✔ No
Subscriptions Mode: ✔ Live
Subscriptions Live URL: https://redacted.com.au/wp
Subscriptions-core Library Version: 7.3.0
Subscription Statuses: trash: 2
wc-active: 406
wc-cancelled: 8
wc-on-hold: 262
wc-pending-cancel: 1

WooCommerce Account Connected: ❌ No
Custom Retry Rules: ✔ No
Custom Retry Rule Class: ✔ No
Custom Raw Retry Rule: ✔ No
Custom Retry Rule: ✔ No
Retries Migration Status: ✔ Completed
Report Cache Enabled: ✔ Yes
Cache Update Failures: ✔ 0 failure

### Store Setup ###

Country / State: Australia — New South Wales

### Subscriptions by Payment Gateway ###

Stripe: wc-active: 142
wc-cancelled: 3
wc-pending-cancel: 1


### Payment Gateway Support ###

Stripe: products
refunds
tokenization
add_payment_method
subscriptions
subscription_cancellation
subscription_suspension
subscription_reactivation
subscription_amount_changes
subscription_date_changes
subscription_payment_method_change
subscription_payment_method_change_customer
subscription_payment_method_change_admin
multiple_subscriptions


### Admin ###

Enabled Features: activity-panels
analytics
product-block-editor
coupons
core-profiler
customize-store
customer-effort-score-tracks
import-products-task
experimental-fashion-sample-products
shipping-smart-defaults
shipping-setting-tour
homescreen
marketing
mobile-app-banner
navigation
onboarding
onboarding-tasks
product-custom-fields
remote-inbox-notifications
remote-free-extensions
payment-gateway-suggestions
shipping-label-banner
subscriptions
store-alerts
transient-notices
woo-mobile-welcome
wc-pay-promotion
wc-pay-welcome-page
launch-your-store

Disabled Features: experimental-blocks
minified-js
pattern-toolkit-full-composability
product-pre-publish-modal
printful
settings
async-product-editor-category-field
product-editor-template-system

Daily Cron: ✔ Next scheduled: 2024-08-01 03:02:14 +10:00
Options: ✔
Notes: 58
Onboarding: completed

### Action Scheduler ###

Complete: 1,318
Oldest: 2024-07-01 12:03:42 +1000
Newest: 2024-08-01 11:52:09 +1000

Failed: 9
Oldest: 2024-03-13 14:02:20 +1100
Newest: 2024-05-08 13:15:10 +1000

Pending: 412
Oldest: 2024-08-01 11:56:57 +1000
Newest: 2027-03-08 10:13:22 +1100


### Status report information ###

Generated at: 2024-08-01 11:56:24 +10:00

Additional context
Resending the webhook from Stripe successfully triggered the order to change to 'Completed'.