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
Problem with credit cards on customer payment link #23902
Comments
Give the new wc_load_cart function a go and see if this resolves the issue for you? |
It doesn't resolve. This bug is present in up-to-date release version 3.6.4. Order-page renders through wc_load_cart() method. But there isn't any process that correctly and fully sets woocomerce session cookie into the browser. I have made own external fix, but it's really dirty. It was enough for my case, but it doesn't solves the problem in woocommerce core.
|
I have a simular problem, customers clicking the order-pay/[ordernum]/?pay_for_order=true&key=[orderkey] link can see the shopping card, but once they want to pay with Paypal Plus in my case, they are redirected to the Shopping Card which is empty. This worked well versions ago :( |
I realise this is a very old issue which hasn't had any updates in some time, so this may be out of date or had fixes or workarounds in place, but to summarise it seems that:
I think if a payment gateway needs to make use of sessions outside of the full cart/checkout flow it should ensure a session is in place. However, I understand that this is not straightforward because cookies need to be set early so the payment method may not get a chance to do so. I think the best workaround we could implement would be to ensure that a session is created upon entry to the pay for order page, or checkout. It might be difficult to test without an effect extension however. Looking into it. |
I've added a fix here: #43858 |
The problem concerns customer payment link and custom payment gateways. The main thing is that customer can't effect payment by credit card. These (WireCard and Micropayment) and most of other plugins alike store payment data in session. Such customers usually visit web-site the first and maybe the last time. It is worth mentioning that shopping cart is empty for such customers.
After a set of tests a problem of non-complete setting of session cookie in browser was found. WC_Session/WC_Session_Handler classes restore woocommerce session, but check whether this cookie is based on $_COOKIE variable. During the render of 'pay-order page' WC_Session/WC_Session_Handler miss functionality for setting wc_session into $_COOKIE. Unfortunately, this functionality for setting cookie into $_COOKIE variable initializes only on the cart page or when customer adds/removes products from shopping cart. Thats why the customer hasn't got any possibility to complete such order as payment gateway passes explicitly to woocommerce session (that wasn't completely set).
Steps to reproduce the behavior:
To sum up, at the point of getting session data, method has_session() is always false, as $COOKIE hasn't got any woocommerce_session param. In addition, before rendering order-pay page or at the point of init_session_cookie(), the app needs to initialize method set_customer_session_cookie() with true param for $cookie = false (and only for the case of pay-order page) for correct payment process with custom gateways (lots of them don't care about pleasant storing of data without session).
The text was updated successfully, but these errors were encountered: