This repository was archived by the owner on Apr 24, 2023. It is now read-only.
File tree 3 files changed +24
-0
lines changed
3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -629,4 +629,26 @@ public function getPaymentStatusToString(Integer $key)
629
629
}
630
630
return false ;
631
631
}
632
+
633
+ /**
634
+ * Format string phone number
635
+ * @param string $phone
636
+ * @return array of area code and number
637
+ */
638
+ public function formatPhone ($ phone )
639
+ {
640
+ $ phone = preg_replace ('/[^0-9]/ ' , '' , $ phone );
641
+ $ ddd = '' ;
642
+
643
+ if (strlen ($ phone ) > 9 ) {
644
+ if (substr ($ phone , 0 , 1 ) == 0 ) {
645
+ $ phone = substr ($ phone , 1 );
646
+ }
647
+
648
+ $ ddd = substr ($ phone , 0 , 2 );
649
+ $ phone = substr ($ phone , 2 );
650
+ }
651
+
652
+ return ['areaCode ' => $ ddd , 'number ' => $ phone ];
653
+ }
632
654
}
Original file line number Diff line number Diff line change @@ -312,9 +312,11 @@ public function getCredentialsInformation()
312
312
*/
313
313
private function getSenderInformation ()
314
314
{
315
+ $ phone = Mage::helper ('pagseguro ' )->formatPhone ($ this ->order ->getBillingAddress ()->getTelephone ());
315
316
$ PagSeguroSender = new PagSeguroSender ();
316
317
$ PagSeguroSender ->setEmail ($ this ->order ['customer_email ' ]);
317
318
$ PagSeguroSender ->setName ($ this ->order ['customer_firstname ' ] . ' ' . $ this ->order ['customer_lastname ' ]);
319
+ $ PagSeguroSender ->setPhone ($ phone ['areaCode ' ], $ phone ['number ' ]);
318
320
319
321
return $ PagSeguroSender ;
320
322
}
You can’t perform that action at this time.
0 commit comments