• Resolved mcdeth

    (@mcdeth)


    Hello,

    We are investigating what looks like a session/order-mapping issue with payment, especially debit cards.

    Environment

    • Plugin: Woo PayPal Gateway / PayPal for WooCommerce 9.0.56
    • WooCommerce: 10.5.3
    • HPOS enabled
    • Live mode
    • Store uses Polylang / multilingual checkout

    Issue summary
    A customer starts checkout, gets a payment error, and then a second WooCommerce order is created on retry. The second order is not just a duplicate: it may be created with a different language/product context.

    What happened in our case

    • Order was created at 08:58:43 UTC
    • It was a pending order for 66.00 EUR
    • Product in the order: product_id 12027, variation_id 12033
    • Payment method: wpg_paypal_checkout
    • Order meta _paypal_order_id = 9UX779990V498671S

    However, at the moment of update/capture, the plugin did not use that PayPal order ID.
    Instead, it tried to PATCH and CAPTURE PayPal order ID 3SX69228L6663182E and received INVALID_RESOURCE_ID / RESOURCE_NOT_FOUND.

    Important detail:
    PayPal order ID 3SX69228L6663182E was not created for order #53237.
    It belongs to an older transaction from February 28, 2026, originally tied to order #53072.

    So the plugin appears to have reused a stale PayPal order ID from session state.

    After that failure:

    • the customer was returned to checkout
    • a new WooCommerce order #53238 was created at 09:01:24 UTC
    • this second order was completed successfully
    • but it was created in a different context:
    • total 8.00 EUR instead of 66.00 EUR
    • product_id 5525 instead of 12027
    • variation_id 0 instead of 12033
    • payment method wpg_paypal_checkout_cc
    • language/meta context switched to Polish instead of Italian

    Why this looks like a plugin bug
    From the behavior and logs, it looks like the plugin is reading the active PayPal order ID from session state and using it for capture, instead of validating that it matches the current WooCommerce order.

    In our case:

    • current Woo order #53237 had _paypal_order_id = 9UX779990V498671S
    • but capture/update used 3SX69228L6663182E from a previous session/order

    This caused the first order to fail and the retry flow created a second WooCommerce order.

    In particular, please verify how these values are sourced and validated:

    • current Woo order ID
    • order_awaiting_payment
    • ppcp_woo_order_id
    • ppcp_session[‘ppcp_paypal_order_id’]
    • order meta _paypal_order_id

    Expected behavior
    If the current Woo order has _paypal_order_id = X, the plugin should only PATCH/CAPTURE X, or recreate a fresh PayPal order for that same Woo order if needed.
    It should never reuse an old PayPal order ID from a previous order/session.
    On failure, it should not create a new WooCommerce order unless that is explicitly required and safely mapped.

    If needed, I can provide the exact log excerpts with timestamps and request/response payloads.

    Regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Jignesh

    (@jigneshmpatel)

    Hello,

    Thank you for the report — this appears to be a possible session/order ID mismatch.

    Please export the PayPal debug log for that time and submit it here:

    https://forms.gle/ujw7CrV3eKWYjgPQ6

    We’ll review and get back to you.

    Best regards

    Thread Starter mcdeth

    (@mcdeth)

    Hi, thanks for prompt reply. I’ve submitted log file. Please note it’s regarding order id 53238 and 53237. The cart amount varies because it loses language and it looks for currency meta field on other product, but it might be issue on my side.

    Plugin Support Jignesh

    (@jigneshmpatel)

    Hello,

    Thank you for the logs and details.

    We have included a fix for the issue you reported in this version (9.0.57.2) : Download Link

    Please try this and let us know how it works for you.

    Best Regards

    Thread Starter mcdeth

    (@mcdeth)

    thank you

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.