Skip to content

Commit 3e75e53

Browse files
Release 2.4.1
Release 2.4.1
2 parents 83dddf8 + b01acf8 commit 3e75e53

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "pagarme/ecommerce-module-core",
33
"description": "Core component for Pagar.me e-commerce platform modules.",
44
"license": "MIT",
5-
"version": "2.4.0",
5+
"version": "2.4.1",
66
"authors": [
77
{
88
"name":"Open Source Team"

src/Kernel/Aggregates/Order.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,24 @@ public function getCharges()
104104
return $this->charges;
105105
}
106106

107+
108+
/**
109+
*
110+
* @return Transaction|null
111+
*/
112+
public function getPixOrBilletTransaction()
113+
{
114+
foreach ($this->getCharges() as $charge) {
115+
foreach ($charge->getTransactions() as $transaction) {
116+
$type = $transaction->getTransactionType()->getType();
117+
if ($type === 'pix' || $type === 'boleto') {
118+
return $transaction;
119+
}
120+
}
121+
}
122+
return null;
123+
}
124+
107125
public function applyOrderStatusFromCharges()
108126
{
109127
if (empty($this->getCharges())) {

src/Kernel/Services/LogService.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,6 @@ protected function setFileName()
132132
{
133133
$base = 'Pagarme_PaymentModule_' . date('Y-m-d');
134134
$fileName = $this->path . DIRECTORY_SEPARATOR . $base;
135-
if ($this->addHost) {
136-
$fileName .= '_' . gethostname();
137-
}
138135
$fileName .= '.log';
139136
$this->fileName = $fileName;
140137
}

src/Payment/Aggregates/Address.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function setNumber($number)
7878

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

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

8383
$inputName = $this->i18n->getDashboard('number');
8484
$message = $this->i18n->getDashboard(

0 commit comments

Comments
 (0)