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

Error Message: LogOut or Session-Timeout during Checkout process #767

Open
MLindenhofer opened this issue May 12, 2021 · 4 comments
Open

Comments

@MLindenhofer
Copy link
Contributor

Hi I need a bit help with a problem which occurs in silvershop: If the session dies after timeout or the user logs out during the checkout-process the order-data is set to null and an 500 Error is thrown.

[Emergency] Uncaught TypeError: Argument 1 passed to SilverShop\Checkout\CheckoutComponentConfig::__construct() must be an instance of SilverShop\Model\Order, null given
POST /checkout/ShippingAddressForm/
Line 27 in /usr/www/users/shopyq/vendor/silvershop/core/src/Checkout/CheckoutComponentConfig.php

The user gets the default blank-page with 'The requested page is not found.' Is there anything I can do, to customize this message and render it with my template?

Thanks in advance.

@Leapfrognz
Copy link
Contributor

Having a similar issue where the user session expires during payment, so the order is inaccessible when the user is directed back to the shop.

@wilr
Copy link
Contributor

wilr commented Sep 26, 2021

@Leapfrognz is your payment offsite or onsite?

In the short term - if it's onsite then apply a similar fix to user forms to prevent timeout (https://github.com/silverstripe/silverstripe-userforms/blob/5/client/src/bundles/UserForms.js#L759-L764) if it's offsite then you need to modify the PHP session timeout. By default, active sessions will expire after 24 minutes of inactivity so you may want to expand that to 60 minutes.

Long term I think we can look into long-lived checkout tokens for managing state rather than relying on sessions directly.

@Leapfrognz
Copy link
Contributor

@wilr offsite.
Ive added a short term fix by pushing order ID's into a cookie, and also adding a salted token to the return url and checking that.

@MLindenhofer
Copy link
Contributor Author

@wilr we have a project which has this payment-config:

SilverStripe\Omnipay\Model\Payment:
  allowed_gateways:
    - 'Manual'

When a user without account tries to submit the order, the loading time is very long and ends in a 404 page - I guess the session expires here too. Users with account only experience the long loading time. Can this be fixed with php too?

Version: dev-master , silverstripe 4.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants