We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) 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 ...@@ -333,6 +333,12 @@ class PaymentRequest extends DataObject
throw new \Magento\Framework\Exception\LocalizedException(__('The capture action failed')); 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; return $result;
} }
......
...@@ -174,7 +174,7 @@ class Cron ...@@ -174,7 +174,7 @@ class Cron
$dateStart = new \DateTime(); $dateStart = new \DateTime();
$dateStart->modify('-1 day'); $dateStart->modify('-1 day');
$dateEnd = new \DateTime(); $dateEnd = new \DateTime();
$dateEnd->modify('-2 minute'); $dateEnd->modify('-0 minute');
$dateRange = ['from' => $dateStart, 'to' => $dateEnd, 'datetime' => true]; $dateRange = ['from' => $dateStart, 'to' => $dateEnd, 'datetime' => true];
// create collection // create collection
...@@ -1051,7 +1051,7 @@ class Cron ...@@ -1051,7 +1051,7 @@ class Cron
$invoice->getOrder()->setIsInProcess(true); $invoice->getOrder()->setIsInProcess(true);
// set transaction id so you can do a online refund from credit memo // set transaction id so you can do a online refund from credit memo
$invoice->setTransactionId(1); $invoice->setTransactionId($this->_pspReference);
$autoCapture = $this->_isAutoCapture(); $autoCapture = $this->_isAutoCapture();
$createPendingInvoice = (bool) $this->_getConfigData('create_pending_invoice', 'adyen_abstract', $this->_order->getStoreId()); $createPendingInvoice = (bool) $this->_getConfigData('create_pending_invoice', 'adyen_abstract', $this->_order->getStoreId());
......
...@@ -339,11 +339,6 @@ class Cc extends \Magento\Payment\Model\Method\Cc ...@@ -339,11 +339,6 @@ class Cc extends \Magento\Payment\Model\Method\Cc
public function capture(\Magento\Payment\Model\InfoInterface $payment, $amount) public function capture(\Magento\Payment\Model\InfoInterface $payment, $amount)
{ {
parent::capture($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); $this->_paymentRequest->capture($payment, $amount);
return $this; return $this;
} }
......
...@@ -380,11 +380,6 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa ...@@ -380,11 +380,6 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
public function capture(\Magento\Payment\Model\InfoInterface $payment, $amount) public function capture(\Magento\Payment\Model\InfoInterface $payment, $amount)
{ {
parent::capture($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); $this->_paymentRequest->capture($payment, $amount);
return $this; return $this;
} }
......
...@@ -380,11 +380,6 @@ class Pos extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa ...@@ -380,11 +380,6 @@ class Pos extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
public function capture(\Magento\Payment\Model\InfoInterface $payment, $amount) public function capture(\Magento\Payment\Model\InfoInterface $payment, $amount)
{ {
parent::capture($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); $this->_paymentRequest->capture($payment, $amount);
return $this; 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