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

Commit e582ee7

Browse files
authored
Merge pull request #83 from gabriellucius/list-transactions-improvements
List transactions improvements
2 parents 50bbc82 + fc04b5b commit e582ee7

File tree

5 files changed

+29
-8
lines changed

5 files changed

+29
-8
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Changelog
22
---------
3+
3.12.0
4+
- Melhorias na tela de Listar Transações (admin) referentes ao estorno parcial
5+
36
3.11.0
47
- Checkout sem endereço (para produtos do tipo 'virtual' e 'downloadable')
58
- Valida se o telefone do comprador foi configurado antes de tentar usar o telefone do endereço de entrega

UOL_PagSeguro-3.11.0.tgz

-526 KB
Binary file not shown.

UOL_PagSeguro-3.12.0.tgz

526 KB
Binary file not shown.

app/code/community/UOL/PagSeguro/Helper/Transactions.php

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -270,22 +270,40 @@ private function getOrderEnvironment($orderPagSeguro)
270270
*/
271271
private function buildArrayPagSeguroOrders($pagSeguroOrders)
272272
{
273-
$action = "<a class='edit' target='_blank' href='%s'>%s</a> <br><a class='action' data-config='%s'href='javascript:void(0)'>%s</a>";
273+
$action = "<a class='action' data-config='%s'href='javascript:void(0)'>%s</a>";
274+
$orderLink = "<a class='edit' target='_blank' href='%s'>%s</a>";
274275
foreach ($pagSeguroOrders as $pagSeguroOrder) {
275276
$this->arrayPagSeguroOrders[] = array(
276277
'date' => $this->getOrderMagetoDateConvert($pagSeguroOrder['created_at']),
277-
'id_magento' => $pagSeguroOrder['increment_id'],
278+
'id_magento' => sprintf(
279+
$orderLink,
280+
$this->getEditOrderUrl($pagSeguroOrder['order_id']),
281+
$pagSeguroOrder['increment_id']
282+
),
278283
'id_pagseguro' => $pagSeguroOrder['transaction_code'],
279284
'environment' => $pagSeguroOrder['environment'],
280-
'status_magento' => $this->getPaymentStatusToString($this->getPaymentStatusFromValue($pagSeguroOrder['status'])),
285+
'status_magento' => $this->formatStatus($pagSeguroOrder['status'], $pagSeguroOrder['partially_refunded']),
281286
'action' => sprintf(
282287
$action,
283-
$this->getEditOrderUrl($pagSeguroOrder['order_id']),
284-
$this->__('Ver detalhes pedido'),
285288
$pagSeguroOrder['transaction_code'],
286-
$this->__('Ver detalhes transação')
289+
$this->__('Ver detalhes do pagamento')
287290
)
288291
);
289292
}
290293
}
291-
}
294+
295+
/**
296+
* Format status name from number enum to human readable name and, if it is a partially refunded order,
297+
* add a advice after the status name
298+
*
299+
* @param string $status
300+
* @param integer $isPartiallyRefunded
301+
* @return string
302+
*/
303+
private function formatStatus($status, $isPartiallyRefunded = 0)
304+
{
305+
return $isPartiallyRefunded ?
306+
$this->getPaymentStatusToString($this->getPaymentStatusFromValue($status)) . ' (estornada parcialmente)' :
307+
$this->getPaymentStatusToString($this->getPaymentStatusFromValue($status));
308+
}
309+
}

app/code/community/UOL/PagSeguro/etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ limitations under the License.
1919
<config>
2020
<modules>
2121
<UOL_PagSeguro>
22-
<version>3.11.0</version>
22+
<version>3.12.0</version>
2323
</UOL_PagSeguro>
2424
</modules>
2525
<global>

0 commit comments

Comments
 (0)