Skip to content

Commit

Permalink
Merge pull request #47 from Dintero/master-info-block
Browse files Browse the repository at this point in the history
Added Info Block
  • Loading branch information
chaikovskyia authored Jan 24, 2022
2 parents 0d25a07 + 9a1801d commit c07f1c6
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 6 deletions.
17 changes: 17 additions & 0 deletions Block/Info.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Dintero\Checkout\Block;

class Info extends \Magento\Payment\Block\Info
{
/**
* @param $transport
* @return \Magento\Framework\DataObject|null
*/
protected function _prepareSpecificInformation($transport = null)
{
$info = parent::_prepareSpecificInformation($transport);
$info->setData('Payment Type', $this->getInfo()->getAdditionalInformation('payment_product'));
return $info;
}
}
6 changes: 3 additions & 3 deletions Model/Api/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ private function initRequest($endpoint, $token = null)
'Dintero-System-Name' => __('Magento'),
'Dintero-System-Version' => $this->getSystemMeta()->getVersion(),
'Dintero-System-Plugin-Name' => 'Dintero.Checkout.Magento.V2',
'Dintero-System-Plugin-Version' => '1.6.11',
'Dintero-System-Plugin-Version' => '1.6.12',
];

if ($token && $token instanceof Token) {
Expand Down Expand Up @@ -473,10 +473,10 @@ private function prepareData($salesObject, $salesDocument = null)
}

/**
* @param \Magento\Sales\Api\Data\OrderAddressInterface $address
* @param \Magento\Sales\Api\Data\OrderAddressInterface|\Magento\Quote\Api\Data\AddressInterface $address
* @return array
*/
private function prepareAddress(\Magento\Sales\Api\Data\OrderAddressInterface $address)
private function prepareAddress($address)
{
$addressData = [
'first_name' => $address->getFirstname(),
Expand Down
7 changes: 7 additions & 0 deletions Model/Dintero.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@ class Dintero extends AbstractMethod
*/
protected $orderResource;

/**
* @var string
*/
protected $_infoBlockType = \Dintero\Checkout\Block\Info::class;

/**
* @param Context $context
* @param Registry $registry
Expand Down Expand Up @@ -480,6 +485,8 @@ protected function fillPaymentByResponse(\Magento\Framework\DataObject $payment)
->setParentTransactionId(null)
->setIsTransactionClosed(0)
->setIsTransactionPending($response->getStatus() === Client::STATUS_ON_HOLD);

$payment->setAdditionalInformation('payment_product', $response->getData('payment_product_type'));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
"Dintero\\Checkout\\": ""
}
},
"version": "1.6.11"
"version": "1.6.12"
}
2 changes: 1 addition & 1 deletion etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<arguments>
<argument name="code" xsi:type="const">Dintero\Checkout\Model\Dintero::METHOD_CODE</argument>
<argument name="formBlockType" xsi:type="string">Magento\Payment\Block\Form</argument>
<argument name="infoBlockType" xsi:type="string">Magento\Payment\Block\Info</argument>
<argument name="infoBlockType" xsi:type="string">Dintero\Checkout\Block\Info</argument>
<argument name="commandPool" xsi:type="object">DinteroCommandPool</argument>
<argument name="valueHandlerPool" xsi:type="object">DinteroValueHandlerPool</argument>
</arguments>
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Dintero_Checkout" setup_version="1.6.11">
<module name="Dintero_Checkout" setup_version="1.6.12">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Checkout"/>
Expand Down

0 comments on commit c07f1c6

Please sign in to comment.