Comments

Drupa1ish created an issue. See original summary.

vhin0210’s picture

Status: Active » Needs review
StatusFileSize
new1.91 KB

Sharing 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.

vhin0210’s picture

Sorry about the patch. It should be for 2.x-dev. Shall I create a new ticket or we change the version of this?

aporie’s picture

Version: 8.x-1.x-dev » 2.x-dev

Let'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.

  • Aporie committed 9d90448 on 2.x authored by vhin0210
    Issue #3057140 by vhin0210: Integration with Commerce Recurring...
aporie’s picture

Status: Needs review » Fixed

So 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).

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.