File tree Expand file tree Collapse file tree 4 files changed +20
-5
lines changed
Expand file tree Collapse file tree 4 files changed +20
-5
lines changed Original file line number Diff line number Diff line change 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"
Original file line number Diff line number Diff 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 ())) {
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 (
You can’t perform that action at this time.
0 commit comments