Skip to content

Commit

Permalink
Release 2.4.1
Browse files Browse the repository at this point in the history
Release 2.4.1
  • Loading branch information
fabiano-mallmann authored Mar 7, 2024
2 parents 83dddf8 + b01acf8 commit 3e75e53
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pagarme/ecommerce-module-core",
"description": "Core component for Pagar.me e-commerce platform modules.",
"license": "MIT",
"version": "2.4.0",
"version": "2.4.1",
"authors": [
{
"name":"Open Source Team"
Expand Down
18 changes: 18 additions & 0 deletions src/Kernel/Aggregates/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,24 @@ public function getCharges()
return $this->charges;
}


/**
*
* @return Transaction|null
*/
public function getPixOrBilletTransaction()
{
foreach ($this->getCharges() as $charge) {
foreach ($charge->getTransactions() as $transaction) {
$type = $transaction->getTransactionType()->getType();
if ($type === 'pix' || $type === 'boleto') {
return $transaction;
}
}
}
return null;
}

public function applyOrderStatusFromCharges()
{
if (empty($this->getCharges())) {
Expand Down
3 changes: 0 additions & 3 deletions src/Kernel/Services/LogService.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@ protected function setFileName()
{
$base = 'Pagarme_PaymentModule_' . date('Y-m-d');
$fileName = $this->path . DIRECTORY_SEPARATOR . $base;
if ($this->addHost) {
$fileName .= '_' . gethostname();
}
$fileName .= '.log';
$this->fileName = $fileName;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Payment/Aggregates/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function setNumber($number)

$this->number = substr($numberWithoutLineBreaks, 0, 15);

if (empty($this->number)) {
if (empty($this->number) && ($this->number === null || !is_numeric(trim($this->number)))) {

$inputName = $this->i18n->getDashboard('number');
$message = $this->i18n->getDashboard(
Expand Down

0 comments on commit 3e75e53

Please sign in to comment.