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

Reset order transaction cache after proceeding a payment #1703

Closed
Anubarak opened this issue Sep 3, 2020 · 1 comment
Closed

Reset order transaction cache after proceeding a payment #1703

Anubarak opened this issue Sep 3, 2020 · 1 comment

Comments

@Anubarak
Copy link

Anubarak commented Sep 3, 2020

Description
When you save an order and create a transaction afterwards (proceed the payment) you cannot grab the newly created transaction via

$order->getTransactions();

This is because you cache all transaction in $order->getTransactions() but don't invalidate the cache after creating a transaction.
Since Commerce 3.X you included the transactions as search keywords, thus $order->getTransactions() is called after saving the order -> the old transactions are cached.

To Reproduce

  1. Save an order via PHP
  2. Create a new transaction via Commerce::getInstance()->getPayments()->processPayment() in PHP
  3. try to grab the transaction via $order->getTransactions() and see it does not contain the new transaction

Expected behavior

  • getting all transactions with the newly created one
@lukeholder
Copy link
Member

Thanks, this has been fixed for the next release.

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

No branches or pull requests

2 participants