We will work on Apr 26th (Saturday) and will be off from Apr 30th (Wednesday) until May 2nd (Friday) for public holiday in our country

Commit a048486d authored by rikterbeek's avatar rikterbeek

#20 use our pspReference as transactionId

parent 60dafe8f
......@@ -333,6 +333,12 @@ class PaymentRequest extends DataObject
throw new \Magento\Framework\Exception\LocalizedException(__('The capture action failed'));
}
// set pspReference as TransactionId so you can do an online refund
if(isset($result['pspReference'])) {
$payment->setTransactionId($result['pspReference'])
->setIsTransactionClosed(false);
}
return $result;
}
......
......@@ -174,7 +174,7 @@ class Cron
$dateStart = new \DateTime();
$dateStart->modify('-1 day');
$dateEnd = new \DateTime();
$dateEnd->modify('-2 minute');
$dateEnd->modify('-0 minute');
$dateRange = ['from' => $dateStart, 'to' => $dateEnd, 'datetime' => true];
// create collection
......@@ -1051,7 +1051,7 @@ class Cron
$invoice->getOrder()->setIsInProcess(true);
// set transaction id so you can do a online refund from credit memo
$invoice->setTransactionId(1);
$invoice->setTransactionId($this->_pspReference);
$autoCapture = $this->_isAutoCapture();
$createPendingInvoice = (bool) $this->_getConfigData('create_pending_invoice', 'adyen_abstract', $this->_order->getStoreId());
......
......@@ -339,11 +339,6 @@ class Cc extends \Magento\Payment\Model\Method\Cc
public function capture(\Magento\Payment\Model\InfoInterface $payment, $amount)
{
parent::capture($payment, $amount);
// set TransactionId so you can do an online refund
$payment->setTransactionId(1)
->setIsTransactionClosed(false);
$this->_paymentRequest->capture($payment, $amount);
return $this;
}
......
......@@ -380,11 +380,6 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
public function capture(\Magento\Payment\Model\InfoInterface $payment, $amount)
{
parent::capture($payment, $amount);
// set TransactionId so you can do an online refund
$payment->setTransactionId(1)
->setIsTransactionClosed(false);
$this->_paymentRequest->capture($payment, $amount);
return $this;
}
......
......@@ -380,11 +380,6 @@ class Pos extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
public function capture(\Magento\Payment\Model\InfoInterface $payment, $amount)
{
parent::capture($payment, $amount);
// set TransactionId so you can do an online refund
$payment->setTransactionId(1)
->setIsTransactionClosed(false);
$this->_paymentRequest->capture($payment, $amount);
return $this;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment