Closed (fixed)
Project:
Commerce Funds
Version:
2.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
26 May 2019 at 03:16 UTC
Updated:
30 Sep 2021 at 10:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
vhin0210 commentedSharing my patch that allows me to run payment from a cron job. The issues that I saw are:
1. BalanceGateway::doPayment() is always taking order entity from route. To fix it, I have to get the order entity from payment entity.
2. TransactionManager::performTransaction() is always validating the transaction permission from the current user. Cron usually run as anonymous user and will never get the access to do any transaction. To fix it, I have to use the getIssuer() from transaction entity.
Comment #3
vhin0210 commentedSorry about the patch. It should be for 2.x-dev. Shall I create a new ticket or we change the version of this?
Comment #4
aporieLet's just update this one.
Wanted to investigate your change to performTransaction to see if it has some security implication.
Didn't find time yet.
Tests are failing, but it's not due to your patch so disregard for now.
Comment #6
aporieSo it was actually making more sense to perform the access check from the transaction as the issuer is set when the transaction object is created.
I've done it wherever it was possible (only confirm withdrawal must check the access on current user).