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 19ae8d33 authored by Alessio Zampatti's avatar Alessio Zampatti Committed by GitHub

PW-720: add Descriptor for Ratepay (#333)

* PW-720: add Descriptor for Ratepay

* use empty string instead of null

* Show the descriptor on Payment Information adminhtml page

* "Ratepay" -> "Invoice"
parent 73ae7b55
...@@ -119,6 +119,11 @@ class Cron ...@@ -119,6 +119,11 @@ class Cron
*/ */
protected $_acquirerReference; protected $_acquirerReference;
/**
* @var
*/
protected $ratepayDescriptor;
/** /**
* @var * @var
*/ */
...@@ -531,6 +536,10 @@ class Cron ...@@ -531,6 +536,10 @@ class Cron
if ($acquirerReference != "") { if ($acquirerReference != "") {
$this->_acquirerReference = $acquirerReference; $this->_acquirerReference = $acquirerReference;
} }
$ratepayDescriptor = isset($additionalData['openinvoicedata.descriptor']) ? $additionalData['openinvoicedata.descriptor'] : "";
if ($ratepayDescriptor !== "") {
$this->ratepayDescriptor = $ratepayDescriptor;
}
} }
} }
...@@ -730,6 +739,12 @@ class Cron ...@@ -730,6 +739,12 @@ class Cron
if (!empty($expiryDate)) { if (!empty($expiryDate)) {
$this->_order->getPayment()->setAdditionalInformation('adyen_expiry_date', $expiryDate); $this->_order->getPayment()->setAdditionalInformation('adyen_expiry_date', $expiryDate);
} }
if ($this->ratepayDescriptor !== "") {
$this->_order->getPayment()->setAdditionalInformation(
'adyen_ratepay_descriptor', $this->ratepayDescriptor
);
}
} }
/** /**
......
...@@ -85,4 +85,9 @@ $_isDemoMode = $block->isDemoMode(); ...@@ -85,4 +85,9 @@ $_isDemoMode = $block->isDemoMode();
</table> </table>
<?php endif;?> <?php endif;?>
<?php if ($ratepayDescriptor = $_info->getAdditionalInformation('adyen_ratepay_descriptor')):?>
<div><?php echo __('Invoice Descriptor: %1', $ratepayDescriptor); ?>
</div>
<?php endif;?>
<?php echo $block->getChildHtml()?> <?php echo $block->getChildHtml()?>
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