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

Fix: The quantities in stock are not verified in case of payment with PayPal #365

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Codencode
Copy link

Questions Answers
Description? As the remaining quantity in stock is not checked when paying with PayPal or other forms that require a gateway payment, it is possible to complete the order and pay for an out-of-stock product even if this is not permitted.
Type? bug fix
BC breaks? no
Deprecations? no
Fixed ticket? Fixes #325
How to test? 1 - Create a cart with an available item. 2 - Proceed to checkout until the payment selection. 3 - Before confirming the order, modify the product quantity in the admin, making it unavailable. 4 - Confirm the order with PayPal. 5 - The system should refresh the page and redirect to the cart.

@clotairer
Copy link
Collaborator

Thank you @Codencode for your PR. We will read it and try to merge it ASAP.

@Codencode Codencode changed the title Incomplete Fix: The quantities in stock are not verified in case of payment with PayPal Fix: The quantities in stock are not verified in case of payment with PayPal Sep 20, 2024
@Codencode
Copy link
Author

Hi @clotairer,
my solution checks if the cart/product is actually available just before creating the order, and it does this in the createOrder function.
If the cart/item is not available, the order ID is obviously not returned, and this generates an error/exception that is handled by the onError function, where I refresh the page. This way, the system redirects to the cart, showing that the product is no longer available.
Perhaps it could be managed differently, but this is the solution I came up with.

Thanks.

@clotairer
Copy link
Collaborator

Hi,
It looks like we already fix your issue here
#350

Could you confirm to us your module is up to date ?

@Codencode
Copy link
Author

Hi, It looks like we already fix your issue here #350

Could you confirm to us your module is up to date ?

Yes, the module is updated to the latest version 6.4.2.

I think fix #350 solves a different case.
The problem I encountered occurs when you are on a product page or in the cart and in the meantime the product has become unavailable.
My change, before starting the order creation process on PayPal, performs the availability check and if unavailable blocks the order.

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

Successfully merging this pull request may close these issues.

The quantities in stock are not verified in case of payment with PayPal
2 participants