Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
TimeOutAdmin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
TimeOut
TimeOutAdmin
Commits
62136085
Commit
62136085
authored
Nov 13, 2019
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
t : payment changes : uat
parent
b8a59eca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
24 deletions
+49
-24
Api.php
application/controllers/Api.php
+15
-14
Webservice_model.php
application/models/Webservice_model.php
+34
-10
No files found.
application/controllers/Api.php
View file @
62136085
...
...
@@ -339,7 +339,7 @@ class Api extends CI_Controller {
}
public
function
paymentGateway
(
$amount
=
'0'
,
$last_id
=
'0'
,
$event_id
=
'0'
,
$booking_id
=
'0'
,
$custData
=
array
(),
$cardData
=
array
()
){
$custData
=
array
(),
$cardData
=
''
){
$customerName
=
array
();
if
(
isset
(
$custData
->
name
)
&&
!
empty
(
$custData
->
name
)){
$customerName
=
explode
(
' '
,
$custData
->
name
);
...
...
@@ -353,13 +353,18 @@ class Api extends CI_Controller {
$add1
=
$add2
=
$city
=
$state
=
'Saudi Arabia'
;
$pincode
=
'61961'
;
$noCard
=
0
;
$saveCard
=
1
;
$savedCard
=
0
;
$cvv
=
$tocken
=
$cardNo
=
$holder
=
$cardType
=
$expMonth
=
$expYear
=
''
;
if
(
!
empty
(
$cardData
)){
if
(
isset
(
$cardData
[
'cvv'
])
&&
!
empty
(
$cardData
[
'cvv'
])
&&
isset
(
$cardData
[
'tocken'
])
&&
!
empty
(
$cardData
[
'tocken'
])){
$savedCard
=
1
;
$cardData
=
$this
->
encrypt
(
$cardData
,
$this
->
local_key
,
$this
->
local_iv
);
if
(
empty
(
$cardData
)){
redirect
(
$redUrl
.
'failure'
);
}
else
if
(
isset
(
$cardData
[
'cvv'
])
&&
!
empty
(
$cardData
[
'cvv'
])
&&
isset
(
$cardData
[
'tocken'
])
&&
!
empty
(
$cardData
[
'tocken'
])){
$cvv
=
$cardData
[
'cvv'
];
$tocken
=
$cardData
[
'tocken'
];
$savedCard
=
1
;
}
else
if
(
isset
(
$cardData
[
'cvv'
])
&&
!
empty
(
$cardData
[
'cvv'
])
||
isset
(
$cardData
[
'cardType'
])
&&
!
empty
(
$cardData
[
'cardType'
])
||
isset
(
$cardData
[
'cardNumber'
])
&&
!
empty
(
$cardData
[
'cardNumber'
])
||
...
...
@@ -372,12 +377,12 @@ class Api extends CI_Controller {
$cardType
=
$cardData
[
'cardType'
];
$expMonth
=
substr
(
$cardData
[
'expMonthYear'
],
0
,
2
);
$expYear
=
'20'
.
substr
(
$cardData
[
'expMonthYear'
],
2
,
2
);
$saveCard
=
(
isset
(
$cardData
[
'saveCard'
])
&&!
empty
(
$cardData
[
'saveCard'
])
&&
$cardData
[
'saveCard'
]
==
0
)
?
0
:
1
;
$saveCard
=
(
isset
(
$cardData
[
'saveCard'
])
&&
$cardData
[
'saveCard'
]
==
0
)
?
0
:
1
;
}
else
{
$noCard
=
1
;
redirect
(
$redUrl
.
'failure'
)
;
}
}
else
{
$noCard
=
1
;
redirect
(
$redUrl
.
'failure'
)
;
}
$failureUrl
=
base_url
(
'Api/paymentFailureUrl'
);
...
...
@@ -390,13 +395,9 @@ class Api extends CI_Controller {
$pText
.=
'111111111111|'
.
$f_Name
.
'|'
.
$l_Name
.
'|'
.
$add1
.
'|'
.
$add2
.
'|'
.
$city
.
'|'
.
$state
.
'|'
.
$pincode
.
'|SA|'
.
$phone
.
'|34|344|34355344||'
;
if
(
$savedCard
==
1
){
$pText
.=
'00010000001|'
.
$c
ardData
[
'cvv'
]
.
'|'
.
$cardData
[
'tocken'
]
.
'||'
;
$pText
.=
'00010000001|'
.
$c
vv
.
'|'
.
$tocken
.
'||'
;
}
else
{
if
(
$noCard
==
0
){
$pText
.=
'11111100000|'
.
$cardNo
.
'|'
.
$expMonth
.
'|'
.
$expYear
.
'|'
.
$cvv
.
'|'
.
$holder
.
'|'
.
$cardType
.
'||'
;
}
else
{
// Provide Card Details Manually in Bayanpay Payment gateway.
}
$pText
.=
'11111100000|'
.
$cardNo
.
'|'
.
$expMonth
.
'|'
.
$expYear
.
'|'
.
$cvv
.
'|'
.
$holder
.
'|'
.
$cardType
.
'||'
;
}
$pText
.=
'1110000|'
.
$last_id
.
'|'
.
$event_id
.
'|'
.
$booking_id
.
'||'
;
if
(
$saveCard
==
1
){
...
...
application/models/Webservice_model.php
View file @
62136085
...
...
@@ -1813,29 +1813,53 @@ class Webservice_model extends CI_Model {
public
function
sync_contacts
(
$data
){
$user_id
=
$this
->
auth_token_get
(
$data
[
'auth_token'
]);
$respArr
=
array
(
'status'
=>
0
,
'code'
=>
'918'
,
'message'
=>
'Data Missing'
);
if
(
empty
(
$data
)){
return
$respArr
;
return
array
(
'status'
=>
0
,
'code'
=>
'918'
,
'message'
=>
'Data Missing'
);
}
$phNumbers
=
''
;
foreach
(
$data
[
'contacts'
]
AS
$key
=>
$number
)
{
$number
=
preg_replace
(
'/\D/'
,
''
,
$number
);
$eCond
=
(
$key
!=
count
(
$data
[
'contacts'
])
-
1
)
?
' OR '
:
''
;
$cond
=
" AND CUST.enable_chat='1' AND USR.status='1'"
;
$eCond
=
(
$key
!=
count
(
$data
[
'contacts'
])
-
1
)
?
') OR '
:
')'
;
$eCond
=
$cond
.
$eCond
;
if
(
strlen
(
$number
)
>
9
){
$phNumbers
.=
" phone LIKE '%"
.
substr
(
$number
,
strlen
(
$number
)
-
9
)
.
"' "
.
$eCond
;
$phNumbers
.=
"
(CUST.
phone LIKE '%"
.
substr
(
$number
,
strlen
(
$number
)
-
9
)
.
"' "
.
$eCond
;
}
else
{
$phNumbers
.=
" phone LIKE '%"
.
$number
.
"' "
.
$eCond
;
$phNumbers
.=
"
(CUST.
phone LIKE '%"
.
$number
.
"' "
.
$eCond
;
}
}
if
(
empty
(
$phNumbers
)){
return
array
(
'status'
=>
0
,
'code'
=>
'919'
,
'message'
=>
'Invalid Data'
);
}
$sql
=
"SELECT CUST.customer_id FROM customer AS CUST
INNER JOIN users AS USR ON (USR.id=CUST.customer_id)
WHERE
$phNumbers
"
;
$custIds
=
$this
->
db
->
query
(
$sql
)
->
result_array
();
if
(
empty
(
$custIds
)){
return
array
(
'status'
=>
0
,
'code'
=>
'919'
,
'message'
=>
'No Data Found'
);
}
$user_ids
=
''
;
foreach
(
$custIds
AS
$id
)
{
$user_ids
=
$id
[
'customer_id'
]
.
','
;
}
$user_ids
=
trim
(
$user_ids
,
','
);
$result
=
$this
->
db
->
query
(
"SELECT CUST.customer_id,CUST.name,CUST.phone,CUST.profile_image,
CUST.profile_image_qr,CHT.type AS friend_status
FROM customer AS CUST
LEFT JOIN chats AS CHT ON ((CUST.customer_id=CHT.from_user OR CUST.customer_id=CHT.to_user) AND CHT.type=1)
WHERE (
$phNumbers
) AND CUST.enable_chat='1' AND
customer_id NOT IN (SELECT from_user FROM chats WHERE (from_user=
$user_id
AND type='2') OR (to_user =
$user_id
AND type='2')) AND
customer_id NOT IN (SELECT to_user FROM chats WHERE (from_user=
$user_id
AND type='2') OR (to_user =
$user_id
AND type='2'))
GROUP BY CUST.customer_id"
);
WHERE CUST.customer_id IN (
$user_ids
) AND
customer_id NOT IN
(SELECT from_user FROM chats
WHERE (from_user=
$user_id
AND type='2') OR
(to_user=
$user_id
AND type='2'))
AND
customer_id NOT IN
(SELECT to_user FROM chats
WHERE (from_user=
$user_id
AND type='2') OR
(to_user=
$user_id
AND type='2'))
GROUP BY CUST.customer_id"
);
$respArr
[
'status'
]
=
1
;
$respArr
[
'data'
]
=
(
!
empty
(
$result
)
&&
!
empty
(
$result
=
$result
->
result_array
()))
?
$result
:
[];
return
$respArr
;
...
...
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