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
4ed95df4
Commit
4ed95df4
authored
Feb 26, 2020
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dc
parent
3aa08eee
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
101 additions
and
9 deletions
+101
-9
Api.php
application/controllers/Api.php
+45
-2
OrganizerServices.php
application/controllers/OrganizerServices.php
+9
-5
generals_helper.php
application/helpers/generals_helper.php
+2
-2
Organizer_model.php
application/models/Organizer_model.php
+23
-0
Validation_model.php
application/models/Validation_model.php
+8
-0
Validation_organizer_model.php
application/models/Validation_organizer_model.php
+14
-0
No files found.
application/controllers/Api.php
View file @
4ed95df4
...
...
@@ -783,6 +783,51 @@ class Api extends CI_Controller {
}
}
public
function
removeCard
(){
$settings
=
getSettings
();
$merchant_iv
=
$settings
[
'merchant_iv'
];
$merchant_id
=
$settings
[
'merchant_id'
];
$merchant_key
=
$settings
[
'merchant_key'
];
$cust_id
=
$this
->
Api_model
->
auth_token_get
(
$this
->
auth_token
);
if
(
empty
(
$cust_id
)){
$this
->
errorResponse
(
'891'
,
'Invalid User'
);
}
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$reqData
=
$this
->
decrypt
(
$data
[
'requestData'
],
$this
->
local_key
,
$this
->
local_iv
);
if
(
empty
(
$reqData
)
||
empty
(
$reqData
=
json_decode
(
$reqData
,
true
))
||
!
isset
(
$reqData
[
'email'
])
||
empty
(
$reqData
[
'email'
])
||
!
isset
(
$reqData
[
'token'
])
||
empty
(
$reqData
[
'token'
])){
$this
->
errorResponse
(
'892'
,
'Invalid Request Data'
);
}
$request
=
'{"sessionId":"'
.
time
()
.
rand
(
100000
,
999999
)
.
'","merchantId":"'
.
$merchant_id
.
'",
"custId":"'
.
$cust_id
.
'","emailId":"'
.
$reqData
[
'email'
]
.
'",
"tokenNo":"'
.
$reqData
[
'token'
]
.
'"}'
;
$plainText
=
$this
->
encryptePayData
(
$merchant_iv
,
$merchant_key
,
$request
);
$plainText
=
$merchant_id
.
'|'
.
$plainText
;
$env
=
(
strpos
(
$settings
[
'payment_gateway_url'
],
'staging'
)
!==
false
)
?
'staging'
:
'payments'
;
$ch
=
curl_init
();
curl_setopt
(
$ch
,
CURLOPT_URL
,
"https://
$env
.bayanpay.sa/direcpay/secure/PaymentsDeleteStoredCardDtlsAPI"
);
curl_setopt
(
$ch
,
CURLOPT_RETURNTRANSFER
,
1
);
curl_setopt
(
$ch
,
CURLOPT_POST
,
1
);
curl_setopt
(
$ch
,
CURLOPT_POSTFIELDS
,
$plainText
);
curl_setopt
(
$ch
,
CURLOPT_HTTPHEADER
,
array
(
'Content-Type: application/x-www-form-urlencoded'
));
$result
=
curl_exec
(
$ch
);
if
(
empty
(
$result
)){
$this
->
errorResponse
(
'892'
,
'Invalid Card Data'
);
}
$resp
=
$this
->
decryptePayData
(
$merchant_iv
,
$merchant_key
,
$result
);
if
(
empty
(
$resp
)
||
isset
(
$resp
->
status
)
||
$resp
->
status
!=
'SUCCESS'
){
$this
->
errorResponse
(
'893'
,
'No Card Found'
);
}
$this
->
response
(
array
(
'message'
=>
$resp
->
statusMessage
));
}
function
hotelBooking
(){
try
{
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
...
...
@@ -803,7 +848,5 @@ class Api extends CI_Controller {
$this
->
errorResponse
(
'894'
,
'Something went wrong, Please try again'
);
}
}
}
?>
application/controllers/OrganizerServices.php
View file @
4ed95df4
...
...
@@ -655,11 +655,15 @@ class OrganizerServices extends CI_Controller {
}
}
public
function
mobileNumberAvailability
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Organizer_model
->
mobileNumberAvailability
(
$data
);
if
(
$res
[
'status'
]
!=
0
){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
/*================ END : Organizer API ================*/
}
...
...
application/helpers/generals_helper.php
View file @
4ed95df4
...
...
@@ -164,8 +164,8 @@
break
;
case
2
:
$menus
=
array
(
'Dashboard'
=>
array
(
1
,
2
,
3
,
4
),
'Tag'
=>
array
(),
'Host'
=>
array
(
1
),
'City'
=>
array
(),
'Category'
=>
array
(),
'
Promocode
'
=>
array
(
1
,
2
,
3
,
4
),
'
Event'
=>
array
(
1
,
2
,
3
,
4
),
'
Checker'
=>
array
(
1
,
2
,
3
,
4
),
'Customer'
=>
array
(),
'City'
=>
array
(),
'Category'
=>
array
(),
'
Event
'
=>
array
(
1
,
2
,
3
,
4
),
'Checker'
=>
array
(
1
,
2
,
3
,
4
),
'Customer'
=>
array
(),
'Booking'
=>
array
(
1
,
2
,
3
,
4
),
'Venue'
=>
array
(
1
,
2
,
3
,
4
),
'HotelCity'
=>
array
(
1
,
2
,
3
,
4
));
break
;
case
4
:
...
...
application/models/Organizer_model.php
View file @
4ed95df4
...
...
@@ -1755,6 +1755,29 @@ class Organizer_model extends CI_Model {
return
$res
;
}
public
function
mobileNumberAvailability
(
$data
){
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Ohh No!! Something Went South'
,
'code'
=>
'ER06'
);
try
{
$number
=
trim
(
preg_replace
(
'/[^A-Za-z0-9\-]/'
,
''
,
$data
[
'country_code'
]
.
$data
[
'phone_no'
]),
0
);
$sql
=
"SELECT provider_id FROM provider AS PDR
INNER JOIN users AS USR ON (USR.id = PDR.provider_id)
WHERE (PDR.phone LIKE '%"
.
$number
.
"' OR PDR.phone LIKE '%"
.
$data
[
'phone_no'
]
.
"') AND
USR.user_type = '2' AND USR.status = '1'"
;
$resp
=
$this
->
db
->
query
(
$sql
)
->
row_array
();
$phAvail
=
false
;
if
(
!
empty
(
$resp
)
&&
isset
(
$resp
[
'provider_id'
])
&&
!
empty
(
$resp
[
'provider_id'
])){
$phAvail
=
true
;
}
$res
=
array
(
'status'
=>
1
,
'data'
=>
array
(
"country_code"
=>
$data
[
'country_code'
],
"phone"
=>
$data
[
'phone_no'
],
"is_phone_available"
=>
$phAvail
));
}
catch
(
Exception
$e
){
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Ohh No!! Something Went South'
,
'code'
=>
'ER06'
);
}
return
$res
;
}
function
send_mail
(
$subject
,
$email
,
$message
,
$attach
=
null
)
{
$ci
=&
get_instance
();
$ci
->
load
->
library
(
'email'
);
...
...
application/models/Validation_model.php
View file @
4ed95df4
...
...
@@ -397,6 +397,14 @@ class Validation_model extends CI_Model {
'message'
=>
'Request Data is null or empty'
)
)
),
'removeCard'
=>
array
(
'requestData'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Request Data is null or empty'
)
)
)
);
...
...
application/models/Validation_organizer_model.php
View file @
4ed95df4
...
...
@@ -889,6 +889,20 @@ class Validation_organizer_model extends CI_Model {
)
)
),
'mobileNumberAvailability'
=>
array
(
'phone_no'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER30'
,
'message'
=>
'Organizer Pnone is null or empty'
)
),
'country_code'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER32'
,
'message'
=>
'Country Code is null or empty'
)
)
)
);
public
function
_consruct
(){
...
...
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