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
3b036b3c
Commit
3b036b3c
authored
5 years ago
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dc
parent
3280636f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
27 deletions
+36
-27
Api.php
application/controllers/Api.php
+29
-16
generals_helper.php
application/helpers/generals_helper.php
+1
-3
Promocode_model.php
application/models/Promocode_model.php
+4
-8
payment.php
application/views/payment/payment.php
+2
-0
No files found.
application/controllers/Api.php
View file @
3b036b3c
...
...
@@ -357,13 +357,13 @@ class Api extends CI_Controller {
}
public
function
paymentFailureUrl
(){
$lastid
=
''
;
$response
=
''
;
$transaction_id
=
''
;
BayanPayPayment
();
$BayanPayArray
=
$this
->
bayanPayArray
(
'0'
,
'0'
,
'0'
,
'0'
);
$BayanPayOnlineObject
=
new
BayanPayBitmapPaymentIntegration
(
$BayanPayArray
);
$lastid
=
''
;
$response
=
''
;
$transaction_id
=
''
;
BayanPayPayment
();
$BayanPayArray
=
$this
->
bayanPayArray
(
'0'
,
'0'
,
'0'
,
'0'
);
$BayanPayOnlineObject
=
new
BayanPayBitmapPaymentIntegration
(
$BayanPayArray
);
if
(
isset
(
$_REQUEST
[
'responseParameter'
])
&&
$_REQUEST
[
'responseParameter'
]
!=
''
){
$response
=
$BayanPayOnlineObject
->
decryptData
(
$_REQUEST
[
'responseParameter'
],
$BayanPayOnlineObject
->
merchantKey
,
$BayanPayOnlineObject
->
iv
);
...
...
@@ -382,18 +382,31 @@ class Api extends CI_Controller {
public
function
paymentGateway
(
$amount
=
'0'
,
$lastid
=
'0'
,
$event_id
=
'0'
,
$booking_id
=
'0'
,
$custData
=
array
()){
BayanPayPayment
();
$BayanPayArray
=
$this
->
bayanPayArray
(
$amount
,
$lastid
,
$event_id
,
$booking_id
,
$custData
);
$BayanPayOnlineObject
=
new
BayanPayBitmapPaymentIntegration
(
$BayanPayArray
);
// $BayanPayOnlineObject = new BayanPayBitmapPaymentIntegration($BayanPayArray);
$iv
=
$BayanPayOnlineObject
->
iv
;
$merchantId
=
$BayanPayOnlineObject
->
merchantId
;
$merchantKey
=
$BayanPayOnlineObject
->
merchantKey
;
$collaboratorId
=
$BayanPayOnlineObject
->
collaboratorId
;
$requestParameter
=
$pText
;
$pText
=
$BayanPayOnlineObject
->
BayanPostData
;
$size
=
openssl_cipher_iv_length
(
'AES-256-CBC'
);
$pad
=
$size
-
(
strlen
(
$pText
)
%
$size
);
$padtext
=
$pText
.
str_repeat
(
chr
(
$pad
),
$pad
);
$pText
=
base64_encode
(
openssl_encrypt
(
$padtext
,
'AES-256-CBC'
,
base64_decode
(
$merchantKey
),
OPENSSL_RAW_DATA
|
OPENSSL_ZERO_PADDING
,
$iv
));
$requestParameter
=
$BayanPayOnlineObject
->
BayanPostData
;
if
(
$BayanPayOnlineObject
->
url
){
$requestUrl
=
'https://payments.bayanpay.sa/direcpay/secure/PaymentTxnServlet'
;
}
else
{
}
else
{
$requestUrl
=
'https://staging.bayanpay.sa/direcpay/secure/PaymentTxnServlet'
;
}
$this
->
load
->
view
(
'payment/payment'
,
array
(
'requestUrl'
=>
$requestUrl
,
'requestParameter'
=>
$requestParameter
));
'merchantId'
=>
$merchantId
,
'collaboratorId'
=>
$collaboratorId
,
'requestParameter'
=>
$requestParameter
));
}
function
baseurl
(){
...
...
@@ -421,9 +434,9 @@ class Api extends CI_Controller {
'billingDataBlock'
=>
true
,
'shippingDataBlock'
=>
true
,
'paymentDataBlock'
=>
true
,
'merchantDataBlock'
=>
tru
e
,
'otherDataBlock'
=>
fals
e
,
'DCCDataBlock'
=>
fals
e
'merchantDataBlock'
=>
fals
e
,
'otherDataBlock'
=>
tru
e
,
'DCCDataBlock'
=>
tru
e
),
'Field_Existence_Indicator_Transaction'
=>
array
(
'merchantOrderNumber'
=>
time
(),
...
...
@@ -470,7 +483,7 @@ class Api extends CI_Controller {
'expYear'
=>
'2025'
,
'CVV'
=>
'100'
,
'cardHolderName'
=>
'Test Master'
,
'cardType'
=>
'Master'
,
'cardType'
=>
'Master
Card
'
,
'custMobileNumber'
=>
''
,
'paymentID'
=>
''
,
'OTP'
=>
''
,
...
...
This diff is collapsed.
Click to expand it.
application/helpers/generals_helper.php
View file @
3b036b3c
...
...
@@ -359,9 +359,7 @@
function
getLanguages
(){
$thisObj
=
&
get_instance
();
$sql
=
"SELECT language_code FROM country
WHERE status='1'
GROUP BY language_code
$sql
=
"SELECT language_code FROM country WHERE status='1' GROUP BY language_code
ORDER BY CASE WHEN language_code LIKE 'EN' THEN 0 ELSE 1 END, language_code ASC"
;
$langData
=
$thisObj
->
db
->
query
(
$sql
);
...
...
This diff is collapsed.
Click to expand it.
application/models/Promocode_model.php
View file @
3b036b3c
...
...
@@ -40,12 +40,10 @@ class Promocode_model extends CI_Model {
}
$dataArr
[
'city_id'
]
=
$promodata
[
'city_id'
];
$dataArr
[
'event_id'
]
=
$promodata
[
'event_id'
];
//$dataArr['end_date'] = $promodata['end_date'];
$dataArr
[
'end_date'
]
=
date
(
'Y-m-d'
,
$promodata
[
'end_date'
]);
$dataArr
[
'end_date'
]
=
date
(
'Y-m-d'
,
strtotime
(
$promodata
[
'end_date'
]));
$dataArr
[
'use_limit'
]
=
$promodata
[
'use_limit'
];
$dataArr
[
'max_redeem'
]
=
$promodata
[
'max_redeem'
];
//$dataArr['start_date'] = $promodata['start_date'];
$dataArr
[
'start_date'
]
=
date
(
'Y-m-d'
,
$promodata
[
'start_date'
]);
$dataArr
[
'start_date'
]
=
date
(
'Y-m-d'
,
strtotime
(
$promodata
[
'start_date'
]));
$dataArr
[
'category_id'
]
=
$promodata
[
'category_id'
];
$dataArr
[
'discount_type'
]
=
$promodata
[
'discount_type'
];
$dataArr
[
'promocode_name'
]
=
$promodata
[
'promocode_name'
];
...
...
@@ -91,12 +89,10 @@ class Promocode_model extends CI_Model {
}
$dataArr
[
'city_id'
]
=
$promodata
[
'city_id'
];
$dataArr
[
'event_id'
]
=
$promodata
[
'event_id'
];
// $dataArr['end_date'] = $promodata['end_date'];
$dataArr
[
'end_date'
]
=
date
(
'Y-m-d'
,
$promodata
[
'end_date'
]);
$dataArr
[
'end_date'
]
=
date
(
'Y-m-d'
,
strtotime
(
$promodata
[
'end_date'
]));
$dataArr
[
'use_limit'
]
=
$promodata
[
'use_limit'
];
$dataArr
[
'max_redeem'
]
=
$promodata
[
'max_redeem'
];
// $dataArr['start_date'] = $promodata['start_date'];
$dataArr
[
'start_date'
]
=
date
(
'Y-m-d'
,
$promodata
[
'start_date'
]);
$dataArr
[
'start_date'
]
=
date
(
'Y-m-d'
,
strtotime
(
$promodata
[
'start_date'
]));
$dataArr
[
'category_id'
]
=
$promodata
[
'category_id'
];
$dataArr
[
'discount_type'
]
=
$promodata
[
'discount_type'
];
$dataArr
[
'promocode_name'
]
=
$promodata
[
'promocode_name'
];
...
...
This diff is collapsed.
Click to expand it.
application/views/payment/payment.php
View file @
3b036b3c
...
...
@@ -6,6 +6,8 @@
<body>
<center><h1
style=
"margin-top: 20%"
>
Please do not refresh this page...
</h1></center>
<form
action=
"
<?=
$requestUrl
?>
"
method=
"post"
id=
"BayanPay_online_payment"
>
<input
type=
"hidden"
name=
"MerchantID"
value=
"
<?php
echo
$merchantId
;
?>
"
>
<input
type=
"hidden"
name=
"CollaboratorID"
value=
"
<?php
echo
$collaboratorId
;
?>
"
>
<input
type=
"hidden"
name=
"requestParameter"
value=
"
<?=
$requestParameter
?>
"
>
</form>
<script
type=
"text/javascript"
>
...
...
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