woocommerce/woocommerce-gateway-stripe

PHP message: id was called incorrectly. - Customer won't get redirected to Thank You page - Error: There was an error processing your order

Closed this issue · 1 comments

Describe the bug
On frontend after a successful payment the user gets an error message causing multiple orders in WC, but also multiple charges for customers.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Shop page, add anything to cart
  2. Go to checkout
  3. Fill up the fields
  4. Select Stripe as checkout (I have tested it in with test mode enabled, but if it is disabled, same behavior)
  5. Fill up card data then click on pay -> Error comes on frontend, BUT it actually charges the card and also creates the order in the database with PROCESSING status, so everything works fine except for the user on the frontend.

Expected behavior
Expected behavior is that the user gets redirected to WooCommerce "Thank you" page after a successful payment.

Screenshots
image
Screenshot 2024-07-02 at 10 06 39

Environment (please complete the following information):

  • WordPress Version: 6.5.5
  • WooCommerce Version: 9.0.2
  • Stripe Plugin Version: 8.3.1
  • Browser [e.g. chrome, safari] and Version: tested in newest Chrome and Firefox on MAC, also newest Chrome and Firefox on Windows.
  • Any other plugins installed: only Elementor and Elementor PRO. We tested in staging with the other plugins disabled of course.

Additional context
Maybe has something to do with this PR: woocommerce/woocommerce#48348
But that is only an assumption.
Until the 21. June 2024 everything was working fine.
We update all the plugins and WP every week once.

DEBUG LOG:

2024-07-02T07:40:42+00:00 Debug 
====Stripe Version: 8.3.1====
====Stripe Plugin API Version: 2019-09-09====
====Start Log====
Info: Begin processing payment for order **[HIDDEN_PRIVACY_REASONS]** for the amount of 76.85
====End Log====

2024-07-02T07:40:42+00:00 Debug 
====Stripe Version: 8.3.1====
====Stripe Plugin API Version: 2019-09-09====
====Start Log====
payment_intents request: Array
(
    [amount] => 7685
    [currency] => eur
    [description] => entsorgo - Bestellung **[HIDDEN_PRIVACY_REASONS]**
    [metadata] => Array
        (
            [customer_name] => **[HIDDEN_PRIVACY_REASONS]**
            [customer_email] => **[HIDDEN_PRIVACY_REASONS]**
            [order_id] => **[HIDDEN_PRIVACY_REASONS]**
            [site_url] => https://www.entsorgo.de
        )

    [capture_method] => automatic
    [payment_method_types] => Array
        (
            [0] => card
        )

    [payment_method] => pm_**[HIDDEN_PRIVACY_REASONS]**
    [customer] => cus_**[HIDDEN_PRIVACY_REASONS]**
    [shipping] => Array
        (
            [name] => **[HIDDEN_PRIVACY_REASONS]**
            [address] => Array
                (
                    [line1] => **[HIDDEN_PRIVACY_REASONS]**
                    [line2] => 
                    [city] => **[HIDDEN_PRIVACY_REASONS]**
                    [country] => DE
                    [postal_code] => **[HIDDEN_PRIVACY_REASONS]**
                    [state] => **[HIDDEN_PRIVACY_REASONS]**
                )

        )

)

====End Log====

2024-07-02T07:40:43+00:00 Debug 
====Stripe Version: 8.3.1====
====Stripe Plugin API Version: 2019-09-09====
====Start Log====
payment_intents response with stripe-version: 2019-09-09
====End Log====

2024-07-02T07:40:43+00:00 Debug 
====Stripe Version: 8.3.1====
====Stripe Plugin API Version: 2019-09-09====
====Start Log====
Stripe PaymentIntent pi_**[HIDDEN_PRIVACY_REASONS]** initiated for order **[HIDDEN_PRIVACY_REASONS]**
====End Log====

2024-07-02T07:40:43+00:00 Debug 
====Stripe Version: 8.3.1====
====Stripe Plugin API Version: 2019-09-09====
====Start Log====
payment_intents/pi_**[HIDDEN_PRIVACY_REASONS]**/confirm request: Array
(
    [payment_method] => pm_**[HIDDEN_PRIVACY_REASONS]**

====End Log====

2024-07-02T07:40:44+00:00 Debug 
====Stripe Version: 8.3.1====
====Stripe Plugin API Version: 2019-09-09====
====Start Log====
payment_intents/pi_**[HIDDEN_PRIVACY_REASONS]**/confirm response with stripe-version: 2019-09-09
====End Log====

2024-07-02T07:40:44+00:00 Debug 
====Stripe Version: 8.3.1====
====Stripe Plugin API Version: 2019-09-09====
====Start Log====
Stripe PaymentIntent pi_**[HIDDEN_PRIVACY_REASONS]** succeeded for order **[HIDDEN_PRIVACY_REASONS]**
====End Log====

2024-07-02T07:40:44+00:00 Debug 
====Stripe Version: 8.3.1====
====Stripe Plugin API Version: 2019-09-09====
====Start Log====
Processing response: stdClass Object
(
    [id] => ch_**[HIDDEN_PRIVACY_REASONS]**
    [object] => charge
    [amount] => 7685
    [amount_captured] => 7685
    [amount_refunded] => 0
    [application] => 
    [application_fee] => 
    [application_fee_amount] => 
    [balance_transaction] => txn_**[HIDDEN_PRIVACY_REASONS]**
    [billing_details] => stdClass Object
        (
            [address] => stdClass Object
                (
                    [city] => **[HIDDEN_PRIVACY_REASONS]**
                    [country] => DE
                    [line1] => **[HIDDEN_PRIVACY_REASONS]**
                    [line2] => 
                    [postal_code] => **[HIDDEN_PRIVACY_REASONS]**
                    [state] => **[HIDDEN_PRIVACY_REASONS]**
                )

            [email] => **[HIDDEN_PRIVACY_REASONS]**
            [name] => **[HIDDEN_PRIVACY_REASONS]**
            [phone] => **[HIDDEN_PRIVACY_REASONS]**
        )

    [calculated_statement_descriptor] => WWW.ENTSORGO.DE
    [captured] => 1
    [created] => 1719906043
    [currency] => eur
    [customer] => cus_**[HIDDEN_PRIVACY_REASONS]**
    [description] => entsorgo - Bestellung **[HIDDEN_PRIVACY_REASONS]**
    [destination] => 
    [dispute] => 
    [disputed] => 
    [failure_balance_transaction] => 
    [failure_code] => 
    [failure_message] => 
    [fraud_details] => stdClass Object
        (
        )

    [invoice] => 
    [livemode] => 
    [metadata] => stdClass Object
        (
            [customer_email] => **[HIDDEN_PRIVACY_REASONS]**
            [customer_name] => **[HIDDEN_PRIVACY_REASONS]**
            [order_id] => **[HIDDEN_PRIVACY_REASONS]**
            [site_url] => https://www.entsorgo.de
        )

    [on_behalf_of] => 
    [order] => 
    [outcome] => stdClass Object
        (
            [network_status] => approved_by_network
            [reason] => 
            [risk_level] => normal
            [risk_score] => 19
            [seller_message] => Payment complete.
            [type] => authorized
        )

    [paid] => 1
    [payment_intent] => pi_**[HIDDEN_PRIVACY_REASONS]**
    [payment_method] => pm_**[HIDDEN_PRIVACY_REASONS]**
    [payment_method_details] => stdClass Object
        (
            [card] => stdClass Object
                (
                    [amount_authorized] => 7685
                    [brand] => visa
                    [checks] => stdClass Object
                        (
                            [address_line1_check] => pass
                            [address_postal_code_check] => pass
                            [cvc_check] => pass
                        )

                    [country] => US
                    [exp_month] => 3
                    [exp_year] => 2029
                    [extended_authorization] => stdClass Object
                        (
                            [status] => disabled
                        )

                    [fingerprint] => [HIDDEN_PRIVACY_REASONS]
                    [funding] => credit
                    [incremental_authorization] => stdClass Object
                        (
                            [status] => unavailable
                        )

                    [installments] => 
                    [last4] => 4242
                    [mandate] => 
                    [multicapture] => stdClass Object
                        (
                            [status] => unavailable
                        )

                    [network] => visa
                    [network_token] => stdClass Object
                        (
                            [used] => 
                        )

                    [overcapture] => stdClass Object
                        (
                            [maximum_amount_capturable] => 7685
                            [status] => unavailable
                        )

                    [three_d_secure] => 
                    [wallet] => 
                )

            [type] => card
        )

    [radar_options] => stdClass Object
        (
        )

    [receipt_email] => 
    [receipt_number] => 
    [receipt_url] => [HIDDEN_PRIVACY_REASONS]
    [refunded] => 
    [refunds] => stdClass Object
        (
            [object] => list
            [data] => Array
                (
                )

            [has_more] => 
            [total_count] => 0
            [url] => /v1/charges/ch_[HIDDEN_PRIVACY_REASONS]
        )

    [review] => 
    [shipping] => stdClass Object
        (
            [address] => stdClass Object
                (
                    [city] => **[HIDDEN_PRIVACY_REASONS]**
                    [country] => DE
                    [line1] => **[HIDDEN_PRIVACY_REASONS]**
                    [line2] => 
                    [postal_code] => **[HIDDEN_PRIVACY_REASONS]**
                    [state] => **[HIDDEN_PRIVACY_REASONS]**
                )

            [carrier] => 
            [name] => **[HIDDEN_PRIVACY_REASONS]**
            [phone] => 
            [tracking_number] => 
        )

    [source] => 
    [source_transfer] => 
    [statement_descriptor] => 
    [statement_descriptor_suffix] => 
    [status] => succeeded
    [transfer_data] => 
    [transfer_group] => 
)

====End Log====

2024-07-02T07:40:44+00:00 Debug 
====Stripe Version: 8.3.1====
====Stripe Plugin API Version: 2019-09-09====
====Start Log====
balance/history/txn_**[HIDDEN_PRIVACY_REASONS]**
====End Log====

I think this is coming from the WooBillomat plugin. The export_create_invoice function is here, and you can see it directly accesses an order ID on the very next line. In fact, someone else complained about this in their support forums two years ago, but never received a response from the developers. :(

Given that WooBillomat hasn't been updated for years and is causing an error, I would suggest looking for an alternative plugin.