• Resolved Marc

    (@marcfonteijn)


    Since this morning, my site has experienced extremely slow page load times (25+ seconds). Upon investigation, it appears the WooCommerce Stripe Gateway plugin is making an excessive number of API calls to Stripe on every page load, leading to 429 Too Many Requests errors from the Stripe API. Disabling the Stripe Gateway plugin immediately resolves the slow page load issue.

    I noticed a dashboard message this morning related to updating SEPA payment methods (or similar wording). I suspect this issue might be related to how the plugin is handling the retrieval or validation of payment method configurations after that update notice appeared.

    Observations / Steps to Reproduce:

    1. Activate the WooCommerce Stripe Gateway plugin
    2. Load any page on the backend
    3. Observe HTTP requests using Query Monitor
    4. Notice dozens (50+) of sequential API calls being made to https://api.stripe.com/v1/payment_method_configurations. It seems one call is made for each “Stripe Payment Method ID”.
    5. The first ~50 calls return successfully (HTTP 200).
    6. Subsequent calls to the same endpoint during the same page load start failing with HTTP 429 Too Many Requests.
    7. The page load takes significantly longer (e.g., 25+ seconds) due to these repeated API calls and errors.

    Stacktrace of the API Call

    WC_Stripe_API::retrieve()
    wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-stripe-api.php:236
    WC_Stripe_API->get_payment_method_configurations()
    wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-stripe-api.php:473
    WC_Stripe_Payment_Method_Configurations::get_primary_configuration()
    wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-stripe-payment-method-configurations.php:49
    WC_Stripe_Payment_Method_Configurations::get_upe_enabled_payment_method_ids()
    wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-stripe-payment-method-configurations.php:88
    WC_Stripe_UPE_Payment_Method->get_upe_enabled_payment_method_ids()
    wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-upe-payment-method.php:768
    WC_Stripe_UPE_Payment_Method->__construct()
    wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-upe-payment-method.php:129
    WC_Stripe_UPE_Payment_Method_Klarna->__construct()
    wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-upe-payment-method-klarna.php:17
    WC_Stripe_Admin_Notices->payment_methods_check_environment()
    wp-content/plugins/woocommerce-gateway-stripe/includes/admin/class-wc-stripe-admin-notices.php:440
    WC_Stripe_Admin_Notices->admin_notices()
    wp-content/plugins/woocommerce-gateway-stripe/includes/admin/class-wc-stripe-admin-notices.php:67
    do_action('admin_notices')
    wp-includes/plugin.php:517

    Environment:

    • WordPress: 6.8
    • WooCommerce: 9.8.1
    • WooCommerce Stripe Gateway: 9.4.0
    • WooCommerce Subscriptions: 7.4.0
    • This topic was modified 1 year, 1 month ago by Marc.
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Excessive API Calls to payment_method_configurations Causing 429 Errors’ is closed to new replies.