Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DCC orders randomly failing (505) #503

Closed
Dinamiko opened this issue Feb 21, 2022 · 11 comments · Fixed by #504
Closed

DCC orders randomly failing (505) #503

Dinamiko opened this issue Feb 21, 2022 · 11 comments · Fixed by #504
Labels
bug Something isn't working
Milestone

Comments

@Dinamiko
Copy link
Contributor

Describe the Bug

This issue is about cases where the PayPal Card Processing would fail.

Following update 1.7.0, we got a new error message that occurs when the behavior occurs:
No PayPal order found in the current WooCommerce session

The above error message is displayed because for some reason “Place order” button does not call create order endpoint but WC process checkout.

It seems like switching other payment gateways and then switching back to PayPal Card Processing results in some kind of reload, and then our event listeners are not added (https://github.com/woocommerce/woocommerce-paypal-payments/blob/trunk/modules/ppcp-button/resources/js/modules/Renderer/CreditCardRenderer.js#L125) because formSubmissionSubscribed is true.

To Reproduce

  1. Enable PayPal Card Processing
  2. Enable other payment gateways
  3. Add product to cart, visit checkout
  4. Switch over some payment gateways
  5. Switch back to PayPal Card Processing gateway
  6. Input credit card details and hit Place order

Expected Behavior

Order processes properly.

Actual Behavior

Order instantly fails with error above.

Environment

  • WordPress Version: 5.9
  • WooCommerce Version: 6.2
  • Plugin Version: 1.7.0-test2
@Dinamiko Dinamiko added the bug Something isn't working label Feb 21, 2022
@Dinamiko Dinamiko changed the title DCC orders randomly failing DCC orders randomly failing (505) Feb 21, 2022
@Dinamiko Dinamiko added this to the Release 1.7.0 milestone Feb 22, 2022
@lankathilina
Copy link

@Dinamiko - Did you find any solution for this?

@Dinamiko
Copy link
Contributor Author

Dinamiko commented Mar 2, 2022

Hello @lankathilina, the fix is included in the latest release 1.7.0.

@lankathilina
Copy link

lankathilina commented Mar 2, 2022

@Dinamiko Thanks for the reply. Don't know what's going on, I'm facing the exact same issue on 1.7.0. I tried on the default woocommerce theme and all plugins were disabled; PHP 7.4 environment. Still facing the issue. I need to keep digging this. Thanks for the update.

@TrailovicLuka
Copy link

TrailovicLuka commented Mar 2, 2022

I get update 1.7.0. version but the error is still there.
@lankathilina If u found solution pls write here :)

@Dinamiko
Copy link
Contributor Author

Dinamiko commented Mar 2, 2022

@lankathilina @TrailovicLuka do you still see the same error "No PayPal order found in the current WooCommerce session"? if so, please let me know the steps to reproduce it, thanks.

@TrailovicLuka
Copy link

@Dinamiko I still have the same error, after I click on place order, I get that error message. https://prnt.sc/SWgh57Ecm6n-

@InpsydeNiklas
Copy link
Member

@TrailovicLuka That behavior is not directly related to this issue though and the error message is actually expected in that case.

For any remaining questions please open a support request from here: https://paypal.inpsyde.com/docs/request-support/
Please include a copy of your system report and a link to this issue.
Thanks!

@TrailovicLuka
Copy link

@InpsydeNiklas Okay, I'll try. Thanks

@lankathilina
Copy link

lankathilina commented Mar 2, 2022

@Dinamiko - It was on the live site so I deactivated the "WooCommerce PayPal Payments - 1.7.0" and installed "WooCommerce PayPal Checkout Gateway - 2.1.3" - Because we needed to carry on with the orders.

These are the conditions and steps I followed to reproduce the error.
On woocommerce payments settings, this is the payment methods order

  1. Paypal
  2. Paypal card processing
  3. Stripe

I added the item to the cart, went to the checkout and Paypal is the default one selected. I can see the default Proceed to checkout button as well as the Golden Paypal button too. When I click the default Proceed to checkout button it gives me the No PayPal order found in the current WooCommerce session error.

If I click the Golden Paypal button this proceeds to checkout without an issue.

Then I set the Payment methods order as below.

  1. Paypal Card Processing
  2. Paypal
  3. Stripe

When we take the product to checkout default payment method selected was the Card option from Paypal. Now I select Paypal and proceed as same steps as above. same error.

I'm not sure if my below finding is correct or not. But after I installed the WooCommerce PayPal Checkout Gateway - 2.1.3 I went to checkout; my default payment method was Paypal. Now I can not see the default Proceed to checkout button. Instead, I saw only the Golden Paypal button.

Then I selected the Card payment (stripe option). As soon as I selected that, the PayPal Golden button disappeared and the default Proceed to checkout button appeared.

But that does not happen with the WooCommerce PayPal Payments - 1.7.0. No matter what payment method we selected it shows the default Proceed to checkout as well as the Golden Paypal button both. Is that supposed to hide the default Proceed to checkout button when we select Paypal? Because let's say if I click the Golden PayPal button I can proceed to checkout without an error.

Thanks.

@thomascytsang
Copy link

Same issue here.

Order notes:
Could not process order. No PayPal order found in the current WooCommerce session. Order status changed from Pending payment to Failed.

Had to switch back to WooCommerce PayPal Checkout Gateway 2.1.3 to allow orders to process

@mayocube
Copy link

mayocube commented May 7, 2022

Background:
I studied the plugin and found that the issue is happening because Woocommerce doesn't start session on guest as it requires userID to start a session, the session is used in the code to maintain the order information so that's why it all fails.

Fix:
add this code to functions.php of your theme:

add_action( 'woocommerce_init', function(){
    if ( ! WC()->session->has_session() ) {
        WC()->session->set_customer_session_cookie( true );
    }
} );

this will start the session no matter if the person is logged in or not (will just need cookies to be enabled)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants