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
ce4bb13f
Commit
ce4bb13f
authored
5 years ago
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dc
parent
079a4f62
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
9 deletions
+44
-9
Api.php
application/controllers/Api.php
+8
-3
Api_model.php
application/models/Api_model.php
+33
-6
Webservice_model.php
application/models/Webservice_model.php
+3
-0
No files found.
application/controllers/Api.php
View file @
ce4bb13f
...
...
@@ -329,6 +329,10 @@ class Api extends CI_Controller {
switch
(
$txnType
){
case
'WALLET'
:
return
$this
->
Api_model
->
updateWalletTxn
(
$txnData
);
case
'HOTEL_BOOK'
:
if
(
isset
(
$txnData
[
'bookData'
])
&&
!
empty
(
$txnData
[
'bookData'
])){
return
$this
->
Api_model
->
hotelBooking
(
$txnData
);
}
}
}
...
...
@@ -345,12 +349,13 @@ class Api extends CI_Controller {
if
(
empty
(
$reqData
)
||
empty
(
$reqData
=
json_decode
(
$reqData
,
true
))
||
!
isset
(
$reqData
[
'amount'
])
||
empty
(
$amount
=
$reqData
[
'amount'
])
||
!
isset
(
$reqData
[
'auth_token'
])
||
empty
(
$auth_token
=
$reqData
[
'auth_token'
])){
redirect
(
$redUrl
.
'failure'
);
redirect
(
$redUrl
.
'failure'
);
}
if
(
isset
(
$reqData
[
'txnType'
])
&&
!
empty
(
$reqData
[
'txnType'
])){
$params
=
array
(
'mode'
=>
'1'
,
'status'
=>
'0'
,
'auth_token'
=>
$reqData
[
'auth_token'
],
'amount'
=>
$reqData
[
'amount'
]);
$params
=
array
(
'mode'
=>
'1'
,
'status'
=>
'0'
,
'auth_token'
=>
$reqData
[
'auth_token'
],
'amount'
=>
$reqData
[
'amount'
],
'bookData'
=>
(
isset
(
$reqData
[
'bookData'
]))
?
$reqData
[
'bookData'
]
:
''
);
$customData
=
$this
->
txnManager
(
$reqData
[
'txnType'
],
$params
);
if
(
empty
(
$customData
)){
...
...
This diff is collapsed.
Click to expand it.
application/models/Api_model.php
View file @
ce4bb13f
...
...
@@ -627,6 +627,7 @@ class Api_model extends CI_Model {
'created_date'
=>
date
(
'Y-m-d H:i:s'
),
'status'
=>
$promoStatus
);
}
$auth_token
=
$post_data
[
'auth_token'
];
$card_data
=
(
isset
(
$post_data
[
'cardData'
]))
?
$post_data
[
'cardData'
]
:
array
();
unset
(
$post_data
[
'auth_token'
],
$post_data
[
'has_payment'
],
$post_data
[
'cardData'
],
$post_data
[
'promocode_id'
],
$post_data
[
'redeem_amount'
]);
...
...
@@ -636,13 +637,11 @@ class Api_model extends CI_Model {
$this
->
db
->
insert
(
'promocode_used'
,
$promocodeData
);
}
$cardDetails
=
array
();
if
(
isset
(
$post_data
[
'cardData'
])
&&
!
empty
(
$card_data
=
$post_data
[
'cardData'
])){
// (CC)-Credit ,(DC)-Debit ,(DD)-Direct Debit,(PAYPAL)-PayPal,(NB)-Net Banking
if
(
!
empty
(
$card_data
)){
switch
(
$card_data
->
card_type
)
{
case
'1'
:
$cardDetails
[
'cardMode'
]
=
'CC'
;
break
;
case
'2'
:
$cardDetails
[
'cardMode'
]
=
'DC'
;
break
;
case
'3'
:
$cardDetails
[
'cardMode'
]
=
'DD'
;
break
;
default
:
$cardDetails
[
'cardMode'
]
=
'DD'
;
break
;
case
'1'
:
$cardDetails
[
'cardMode'
]
=
'DD'
;
break
;
case
'2'
:
$cardDetails
[
'cardMode'
]
=
'CC'
;
break
;
default
:
$cardDetails
[
'cardMode'
]
=
'CC'
;
break
;
}
switch
(
substr
(
$card_data
->
card_number
,
0
,
1
))
{
...
...
@@ -1791,5 +1790,32 @@ class Api_model extends CI_Model {
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Invalid user'
,
'code'
=>
'ER19'
);
}
}
public
function
hotelBooking
(
$txnData
=
array
()){
try
{
if
(
empty
(
$txnData
)){
return
;
}
if
(
$txnData
[
'status'
]
==
'0'
){
if
(
!
isset
(
$txnData
[
'mode'
])
||
empty
(
$txnData
[
'mode'
])
||
!
isset
(
$txnData
[
'amount'
])
||
empty
(
$txnData
[
'amount'
])
||
!
isset
(
$txnData
[
'auth_token'
])
||
empty
(
$txnData
[
'auth_token'
])
||
!
isset
(
$txnData
[
'bookData'
])
||
empty
(
$bookData
=
$txnData
[
'bookData'
])){
return
;
}
$user_id
=
$this
->
auth_token_get
(
$txnData
[
'auth_token'
]);
if
(
empty
(
$user_id
)){
return
;
}
$bookId
=
'HTL'
.
date
(
'ymd'
)
.
str_pad
(
rand
(
1111
,
9999
),
4
,
0
,
STR_PAD_LEFT
);
$insert
=
array
(
'hotel_book_id'
=>
$bookId
,
'hotel_name'
=>
$bookData
[
'hotelName'
],
'hotel_image'
=>
$bookData
[
'hotelImage'
],
'checkin'
=>
$bookData
[
'checkin'
],
'checkout'
=>
$bookData
[
'checkout'
],
'price'
=>
$bookData
[
'amount'
],
'request_data'
=>
json_encode
(
$bookData
[
'requestData'
]));
$this
->
db
->
insert
(
'hotel_booking'
,
$insert
);
return
array
(
'status'
=>
1
,
'transaction_id'
=>
$bookId
);
}
}
catch
(
Exception
$e
){}
}
}
?>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
application/models/Webservice_model.php
View file @
ce4bb13f
...
...
@@ -1888,6 +1888,9 @@ class Webservice_model extends CI_Model {
$user_ids
=
''
;
foreach
(
$custIds
AS
$id
)
{
if
(
!
empty
(
$user_ids
)
&&
in_array
(
$id
,
$user_ids
)){
continue
;
}
$user_ids
[]
=
$id
[
'customer_id'
];
}
...
...
This diff is collapsed.
Click to expand it.
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