When using test mode \Drupal\commerce_dps\PaymentExpress\CommercePxPay\capturePayment never gets called. As such, the transaction completes but the Commerce Order doesn't have a payment attached.
The reason: PxPay authentication fails because Drupal\commerce_dps\PaymentExpress\CommercePxPay doesn't call $this->gateway->setTestMode(TRUE); before calling $this->gateway->completePurchase();
e.g. \Drupal\commerce_dps\PluginForm\OffSiteRedirect\buildConfigurationForm does this (at line 53-55)
Place an order using pxPay payment gateway in test mode using test CC. Order will be placed with empty payment.
if ($this->pxPayService->getConfiguration('mode') === 'test') {
$this->gateway->setTestMode(TRUE);
}
I'm not sure whether we can do this in one place, or if we need to do this before every call to $this->gateway->completePurchase() i.e.
\Drupal\commerce_dps\PaymentExpress\CommercePxPay::onNotify
\Drupal\commerce_dps\PaymentExpress\CommercePxPay::onCancel
\Drupal\commerce_dps\PaymentExpress\CommercePxPay::onReturn
If anyone has suggestions? In the meantime I'll roll a patch / create merge request...
Active
2.0
Code