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

Cancel state order not working proprely if table sylius_payment is too big #247

Open
sloury opened this issue May 24, 2022 · 2 comments
Open
Labels

Comments

@sloury
Copy link

sloury commented May 24, 2022

SyliusPayPalPlugin version affected: master

Description
Hi everyone, i had a problem with the cancelation or abort payment step. I have a big database sylius with about more 400000 entries into 'sylius_payment' table. During the cancel process to get all payments, the retriving the id transaction paypal take so much time that cannot work proprely. That redirect me to the payment methods page without the 'cancelled' state or worst get an error 500 'OutofMemory' if you had limited in memory PHP. If i go to the payment methods page, i can't go re-attempt to validate an another transaction.

Steps to reproduce

  • Try to get more 10000 entries in 'sylius_payment' table
  • Go to the popin Paypal Checkout and click to 'Cancel and return to Test Store' or exit the popin to trigger the cancel state.
  • See the time between line 32 - 34 in PaymentProvider.php (too long)

Possible Solution

  • Create a new route, like create and complete route, with the orderid sylius
  • Pass this new route into PaypalButtonsController.php (line 139) with the orderid sylius
  • Modify CancelPaypalPaymentAction line 29 -31 to retrieve the order sylius and the last payment.
@Chrysweel
Copy link

Chrysweel commented Dec 1, 2022

How is it possible to make a query like this?

$payments = $this->paymentRepository->findAll();

https://github.com/Sylius/PayPalPlugin/blob/1.5/src/Provider/PaymentProvider.php#L32

🤯🤯🤯🤯🤯

@migo315
Copy link

migo315 commented Oct 2, 2024

This definitely needs to be changed.

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

No branches or pull requests

3 participants