Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
iwl-live
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Anthony.Suerte
iwl-live
Commits
1e27b198
Commit
1e27b198
authored
Jul 21, 2023
by
iWallet Dev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automated Phone Code Omitter
parent
935453c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
2 deletions
+65
-2
EasyPaymentLinkAPI.php
logic/deposit/ext/EasyPaymentLinkAPI.php
+49
-2
sql.xml
system/lib/sql.xml
+16
-0
No files found.
logic/deposit/ext/EasyPaymentLinkAPI.php
View file @
1e27b198
...
...
@@ -167,6 +167,11 @@ class EasyPaymentLinkAPI extends System {
$this
->
logDetails
(
"
{
$this
->
getColumnData
(
$account
,
PARAM_USER_ACCOUNT
)
}
\n
{
$callbck
}
"
);
$telnum
=
preg_replace
(
"/(\-| |\(|\))/"
,
NO_STRING
,
$this
->
getColumnData
(
$account
,
PARAM_TEL
));
$country_code
=
$this
->
getColumnData
(
$account
,
PARAM_COUNTRY
);
$mobile_num
=
$this
->
omittedPhoneNumber
(
$telnum
,
$country_code
);
$this
->
payload
=
json_encode
([
"customer"
=>
[
"first_name"
=>
$this
->
getColumnData
(
$account
,
PARAM_FIRST_NAME
),
...
...
@@ -177,11 +182,11 @@ class EasyPaymentLinkAPI extends System {
"city_municipality"
=>
$this
->
getColumnData
(
$account
,
PARAM_CITY
),
"zip"
=>
$this
->
getColumnData
(
$account
,
PARAM_ZIP_CODE
),
"state_province_region"
=>
$this
->
getColumnData
(
$account
,
PARAM_STATE
),
"country_code"
=>
$
this
->
getColumnData
(
$account
,
PARAM_COUNTRY
)
"country_code"
=>
$
country_code
],
"contact"
=>
[
"email"
=>
$this
->
getColumnData
(
$account
,
PARAM_MAIL
),
"mobile"
=>
preg_replace
(
"/(\-| |\(|\))/"
,
NO_STRING
,
$this
->
getColumnData
(
$account
,
PARAM_TEL
))
"mobile"
=>
$mobile_num
]
],
"payment"
=>
[
...
...
@@ -235,6 +240,48 @@ class EasyPaymentLinkAPI extends System {
curl_close
(
$handle
);
}
protected
function
omittedPhoneNumber
(
$tel
,
$country
){
$country
=
$this
->
getRowData
(
$this
->
accessSelect
(
"SELECT_MST_COUNTRY"
,
[
$country
]));
// omit the + sign if included
$phoneNum
=
strpos
(
$tel
,
"+"
)
===
0
?
substr
(
$tel
,
1
)
:
$tel
;
$found
=
""
;
if
(
$this
->
beginsWith
(
$country
[
"phone_code"
],
$phoneNum
,
$found
)){
return
"0"
.
substr
(
$phoneNum
,
strlen
(
$found
));
}
return
$tel
;
}
protected
function
beginsWith
(
$beginsWith
,
$phrase
,
&
$found
=
null
){
if
(
is_array
(
$beginsWith
)){
foreach
(
$beginsWith
as
$begin
){
if
(
substr
(
$phrase
,
0
,
strlen
(
$begin
))
===
$begin
){
if
(
$found
!==
null
){
$found
=
$beginsWith
;
}
return
true
;
}
}
}
else
if
(
is_string
(
$beginsWith
)){
if
(
strpos
(
$beginsWith
,
","
)
!==
false
){
$beginsWith
=
explode
(
","
,
$beginsWith
);
return
$this
->
beginsWith
(
$beginsWith
,
$phrase
,
$found
);
}
if
(
substr
(
$phrase
,
0
,
strlen
(
$beginsWith
))
===
$beginsWith
){
if
(
$found
!==
null
){
$found
=
$beginsWith
;
}
return
true
;
}
}
}
public
function
getHttpCode
(){
return
$this
->
httpcode
;
}
...
...
system/lib/sql.xml
View file @
1e27b198
...
...
@@ -7078,6 +7078,7 @@ WHERE
, country
, langage
, country_code
, phone_code
FROM
t_mst_country
WHERE
...
...
@@ -7086,6 +7087,21 @@ WHERE
country
</LIST_MST_COUNTRY>
<SELECT_MST_COUNTRY>
SELECT
c_id
, country
, langage
, country_code
, phone_code
FROM
t_mst_country
WHERE
country_code = '__ELEMENT01__'
ORDER BY
country
</SELECT_MST_COUNTRY>
<!--
通貨マスタの取得
条 件:なし
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment