woocommerce / woocommerce-gateway-stripe

The official Stripe Payment Gateway for WooCommerce
https://wordpress.org/plugins/woocommerce-gateway-stripe/
232 stars 203 forks source link

Idempotency keys not preventing duplicate charges in all cases #2339

Closed thelogicwizards closed 4 weeks ago

thelogicwizards commented 2 years ago

Describe the bug

We’re doing POST /payment_intents and the code only set Idempotency Key for /charges API.

@shendy-a8c says: "I see that here idempotency key is set only for charges API. Why only that specific API? I also see request() calls get_headers() and get_headers() used to set header Idempotency-Key but removed."

Ref. Ticket: 4925328-zd-woothemes

To Reproduce Steps to reproduce the behavior: I'm unable to reproduce this as it happens sporadically.

Context: a customer got charged 3 times for a subscriptions renewal where it should only be once. Setting idempotency key is a way to prevent duplicate charges. It’s still not clear that the problem is because the lack of idempotency key but during our investigation, we wonder about the question I ask above.

Expected behavior

No duplicate charges when idempotency keys are assigned to /payments-intent POST actions.

Environment:

System status report: 
`
### WordPress Environment ### WordPress address (URL): https://jumpconsulting.net
Site address (URL): https://jumpconsulting.net
WC Version: 6.3.1
REST API Version: ✔ 6.3.1
WC Blocks Version: ✔ 6.9.0
Action Scheduler Version: ✔ 3.4.0
WC Admin Version: ✔ 3.3.2
Log Directory Writable: ✔
WP Version: 5.9.3
WP Multisite: –
WP Memory Limit: 768 MB
WP Debug Mode: –
WP Cron: –
Language: en_US
External object cache: – ### Server Environment ### Server Info: Apache
PHP Version: 7.4.28
PHP Post Max Size: 256 MB
PHP Time Limit: 120
PHP Max Input Vars: 3000
cURL Version: 7.66.0
OpenSSL/1.1.1n-fips SUHOSIN Installed: –
MySQL Version: 5.7.32-35-log
Max Upload Size: 256 MB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔ ### Database ### WC Database Version: 6.1.2
WC Database Prefix: wp_
Total Database Size: 198.45MB
Database Data Size: 123.87MB
Database Index Size: 74.58MB
wp_woocommerce_sessions: Data: 2.02MB + Index: 0.05MB + Engine InnoDB
wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_downloadable_product_permissions: Data: 1.52MB + Index: 3.61MB + Engine InnoDB
wp_woocommerce_order_items: Data: 1.52MB + Index: 0.28MB + Engine InnoDB
wp_woocommerce_order_itemmeta: Data: 6.52MB + Index: 4.03MB + Engine InnoDB
wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_woocommerce_payment_tokens: Data: 0.06MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_payment_tokenmeta: Data: 0.09MB + Index: 0.13MB + Engine InnoDB
wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_actionscheduler_actions: Data: 3.52MB + Index: 2.06MB + Engine InnoDB
wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_actionscheduler_logs: Data: 1.52MB + Index: 1.92MB + Engine InnoDB
wp_ac_abandoned_cart_history_lite: Data: 0.36MB + Index: 0.00MB + Engine InnoDB
wp_ac_email_templates_lite: Data: 0.03MB + Index: 0.00MB + Engine InnoDB
wp_ac_guest_abandoned_cart_history_lite: Data: 0.05MB + Index: 0.00MB + Engine InnoDB
wp_ac_sent_history_lite: Data: 0.05MB + Index: 0.00MB + Engine InnoDB
wp_affiliate_wp_affiliatemeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_affiliate_wp_affiliates: Data: 0.09MB + Index: 0.05MB + Engine InnoDB
wp_affiliate_wp_campaigns: Data: 0.00MB + Index: 0.00MB + Engine
wp_affiliate_wp_creatives: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_affiliate_wp_customermeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_affiliate_wp_customers: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_affiliate_wp_payouts: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_affiliate_wp_referrals: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_affiliate_wp_rest_consumers: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_affiliate_wp_visits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_ajaxsearchpro: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_ajaxsearchpro_priorities: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_ajaxsearchpro_statistics: Data: 0.08MB + Index: 0.00MB + Engine InnoDB
wp_asp_index: Data: 14.56MB + Index: 29.13MB + Engine InnoDB
wp_asp_synonyms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_automatewoo_abandoned_carts: Data: 0.02MB + Index: 0.08MB + Engine InnoDB
wp_automatewoo_customers: Data: 0.14MB + Index: 0.42MB + Engine InnoDB
wp_automatewoo_events: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_automatewoo_guests: Data: 0.14MB + Index: 0.25MB + Engine InnoDB
wp_automatewoo_guest_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_automatewoo_logs: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_automatewoo_log_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_automatewoo_queue: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_automatewoo_queue_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_automatewoo_unsubscribes: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_ccpt_services: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_ccpt_transactions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
wp_commentmeta: Data: 0.04MB + Index: 0.01MB + Engine MyISAM
wp_comments: Data: 4.56MB + Index: 1.75MB + Engine MyISAM
wp_convertkit_user_history: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_cpk_wpcsv_export_queue: Data: 0.08MB + Index: 0.03MB + Engine MyISAM
wp_cpk_wpcsv_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
wp_custom_editor_buttons: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_formcraft_3_files: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_formcraft_3_forms: Data: 0.16MB + Index: 0.00MB + Engine InnoDB
wp_formcraft_3_progress: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_formcraft_3_submissions: Data: 0.05MB + Index: 0.00MB + Engine InnoDB
wp_formcraft_3_views: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_formcraft_b_forms: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
wp_formcraft_b_submissions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
wp_formcraft_b_views: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
wp_gf_addon_feed: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
wp_gf_draft_submissions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_gf_entry: Data: 0.28MB + Index: 0.06MB + Engine InnoDB
wp_gf_entry_meta: Data: 1.52MB + Index: 0.92MB + Engine InnoDB
wp_gf_entry_notes: Data: 0.09MB + Index: 0.03MB + Engine InnoDB
wp_gf_form: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_gf_form_meta: Data: 0.09MB + Index: 0.00MB + Engine InnoDB
wp_gf_form_revisions: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_gf_form_view: Data: 1.52MB + Index: 0.80MB + Engine InnoDB
wp_gf_rest_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_hfcm_scripts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_huge_it_videogallery_galleries: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
wp_huge_it_videogallery_videos: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
wp_hustle_modules: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_hustle_modules_meta: Data: 0.05MB + Index: 0.03MB + Engine InnoDB
wp_inbound_events: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_jig_ext_images: Data: 8.52MB + Index: 1.52MB + Engine InnoDB
wp_layerslider: Data: 0.05MB + Index: 0.00MB + Engine MyISAM
wp_layerslider_drafts: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_layerslider_revisions: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_links: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
wp_maxbuttonsv3: Data: 0.17MB + Index: 0.00MB + Engine InnoDB
wp_maxbuttons_buttons: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
wp_maxbuttons_clicks: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_maxbuttons_collections: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_maxbuttons_collections_trans: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_maxbuttons_pages: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_maxbuttons_visitors: Data: 0.05MB + Index: 0.00MB + Engine InnoDB
wp_mo_campaign_log: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_mo_campaign_logmeta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_mo_conversions: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_mo_email_campaignmeta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_mo_email_campaigns: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_mo_optin_campaignmeta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_mo_optin_campaigns: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_mts_wp_reviews: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_optimizepress_assets: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_optimizepress_launchfunnels: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_optimizepress_launchfunnels_pages: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_optimizepress_layout_categories: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_optimizepress_pb_products: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_optimizepress_post_layouts: Data: 0.14MB + Index: 0.00MB + Engine InnoDB
wp_optimizepress_predefined_layouts: Data: 1.52MB + Index: 0.00MB + Engine InnoDB
wp_optimizepress_presets: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_options: Data: 8.54MB + Index: 0.65MB + Engine MyISAM
wp_pmxi_files: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_pmxi_history: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_pmxi_imports: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_pmxi_posts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_pmxi_templates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_postmeta: Data: 28.74MB + Index: 12.11MB + Engine MyISAM
wp_posts: Data: 7.16MB + Index: 0.78MB + Engine MyISAM
wp_prli_clicks: Data: 2.19MB + Index: 1.38MB + Engine MyISAM
wp_prli_groups: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
wp_prli_links: Data: 0.01MB + Index: 0.03MB + Engine MyISAM
wp_prli_link_metas: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
wp_pty_daily: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_pty_filters: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
wp_pty_imps: Data: 0.63MB + Index: 0.24MB + Engine MyISAM
wp_pty_popups: Data: 0.02MB + Index: 0.00MB + Engine MyISAM
wp_pty_stats: Data: 0.04MB + Index: 0.01MB + Engine MyISAM
wp_redirection_404: Data: 0.36MB + Index: 0.22MB + Engine InnoDB
wp_redirection_groups: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_redirection_items: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
wp_redirection_logs: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_revslider_css: Data: 0.13MB + Index: 0.00MB + Engine InnoDB
wp_revslider_layer_animations: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_revslider_navigations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
wp_revslider_settings: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_revslider_sliders: Data: 0.06MB + Index: 0.00MB + Engine InnoDB
wp_revslider_slides: Data: 0.06MB + Index: 0.00MB + Engine InnoDB
wp_revslider_static_slides: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_rg_form: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
wp_rg_form_meta: Data: 0.05MB + Index: 0.00MB + Engine MyISAM
wp_rg_form_view: Data: 0.83MB + Index: 0.45MB + Engine MyISAM
wp_rg_incomplete_submissions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_rg_lead: Data: 0.12MB + Index: 0.02MB + Engine MyISAM
wp_rg_lead_detail: Data: 0.28MB + Index: 0.29MB + Engine MyISAM
wp_rg_lead_detail_long: Data: 0.07MB + Index: 0.00MB + Engine MyISAM
wp_rg_lead_meta: Data: 0.05MB + Index: 0.03MB + Engine MyISAM
wp_rg_lead_notes: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
wp_rg_mailchimp: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
wp_rst_events: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_smush_dir_images: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_snp_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_terms: Data: 0.42MB + Index: 0.56MB + Engine MyISAM
wp_term_relationships: Data: 0.26MB + Index: 0.51MB + Engine MyISAM
wp_term_taxonomy: Data: 0.38MB + Index: 0.64MB + Engine MyISAM
wp_testimonials_pro: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
wp_tm_taskmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_tm_tasks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_usermeta: Data: 2.65MB + Index: 1.18MB + Engine MyISAM
wp_users: Data: 0.10MB + Index: 0.08MB + Engine MyISAM
wp_wcs_payment_retries: Data: 0.06MB + Index: 0.02MB + Engine InnoDB
wp_wc_admin_notes: Data: 0.06MB + Index: 0.00MB + Engine InnoDB
wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wc_customer_lookup: Data: 0.08MB + Index: 0.06MB + Engine InnoDB
wp_wc_download_log: Data: 1.52MB + Index: 0.52MB + Engine InnoDB
wp_wc_order_coupon_lookup: Data: 0.08MB + Index: 0.11MB + Engine InnoDB
wp_wc_order_product_lookup: Data: 0.33MB + Index: 0.38MB + Engine InnoDB
wp_wc_order_stats: Data: 0.28MB + Index: 0.28MB + Engine InnoDB
wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_product_attributes_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_product_meta_lookup: Data: 0.05MB + Index: 0.09MB + Engine InnoDB
wp_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wfBadLeechers: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wfBlockedCommentLog: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wfBlockedIPLog: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wfBlocks7: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_wfConfig: Data: 0.45MB + Index: 0.00MB + Engine InnoDB
wp_wfCrawlers: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wfFileChanges: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wfFileMods: Data: 3.52MB + Index: 0.00MB + Engine InnoDB
wp_wfHits: Data: 1.52MB + Index: 0.41MB + Engine InnoDB
wp_wfHoover: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wfIssues: Data: 0.06MB + Index: 0.06MB + Engine InnoDB
wp_wfKnownFileList: Data: 1.52MB + Index: 0.00MB + Engine InnoDB
wp_wfLeechers: Data: 0.39MB + Index: 0.00MB + Engine InnoDB
wp_wfLiveTrafficHuman: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wfLocs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wfLogins: Data: 0.17MB + Index: 0.06MB + Engine InnoDB
wp_wfNet404s: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wfNotifications: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wfPendingIssues: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_wfReverseCache: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wfScanners: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wfSNIPCache: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_wfStatus: Data: 0.14MB + Index: 0.09MB + Engine InnoDB
wp_wfTrafficRates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wfVulnScanners: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_woocommerce_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woof_query_cache: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wpbiker_tool: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wpcreviews: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
wp_wpforms_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wp_phpmyadmin_extension__errors_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_yoast_indexable: Data: 3.52MB + Index: 1.75MB + Engine InnoDB
wp_yoast_indexable_hierarchy: Data: 0.05MB + Index: 0.05MB + Engine InnoDB
wp_yoast_migrations: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_yoast_primary_term: Data: 0.06MB + Index: 0.03MB + Engine InnoDB
wp_yoast_prominent_words: Data: 0.42MB + Index: 0.53MB + Engine InnoDB
wp_yoast_seo_links: Data: 1.52MB + Index: 1.95MB + Engine InnoDB
wp_yoast_seo_meta: Data: 1.52MB + Index: 0.00MB + Engine InnoDB ### Post Type Counts ### acp-coupons: 2
acp-order-summary: 29
acp-orders: 71
acp-products: 9
amn_exact-metrics: 1
amn_om: 1
attachment: 2481
avia_framework_post: 10
aw_workflow: 6
boxzilla-box: 1
cm-ad-item: 1
custom-css-js: 12
customize_changeset: 1
custom_css: 1
landing-page: 2
modalpopupbox: 1
nav_menu_item: 35
oembed_cache: 67
omapi: 1
page: 60
payment_retry: 68
popup: 1
popup_theme: 6
post: 699
pretty-link: 65
product: 147
product_variation: 22
revision: 26
safecss: 1
shop_coupon: 223
shop_order: 4410
shop_order_refund: 87
shop_subscription: 513
spb: 1
spucpt: 1
testimonials-widget: 44
wc_membership_plan: 1
wpcr3_review: 7
wpephpcompat_jobs: 25
wp_global_styles: 1 ### Security ### Secure connection (HTTPS): ✔
Hide errors from visitors: ✔ ### Active Plugins (37) ### Gravity Forms: by Gravity Forms – 2.6.1
Akismet Anti-Spam: by Automattic – 4.2.2
Autoptimize: by Frank Goossens (futtta) – 2.9.5.1
ConvertKit for WooCommerce: by ConvertKit – 1.4.5
ConvertKit for Gravity Forms: by ConvertKit – 1.2.2
ConvertKit: by ConvertKit – 1.9.7.3
Simple Custom CSS and JS: by SilkyPress.com – 3.39
Deadline Funnel: by Jack Born – 1.4.4
Google Tag Manager for Wordpress: by Thomas Geiger – 1.14.2
First payment date for WooCommerce Subscriptions: by Codection – 0.3.2
Fusebox Player: by Fusebox – 3.1.0
Google Analytics Dashboard for WP (GADWP): by ExactMetrics – 7.5.0
Gravity Forms + Custom Post Types: by Gravity Wiz – 3.1.26
Header Footer Code Manager: by 99robots – 1.1.20
iDevAffiliate WooCommerce Subscriptions Integration New: by iDevDirect.com LLC – 3.2
Justified Image Grid: by Firsh – 4.2.1
MaxButtons Pro: by Max Foundry – 9.1.1
Metorik Helper: by Metorik – 1.5.1
PixelYourSite: by PixelYourSite – 8.2.18
Blubrry PowerPress: by Blubrry – 9.0
Pretty Links: by Pretty Links – 3.2.4
Redirection: by John Godley – 5.2.3
Search Exclude: by Roman Pronskiy – 1.2.6
Simple 301 Redirects: by WPDeveloper – 2.0.6
Product Customer List for WooCommerce: by Kokomo – 3.0.4
Stripe Payment Transaction Title Settings: by Wolfiz Team – 1.1
Woo Coupon URL: by PersonalDiscount – 1.0.0
Abandoned Cart Lite for WooCommerce: by Tyche Softwares – 5.12.0
WooCommerce Admin: by WooCommerce – 3.3.2
WooCommerce Stripe Gateway: by WooCommerce – 6.3.0
WooCommerce Max Quantity: by Isabel Castillo – 1.5.2
WooCommerce Order Status Control: by SkyVerge – 1.14.0
WOOF - WooCommerce Products Filter: by realmag777 – 1.2.6.4
WooCommerce Subscriptions: by WooCommerce – 4.1.0
WooCommerce: by Automattic – 6.3.1
Yoast SEO Premium: by Team Yoast – 15.5
WP-Optimize - Clean, Compress, Cache: by David Anderson
Ruhani Rabin
Team Updraft – 3.2.3 ### Inactive Plugins (0) ### ### Dropin Plugins (1) ### advanced-cache.php: advanced-cache.php ### Settings ### API Enabled: ✔
Force SSL: ✔
Currency: USD ($)
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)
outofstock (outofstock-2)
rated-1 (rated-1)
rated-2 (rated-2)
rated-2 (rated-2-2)
rated-3 (rated-3)
rated-4 (rated-4)
rated-4 (rated-4-2)
rated-5 (rated-5) Connected to WooCommerce.com: ✔ ### WC Pages ### Shop base: #3654 - /shop/
Cart: #3464 - /cart/
Checkout: #3465 - /checkout/
My account: #4917 - /my-account/
Terms and conditions: #3532 - /legal/ ### Theme ### Name: Enfold Child
Version: 1.0
Author URL: http://www.kriesi.at
Child Theme: ✔
Parent Theme Name: Enfold
Parent Theme Version: 4.8.9.1
Parent Theme Author URL: https://kriesi.at
WooCommerce Support: ✔ ### Templates ### Overrides: enfold-child/woocommerce/emails/admin-cancelled-order.php
enfold-child/woocommerce/emails/admin-new-order.php ### Subscriptions ### WCS_DEBUG: ✔ No
Subscriptions Mode: ✔ Live
Subscriptions Live URL: https://jumpconsulting.net
Subscriptions Template Theme Overrides: enfold-child/woocommerce/emails/customer-payment-retry.php
Subscription Statuses: wc-active: 77
wc-expired: 117
wc-pending-cancel: 2
wc-pending: 1
wc-on-hold: 72
wc-cancelled: 244 WooCommerce Account Connected: ✔ Yes
Active Product Key: ✔ Yes
Custom Retry Rules: ✔ No
Custom Retry Rule Class: ✔ No
Custom Raw Retry Rule: ✔ No
Custom Retry Rule: ✔ No
Retries Migration Status: In-Progress
Report Cache Enabled: ✔ Yes
Cache Update Failures: ✔ 0 failure ### Store Setup ### Country / State: United States (US) — Arizona ### Subscriptions by Payment Gateway ### other: wc-cancelled: 64
wc-expired: 4
wc-on-hold: 5 Stripe: wc-active: 77
wc-cancelled: 159
wc-expired: 108
wc-on-hold: 61
wc-pending-cancel: 2 ### 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 ### Action Scheduler ### Complete: 6,660
Oldest: 2022-03-07 15:00:46 +0000
Newest: 2022-04-06 15:40:45 +0000 Failed: 14
Oldest: 2018-01-01 10:00:00 +0000
Newest: 2018-11-01 10:01:30 +0000 Pending: 104
Oldest: 2022-04-06 15:55:45 +0000
Newest: 2027-03-14 15:08:04 +0000 ### Status report information ### Generated at: 2022-04-06 08:47:46 -07:00
`

Additional context

woo-devs thread: p1649954264535539-slack-C7U3Y3VMY

fractal thread: p1650208215821769-slack-C01BZUL57SQ

thelogicwizards commented 2 years ago

4927886-zd-woothemes is also affected by this bug

dougaitken commented 2 years ago

Possibly related #2154

anant1811 commented 2 years ago

5568521-zen too

kaushikasomaiya commented 1 year ago

5702310-zen

User reports: 500 errors during checkout results into duplicate payments on Stripe.

Reaching out to Stripe support, they were told the following:

I can see that WooCommerce is using Idempotent requests which is good but they aren't using the same key between the same customer payments, this is why all the payment attempts that your customers make are passing as successful payments and as such, being double charged when they retry. This document might be helpful:

https://stripe.com/docs/api/idempotent_requests

Brianmitchtay commented 1 year ago

Seeing another potential instance of this in 5720452-zen

wpniall commented 1 year ago

Another suspected case in 5742689-zen

Brianmitchtay commented 1 year ago

Another case of mysterious intermittent duplicate charges in 5766596-zen

Brianmitchtay commented 1 year ago

Looks like another case of this in 5837055-zen, charges coming through in triplicate. Asking for Stripe API request logs for more insight about idempotency keys and details about the multiple requests

avantegarde commented 1 year ago

@Brianmitchtay In 5837055-zen, all of the idempotency keys are different between the payment intents. However, they mentioned this is happening with three different payment gateways. So most likely not related to this bug.

jacoswan commented 1 year ago

Also seen in 6273878-zen

xue28 commented 1 year ago

6365165-zen

neilmccreadie commented 1 year ago

6402513-zen

nicdwilson commented 8 months ago

7595135-zd-a8c - intermittent duplicates on a really busy checkout. Potentially caused by a failure during checkout, but the duplication is not being picked up or prevented. A shopper commented:

When attempting to place an order I got an error message saying it couldn't be processed. I refreshed my connection and tried again and the payment went through. However, I then got two order confirmations.

While I'm logging it here, I think it may better be suited to https://github.com/woocommerce/woocommerce-gateway-stripe/issues/2785?

nicdwilson commented 8 months ago

Also relevant: https://github.com/woocommerce/woocommerce/issues/41527

mattallan commented 4 weeks ago

Hey all, I'm revisiting some older issues labelled with priority:high and believe we can close this one.

Since this issue was open, we've implemented Stripe's Payment Intents API and based on Stripe's docs and my understanding of payment intents, they're designed to handle duplicate payments by managing the payment lifecycle, including retries etc. This feature/advantage of using payment intents was also mentioned here:

image

Still having double charges?

If stores are still experiencing double charges while on the latest Stripe version, it most likely won't be related to the absence of idempotency keys in the request headers. What it's likely due to is an issue with us not saving the payment intent on the order after it was created/confirmed, or us not properly re-using the payment intent.

Given the new potential issues are different to this opened issue, I'm going to close this and recommend we open a new issue to investigate the cause.