Skip to content
This repository was archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
Merge pull request #83 from gabriellucius/list-transactions-improvements
Browse files Browse the repository at this point in the history
List transactions improvements
  • Loading branch information
s2it-moscou authored Apr 10, 2018
2 parents 50bbc82 + fc04b5b commit e582ee7
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Changelog
---------
3.12.0
- Melhorias na tela de Listar Transações (admin) referentes ao estorno parcial

3.11.0
- Checkout sem endereço (para produtos do tipo 'virtual' e 'downloadable')
- Valida se o telefone do comprador foi configurado antes de tentar usar o telefone do endereço de entrega
Expand Down
Binary file removed UOL_PagSeguro-3.11.0.tgz
Binary file not shown.
Binary file added UOL_PagSeguro-3.12.0.tgz
Binary file not shown.
32 changes: 25 additions & 7 deletions app/code/community/UOL/PagSeguro/Helper/Transactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,22 +270,40 @@ private function getOrderEnvironment($orderPagSeguro)
*/
private function buildArrayPagSeguroOrders($pagSeguroOrders)
{
$action = "<a class='edit' target='_blank' href='%s'>%s</a> <br><a class='action' data-config='%s'href='javascript:void(0)'>%s</a>";
$action = "<a class='action' data-config='%s'href='javascript:void(0)'>%s</a>";
$orderLink = "<a class='edit' target='_blank' href='%s'>%s</a>";
foreach ($pagSeguroOrders as $pagSeguroOrder) {
$this->arrayPagSeguroOrders[] = array(
'date' => $this->getOrderMagetoDateConvert($pagSeguroOrder['created_at']),
'id_magento' => $pagSeguroOrder['increment_id'],
'id_magento' => sprintf(
$orderLink,
$this->getEditOrderUrl($pagSeguroOrder['order_id']),
$pagSeguroOrder['increment_id']
),
'id_pagseguro' => $pagSeguroOrder['transaction_code'],
'environment' => $pagSeguroOrder['environment'],
'status_magento' => $this->getPaymentStatusToString($this->getPaymentStatusFromValue($pagSeguroOrder['status'])),
'status_magento' => $this->formatStatus($pagSeguroOrder['status'], $pagSeguroOrder['partially_refunded']),
'action' => sprintf(
$action,
$this->getEditOrderUrl($pagSeguroOrder['order_id']),
$this->__('Ver detalhes pedido'),
$pagSeguroOrder['transaction_code'],
$this->__('Ver detalhes transação')
$this->__('Ver detalhes do pagamento')
)
);
}
}
}

/**
* Format status name from number enum to human readable name and, if it is a partially refunded order,
* add a advice after the status name
*
* @param string $status
* @param integer $isPartiallyRefunded
* @return string
*/
private function formatStatus($status, $isPartiallyRefunded = 0)
{
return $isPartiallyRefunded ?
$this->getPaymentStatusToString($this->getPaymentStatusFromValue($status)) . ' (estornada parcialmente)' :
$this->getPaymentStatusToString($this->getPaymentStatusFromValue($status));
}
}
2 changes: 1 addition & 1 deletion app/code/community/UOL/PagSeguro/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ limitations under the License.
<config>
<modules>
<UOL_PagSeguro>
<version>3.11.0</version>
<version>3.12.0</version>
</UOL_PagSeguro>
</modules>
<global>
Expand Down

0 comments on commit e582ee7

Please sign in to comment.