From 0e3f137df98162662de134dacd1738da260bfd2b Mon Sep 17 00:00:00 2001 From: zcy Date: Wed, 8 Jun 2022 15:38:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E5=8D=83=E5=88=86=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/ServicePay/TransCard/KshCard.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/ServicePay/TransCard/KshCard.php b/app/ServicePay/TransCard/KshCard.php index a6be98e..fd1e4c7 100644 --- a/app/ServicePay/TransCard/KshCard.php +++ b/app/ServicePay/TransCard/KshCard.php @@ -12,11 +12,11 @@ class KshCard extends BaseCard //Edin 0745552949 on 14/3/22 at 5:48 PM New M-PESA balance is //Ksh675.00 Download M-PESA app on http://bit.ly/mpesappsm $this->msg = $msg; - $pattern= '/^[A-Z0-9]{9,12}(?=\s)|(?<=Ksh)[\d]+\.[\d]{2}|(?<=from\s)[a-zA-z]*\s[a-zA-z]*|(?<=\s)\d+(?=\s)|\d{1,2}\/\d{1,2}\/\d{1,4}\sat\s\d{1,2}:\d{2}\s[AMP]{2}/'; + $pattern= '/^[A-Z0-9]{9,12}(?=\s)|(?<=Ksh)[\d,]+\.[\d]{2}|(?<=from\s)[a-zA-z]*\s{0,2}[a-zA-z]*|(?<=\s)\d+(?=\s)|\d{1,2}\/\d{1,2}\/\d{1,4}\sat\s\d{1,2}:\d{2}\s[AMP]{2}/'; $match_num = preg_match_all($pattern, $this->msg, $matches, PREG_PATTERN_ORDER); if ($match_num != false && $match_num > 0 && $matches[0]) { $this->orderInfo = [ - 'pay_money' => $matches[0][1], + 'pay_money' => str_replace(',', '', $matches[0][1]), 'from_card' => $matches[0][3], 'from_name' => $matches[0][2], 'order_number' => $matches[0][0],