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
e680e527
Commit
e680e527
authored
Oct 04, 2019
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dc
parent
3b036b3c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
185 additions
and
213 deletions
+185
-213
Api.php
application/controllers/Api.php
+146
-175
generals_helper.php
application/helpers/generals_helper.php
+3
-3
Api_model.php
application/models/Api_model.php
+22
-19
Webservice_model.php
application/models/Webservice_model.php
+10
-12
payment.php
application/views/payment/payment.php
+4
-4
No files found.
application/controllers/Api.php
View file @
e680e527
...
@@ -320,8 +320,11 @@ class Api extends CI_Controller {
...
@@ -320,8 +320,11 @@ class Api extends CI_Controller {
}
}
public
function
payNow
(
$auth_token
=
''
,
$amount
=
0
,
$booking_id
=
''
,
$event_id
=
''
){
public
function
payNow
(
$auth_token
=
''
,
$amount
=
0
,
$booking_id
=
''
,
$event_id
=
''
){
$settings
=
getSettings
();
$redUrl
=
$settings
[
'web_base_url'
];
if
(
empty
(
$auth_token
)
||
empty
(
$amount
)
||
empty
(
$booking_id
)){
if
(
empty
(
$auth_token
)
||
empty
(
$amount
)
||
empty
(
$booking_id
)){
redirect
(
'https://timeout.sa/staging/
failure'
);
redirect
(
$redUrl
.
'
failure'
);
}
}
$payData
=
array
(
'auth_token'
=>
$auth_token
,
'amount'
=>
$amount
,
'booking_id'
=>
$booking_id
);
$payData
=
array
(
'auth_token'
=>
$auth_token
,
'amount'
=>
$amount
,
'booking_id'
=>
$booking_id
);
$res
=
$this
->
Api_model
->
payNow
(
$payData
);
$res
=
$this
->
Api_model
->
payNow
(
$payData
);
...
@@ -330,187 +333,155 @@ class Api extends CI_Controller {
...
@@ -330,187 +333,155 @@ class Api extends CI_Controller {
$this
->
paymentGateway
(
$amount
,
$res
[
'transaction_id'
],
$event_id
,
$booking_id
,
$res
[
'custData'
]);
$this
->
paymentGateway
(
$amount
,
$res
[
'transaction_id'
],
$event_id
,
$booking_id
,
$res
[
'custData'
]);
}
}
else
{
else
{
redirect
(
'https://timeout.sa/staging/failure?event_id='
.
$eventid
);
redirect
(
$redUrl
.
'failure?event_id='
.
$eventid
);
}
}
}
}
public
function
paymentSuccessUrl
(){
public
function
paymentGateway
(
$amount
=
'0'
,
$last_id
=
'0'
,
$event_id
=
'0'
,
$booking_id
=
'0'
,
$custData
=
array
()){
$response
=
''
;
$amount
=
$amount
;
$transaction_id
=
''
;
$phone
=
(
isset
(
$custData
->
phone
))
?
$custData
->
phone
:
''
;
BayanPayPayment
();
$email
=
(
isset
(
$custData
->
email
))
?
$custData
->
email
:
''
;
$BayanPayArray
=
$this
->
bayanPayArray
(
'0'
,
'0'
,
'0'
,
'0'
);
$userId
=
(
isset
(
$custData
->
userId
))
?
$custData
->
userId
:
''
;
$BayanPayOnlineObject
=
new
BayanPayBitmapPaymentIntegration
(
$BayanPayArray
);
$f_Name
=
(
isset
(
$custData
->
name
))
?
$custData
->
name
:
''
;
$l_Name
=
'T'
;
if
(
isset
(
$_REQUEST
[
'responseParameter'
])
&&
$_REQUEST
[
'responseParameter'
]
!=
''
){
$add1
=
'Mumbai'
;
$response
=
$BayanPayOnlineObject
->
decryptData
(
$_REQUEST
[
'responseParameter'
],
$BayanPayOnlineObject
->
merchantKey
,
$BayanPayOnlineObject
->
iv
);
$add2
=
'Mumbai'
;
$city
=
'Mumbai'
;
$state
=
'Maharashtra'
;
$pincode
=
'123456'
;
$cardNo
=
'5111111111111118'
;
$expMonth
=
'0'
;
$expYear
=
'2022'
;
$cvv
=
'100'
;
$holder
=
'Basanta Mahunta'
;
$cardType
=
'MasterCard'
;
$failureUrl
=
base_url
(
'Api/paymentFailureUrl'
);
$successUrl
=
base_url
(
'Api/paymentSuccessUrl'
);
$pText
=
'1111110||11111111|'
.
$last_id
.
'|'
.
$amount
.
'|'
.
$successUrl
.
'|'
.
$failureUrl
.
'|INTERNET|DD|01|SAR||1111111111111|'
.
$f_Name
.
'|'
.
$l_Name
.
'|'
.
$add1
.
'|'
.
$add2
.
'|'
.
$city
.
'|'
.
$state
.
'|'
.
$pincode
.
'|SA|'
.
$email
.
'|'
.
$phone
.
'|34|344|34355344||111111111111|'
.
$f_Name
.
'|'
.
$l_Name
.
'|'
.
$add1
.
'|'
.
$add2
.
'|'
.
$city
.
'|'
.
$state
.
'|'
.
$pincode
.
'|SA|'
.
$phone
.
'|34|344|34355344||11111100000|'
.
$cardNo
.
'|'
.
$expMonth
.
'|'
.
$expYear
.
'|'
.
$cvv
.
'|'
.
$holder
.
'|'
.
$cardType
.
'||1110000|'
.
$last_id
.
'|'
.
$event_id
.
'|'
.
$booking_id
.
'||1000000|'
.
$userId
;
$ref_id
=
explode
(
'|'
,
$response
[
'Transaction_related_information'
]);
$settings
=
getSettings
();
$transaction_id
=
$ref_id
[
1
];
$iv
=
$settings
[
'merchant_iv'
];
$last_id
=
explode
(
'|'
,
$response
[
'Merchant_Information'
]);
$mId
=
$settings
[
'merchant_id'
];
$lastid
=
$last_id
[
1
];
$mKey
=
$settings
[
'merchant_key'
];
$eventid
=
$last_id
[
2
];
$colabId
=
$settings
[
'collaborator_id'
];
$booking_id
=
$last_id
[
3
];
$requestUrl
=
$settings
[
'payment_gateway_url'
];
$this
->
Api_model
->
update_payment
(
$response
,
$transaction_id
,
$lastid
,
'1'
)
;
redirect
(
'https://timeout.sa/staging/bookingdetails?booking_id='
.
$booking_id
);
$size
=
openssl_cipher_iv_length
(
'AES-256-CBC'
);
}
$pad
=
$size
-
(
strlen
(
$pText
)
%
$size
);
$painText
=
$pText
.
str_repeat
(
chr
(
$pad
),
$pad
);
$painText
=
base64_encode
(
openssl_encrypt
(
$painText
,
'AES-256-CBC'
,
base64_decode
(
$mKey
),
OPENSSL_RAW_DATA
|
OPENSSL_ZERO_PADDING
,
$iv
));
$this
->
load
->
view
(
'payment/payment'
,
array
(
'rUrl'
=>
$requestUrl
,
'mId'
=>
$mId
,
'colabId'
=>
$colabId
,
'requestParam'
=>
$mId
.
'||'
.
$colabId
.
'||'
.
$painText
));
}
}
public
function
paymentFailureUrl
(){
public
function
paymentSuccessUrl
(){
$lastid
=
''
;
if
(
isset
(
$_REQUEST
[
'responseParameter'
])
&&
!
empty
(
$_REQUEST
[
'responseParameter'
])
&&
$response
=
''
;
!
empty
(
$response
=
explode
(
"||"
,
$_REQUEST
[
'responseParameter'
]))
&&
!
isset
(
$_POST
[
'txnErrMsg'
])){
$transaction_id
=
''
;
BayanPayPayment
();
$BayanPayArray
=
$this
->
bayanPayArray
(
'0'
,
'0'
,
'0'
,
'0'
);
$BayanPayOnlineObject
=
new
BayanPayBitmapPaymentIntegration
(
$BayanPayArray
);
if
(
isset
(
$_REQUEST
[
'responseParameter'
])
&&
$_REQUEST
[
'responseParameter'
]
!=
''
){
$settings
=
getSettings
();
$response
=
$BayanPayOnlineObject
->
decryptData
(
$_REQUEST
[
'responseParameter'
],
$BayanPayOnlineObject
->
merchantKey
,
$BayanPayOnlineObject
->
iv
);
$iv
=
$settings
[
'merchant_iv'
];
$mKey
=
$settings
[
'merchant_key'
];
$ref_id
=
explode
(
'|'
,
$response
[
'Transaction_related_information'
]);
$redUrl
=
$settings
[
'web_base_url'
];
$transaction_id
=
$ref_id
[
1
];
$last_id
=
explode
(
'|'
,
$response
[
'Merchant_Information'
]);
if
(
!
isset
(
$response
[
1
])
||
empty
(
$response
[
1
])){
$lastid
=
$last_id
[
1
];
redirect
(
$redUrl
.
'failure'
);
$eventid
=
$last_id
[
2
];
}
$booking_id
=
$last_id
[
3
];
$this
->
Api_model
->
update_payment
(
$response
,
$transaction_id
,
$lastid
,
'0'
);
$enctext
=
base64_decode
(
$response
[
1
]);
$padtext
=
openssl_decrypt
(
$enctext
,
'AES-256-CBC'
,
base64_decode
(
$mKey
),
OPENSSL_RAW_DATA
|
OPENSSL_ZERO_PADDING
,
$iv
);
redirect
(
'https://timeout.sa/staging/failure?event_id='
.
$eventid
);
$pad
=
ord
(
$padtext
{
strlen
(
$padtext
)
-
1
});
}
if
(
$pad
>
strlen
(
$padtext
)){
redirect
(
$redUrl
.
'failure'
);
}
if
(
strspn
(
$padtext
,
$padtext
{
strlen
(
$padtext
)
-
1
},
strlen
(
$padtext
)
-
$pad
)
!=
$pad
){
redirect
(
$redUrl
.
'failure'
);
}
$response
=
substr
(
$padtext
,
0
,
-
1
*
$pad
);
if
(
empty
(
$response
)
||
empty
(
$response
=
explode
(
"||"
,
$response
))){
redirect
(
$redUrl
.
'failure'
);
}
$last_id
=
''
;
$eventid
=
''
;
$booking_id
=
''
;
$transaction_id
=
''
;
if
(
isset
(
$response
[
2
])
&&
!
empty
(
$response
[
2
])
&&
!
empty
(
$data
=
explode
(
'|'
,
$response
[
2
]))
&&
isset
(
$data
[
1
])
&&
!
empty
(
$data
[
1
])){
$transaction_id
=
$data
[
1
];
}
if
(
isset
(
$response
[
4
])
&&
!
empty
(
$response
[
4
])
&&
!
empty
(
$data
=
explode
(
'|'
,
$response
[
4
]))
&&
isset
(
$data
[
1
])
&&
!
empty
(
$data
[
1
])
&&
isset
(
$data
[
2
])
&&
!
empty
(
$data
[
2
])
&&
isset
(
$data
[
3
])
&&
!
empty
(
$data
[
3
])){
$last_id
=
$data
[
1
];
$eventid
=
$data
[
2
];
$booking_id
=
$data
[
3
];
}
if
(
!
empty
(
$transaction_id
)
&&
!
empty
(
$last_id
)){
$this
->
Api_model
->
update_payment
(
$response
,
$transaction_id
,
$last_id
,
'1'
)
;
}
if
(
!
empty
(
$booking_id
)){
redirect
(
$redUrl
.
'bookingdetails?booking_id='
.
$booking_id
);
}
}
redirect
(
$redUrl
.
'failure'
);
}
}
public
function
paymentGateway
(
$amount
=
'0'
,
$lastid
=
'0'
,
$event_id
=
'0'
,
$booking_id
=
'0'
,
$custData
=
array
()){
public
function
paymentFailureUrl
(){
BayanPayPayment
();
$settings
=
getSettings
();
$BayanPayArray
=
$this
->
bayanPayArray
(
$amount
,
$lastid
,
$event_id
,
$booking_id
,
$custData
);
$redUrl
=
$settings
[
'web_base_url'
];
// $BayanPayOnlineObject = new BayanPayBitmapPaymentIntegration($BayanPayArray);
if
(
empty
(
$_REQUEST
[
'responseParameter'
])){
$iv
=
$BayanPayOnlineObject
->
iv
;
redirect
(
$redUrl
.
'failure'
);
$merchantId
=
$BayanPayOnlineObject
->
merchantId
;
}
$merchantKey
=
$BayanPayOnlineObject
->
merchantKey
;
$collaboratorId
=
$BayanPayOnlineObject
->
collaboratorId
;
if
(
isset
(
$_REQUEST
[
'responseParameter'
])
&&
!
empty
(
$_REQUEST
[
'responseParameter'
])
&&
$requestParameter
=
$pText
;
!
empty
(
$response
=
explode
(
"||"
,
$_REQUEST
[
'responseParameter'
]))){
$iv
=
$settings
[
'merchant_iv'
];
$pText
=
$BayanPayOnlineObject
->
BayanPostData
;
$mKey
=
$settings
[
'merchant_key'
];
$size
=
openssl_cipher_iv_length
(
'AES-256-CBC'
);
if
(
!
isset
(
$response
[
1
])
||
empty
(
$response
[
1
])){
$pad
=
$size
-
(
strlen
(
$pText
)
%
$size
);
redirect
(
$redUrl
.
'failure'
);
$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
));
$enctext
=
base64_decode
(
$response
[
1
]);
$padtext
=
openssl_decrypt
(
$enctext
,
'AES-256-CBC'
,
base64_decode
(
$mKey
),
OPENSSL_RAW_DATA
|
OPENSSL_ZERO_PADDING
,
$iv
);
if
(
$BayanPayOnlineObject
->
url
){
$pad
=
ord
(
$padtext
{
strlen
(
$padtext
)
-
1
});
$requestUrl
=
'https://payments.bayanpay.sa/direcpay/secure/PaymentTxnServlet'
;
if
(
$pad
>
strlen
(
$padtext
)){
}
else
{
redirect
(
$redUrl
.
'failure'
);
$requestUrl
=
'https://staging.bayanpay.sa/direcpay/secure/PaymentTxnServlet'
;
}
}
if
(
strspn
(
$padtext
,
$padtext
{
strlen
(
$padtext
)
-
1
},
strlen
(
$padtext
)
-
$pad
)
!=
$pad
){
redirect
(
$redUrl
.
'failure'
);
$this
->
load
->
view
(
'payment/payment'
,
array
(
'requestUrl'
=>
$requestUrl
,
}
'merchantId'
=>
$merchantId
,
$response
=
substr
(
$padtext
,
0
,
-
1
*
$pad
);
'collaboratorId'
=>
$collaboratorId
,
'requestParameter'
=>
$requestParameter
));
if
(
empty
(
$response
=
explode
(
"||"
,
$response
))){
}
redirect
(
$redUrl
.
'failure'
);
}
function
baseurl
(){
if
(
isset
(
$_SERVER
[
'HTTPS'
]))
$last_id
=
''
;
$protocol
=
(
$_SERVER
[
'HTTPS'
]
&&
$_SERVER
[
'HTTPS'
]
!=
"off"
)
?
"https"
:
"http"
;
if
(
isset
(
$response
[
1
])
&&
!
empty
(
$response
[
1
])
&&
!
empty
(
$data
=
explode
(
'|'
,
$response
[
1
]))
&&
else
isset
(
$data
[
1
])
&&
!
empty
(
$data
[
1
])){
$protocol
=
'http'
;
$last_id
=
$data
[
1
];
return
$protocol
.
"://"
.
$_SERVER
[
'HTTP_HOST'
]
.
$_SERVER
[
'REQUEST_URI'
];
$this
->
Api_model
->
update_payment
(
$response
,
''
,
$last_id
,
'0'
);
}
$sql
=
"SELECT BOK.event_id FROM transaction AS TX
function
bayanPayArray
(
$amount
=
'0'
,
$lastid
=
''
,
$event_id
=
''
,
$booking_id
=
''
,
$custData
=
array
()){
INNER JOIN booking AS BOK ON (BOK.bookId=TX.booking_id)
$settings
=
getSettings
();
WHERE TX.id='
$last_id
'"
;
$trxData
=
$this
->
db
->
query
(
$sql
)
->
row_array
();
$BayanPayArray
=
if
(
!
empty
(
$trxData
)
&&
isset
(
$trxData
[
'event_id'
])
&&
!
empty
(
$trxData
[
'event_id'
])){
array
(
redirect
(
$redUrl
.
'failure?event_id='
.
$trxData
[
'event_id'
]);
'BayanPay_Online_setting'
=>
array
(
}
'merchantKey'
=>
$settings
[
'merchant_key'
],
}
'merchantId'
=>
$settings
[
'merchant_id'
],
}
'collaboratorId'
=>
'BAYANPAY'
,
redirect
(
$redUrl
.
'failure'
);
'iv'
=>
'0123456789abcdef'
,
'url'
=>
false
),
'Block_Existence_Indicator'
=>
array
(
'transactionDataBlock'
=>
true
,
'billingDataBlock'
=>
true
,
'shippingDataBlock'
=>
true
,
'paymentDataBlock'
=>
true
,
'merchantDataBlock'
=>
false
,
'otherDataBlock'
=>
true
,
'DCCDataBlock'
=>
true
),
'Field_Existence_Indicator_Transaction'
=>
array
(
'merchantOrderNumber'
=>
time
(),
'amount'
=>
$amount
,
'successUrl'
=>
base_url
(
'Api/paymentSuccessUrl'
),
'failureUrl'
=>
base_url
(
'Api/paymentFailureUrl'
),
'transactionMode'
=>
'INTERNET'
,
'payModeType'
=>
'CC'
,
'transactionType'
=>
'01'
,
'currency'
=>
'SAR'
),
'Field_Existence_Indicator_Billing'
=>
array
(
'billToFirstName'
=>
(
isset
(
$custData
->
name
))
?
$custData
->
name
:
''
,
'billToLastName'
=>
''
,
'billToStreet1'
=>
''
,
'billToStreet2'
=>
''
,
'billToCity'
=>
''
,
'billToState'
=>
''
,
'billtoPostalCode'
=>
''
,
'billToCountry'
=>
''
,
'billToEmail'
=>
(
isset
(
$custData
->
email
))
?
$custData
->
email
:
''
,
'billToMobileNumber'
=>
(
isset
(
$custData
->
phone
))
?
$custData
->
phone
:
''
,
'billToPhoneNumber1'
=>
''
,
'billToPhoneNumber2'
=>
''
,
'billToPhoneNumber3'
=>
''
),
'Field_Existence_Indicator_Shipping'
=>
array
(
'shipToFirstName'
=>
(
isset
(
$custData
->
name
))
?
$custData
->
name
:
''
,
'shipToLastName'
=>
''
,
'shipToStreet1'
=>
''
,
'shipToStreet2'
=>
''
,
'shipToCity'
=>
''
,
'shipToState'
=>
''
,
'shipToPostalCode'
=>
''
,
'shipToCountry'
=>
''
,
'shipToPhoneNumber1'
=>
''
,
'shipToPhoneNumber2'
=>
''
,
'shipToPhoneNumber3'
=>
''
,
'shipToMobileNumber'
=>
(
isset
(
$custData
->
phone
))
?
$custData
->
phone
:
''
),
'Field_Existence_Indicator_Payment'
=>
array
(
'cardNumber'
=>
'5123450000000008'
,
'expMonth'
=>
'07'
,
'expYear'
=>
'2025'
,
'CVV'
=>
'100'
,
'cardHolderName'
=>
'Test Master'
,
'cardType'
=>
'MasterCard'
,
'custMobileNumber'
=>
''
,
'paymentID'
=>
''
,
'OTP'
=>
''
,
'gatewayID'
=>
''
,
'cardToken'
=>
''
),
'Field_Existence_Indicator_Merchant'
=>
array
(
'UDF1'
=>
$lastid
,
'UDF2'
=>
$event_id
,
'UDF3'
=>
$booking_id
),
'Field_Existence_Indicator_OtherData'
=>
array
(
'custID'
=>
(
isset
(
$custData
->
userId
))
?
$custData
->
userId
:
''
,
'transactionSource'
=>
'IVR'
,
'productInfo'
=>
''
,
'isUserLoggedIn'
=>
''
,
'itemTotal'
=>
''
,
'itemCategory'
=>
''
,
'ignoreValidationResult'
=>
'FALSE'
),
'Field_Existence_Indicator_DCC'
=>
array
(
'DCCReferenceNumber'
=>
$lastid
.
$event_id
.
$booking_id
,
'foreignAmount'
=>
$amount
,
'ForeignCurrency'
=>
'SAR'
)
);
return
$BayanPayArray
;
}
}
public
function
checker_bookingDetails
(){
public
function
checker_bookingDetails
(){
...
...
application/helpers/generals_helper.php
View file @
e680e527
...
@@ -125,9 +125,9 @@
...
@@ -125,9 +125,9 @@
return
$savePath
;
return
$savePath
;
}
}
function
BayanPayPayment
(){
//
function BayanPayPayment(){
include
'BayanPayPaymentLibrary.php'
;
//
include 'BayanPayPaymentLibrary.php';
}
//
}
function
getCurrency
(
$userId
=
''
){
function
getCurrency
(
$userId
=
''
){
$CI
=
&
get_instance
();
$CI
=
&
get_instance
();
...
...
application/models/Api_model.php
View file @
e680e527
...
@@ -557,30 +557,30 @@ class Api_model extends CI_Model {
...
@@ -557,30 +557,30 @@ class Api_model extends CI_Model {
$imgExt
=
strtolower
(
$imgNameArr
[
1
]);
$imgExt
=
strtolower
(
$imgNameArr
[
1
]);
if
(
$imgExt
==
'png'
||
$imgExt
==
'jpeg'
||
$imgExt
==
'jpg'
||
$imgExt
==
'gif'
){
if
(
$imgExt
==
'png'
||
$imgExt
==
'jpeg'
||
$imgExt
==
'jpg'
||
$imgExt
==
'gif'
){
$imgPath
=
'assets/uploads/user/CUST_'
.
$user_id
.
'.
png'
;
$imgPath
=
'assets/uploads/user/CUST_'
.
$user_id
.
'.
'
.
$imgExt
;
$imgQRPath
=
'assets/uploads/user/CUST_QR_'
.
$user_id
.
'.png'
;
//
$imgQRPath = 'assets/uploads/user/CUST_QR_'.$user_id.'.png';
$bagImagePath
=
'assets/uploads/user/bitmoji_back.png'
;
//
$bagImagePath = 'assets/uploads/user/bitmoji_back.png';
move_uploaded_file
(
$data
[
'file'
][
"tmp_name"
],
"./"
.
$imgPath
);
move_uploaded_file
(
$data
[
'file'
][
"tmp_name"
],
"./"
.
$imgPath
);
$imgSrc
=
imagecreatefrompng
(
$imgPath
);
//
$imgSrc = imagecreatefrompng($imgPath);
$bagSrc
=
imagecreatefrompng
(
$bagImagePath
);
//
$bagSrc = imagecreatefrompng($bagImagePath);
$bagW
=
imagesx
(
$bagSrc
)
/
3
;
//
$bagW = imagesx($bagSrc)/3;
$bagH
=
imagesy
(
$bagSrc
)
/
3
;
//
$bagH = imagesy($bagSrc)/3;
$imgW
=
imagesx
(
$imgSrc
);
//
$imgW = imagesx($imgSrc);
$imgH
=
imagesy
(
$imgSrc
);
//
$imgH = imagesy($imgSrc);
$scale
=
$imgW
/
$bagW
;
//
$scale = $imgW/$bagW;
$iWidth
=
$bagW
;
//
$iWidth = $bagW;
$iHeight
=
$imgH
/
$scale
;
//
$iHeight = $imgH/$scale;
imagecopyresampled
(
$bagSrc
,
$imgSrc
,
$iWidth
,
$bagH
,
0
,
0
,
$iWidth
,
$iHeight
,
$imgW
,
$imgH
);
//
imagecopyresampled($bagSrc,$imgSrc,$iWidth,$bagH,0,0,$iWidth,$iHeight,$imgW,$imgH);
imagepng
(
$bagSrc
,
$imgPath
);
//
imagepng($bagSrc,$imgPath);
imagealphablending
(
$imgPath
,
false
);
//
imagealphablending($imgPath, false);
imagesavealpha
(
$imgPath
,
true
);
//
imagesavealpha($imgPath, true);
genQRcode
(
encode_param
(
$user_id
),
$imgQRPath
,
$imgPath
);
//
genQRcode(encode_param($user_id),$imgQRPath,$imgPath);
$post_data
[
'profile_image'
]
=
$imgPath
;
$post_data
[
'profile_image'
]
=
$imgPath
;
$post_data
[
'profile_image_qr'
]
=
$imgQRPath
;
$post_data
[
'profile_image_qr'
]
=
''
;
//
$imgQRPath;
$state
=
$this
->
db
->
where
(
'customer_id'
,
$user_id
)
->
update
(
'customer'
,
$post_data
);
$state
=
$this
->
db
->
where
(
'customer_id'
,
$user_id
)
->
update
(
'customer'
,
$post_data
);
if
(
$state
){
if
(
$state
){
...
@@ -1339,8 +1339,11 @@ class Api_model extends CI_Model {
...
@@ -1339,8 +1339,11 @@ class Api_model extends CI_Model {
return
$this
->
db
->
get
()
->
row
();
return
$this
->
db
->
get
()
->
row
();
}
}
function
update_payment
(
$response
,
$transactionid
,
$last_id
,
$status
){
function
update_payment
(
$response
=
''
,
$transactionid
=
''
,
$last_id
,
$status
){
try
{
try
{
if
(
empty
(
$last_id
)){
return
;
}
$this
->
db
->
update
(
'transaction'
,
$this
->
db
->
update
(
'transaction'
,
array
(
'transaction_id'
=>
$transactionid
,
array
(
'transaction_id'
=>
$transactionid
,
'transaction_response'
=>
json_encode
(
$response
),
'transaction_response'
=>
json_encode
(
$response
),
...
...
application/models/Webservice_model.php
View file @
e680e527
...
@@ -967,23 +967,21 @@ class Webservice_model extends CI_Model {
...
@@ -967,23 +967,21 @@ class Webservice_model extends CI_Model {
$this
->
db
->
from
(
'users'
);
$this
->
db
->
from
(
'users'
);
$this
->
db
->
join
(
'customer'
,
'customer.customer_id = users.id'
);
$this
->
db
->
join
(
'customer'
,
'customer.customer_id = users.id'
);
$num
=
$this
->
db
->
get
()
->
num_rows
();
$num
=
$this
->
db
->
get
()
->
num_rows
();
if
(
$num
>
0
)
if
(
$num
>
0
)
{
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Email address already exist'
,
'code'
=>
'ER32'
);
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Email address already exist'
,
'code'
=>
'ER32'
);
return
$res
;
return
$res
;
}
}
}
}
if
(
isset
(
$data
[
'file'
])){
if
(
isset
(
$data
[
'file'
])){
$img
=
$data
[
'file'
][
'name'
];
$imgName
=
$data
[
'file'
][
'name'
];
$expbanner
=
explode
(
'.'
,
$img
);
$imgNameArr
=
explode
(
'.'
,
$imgName
);
$img_ext
=
strtolower
(
$expbanner
[
1
]);
$imgExt
=
strtolower
(
$imgNameArr
[
1
]);
$rand
=
rand
(
10000
,
99999
);
$encname
=
time
()
.
$rand
;
if
(
$imgExt
==
'png'
||
$imgExt
==
'jpeg'
||
$imgExt
==
'jpg'
||
$imgExt
==
'gif'
){
if
(
$img_ext
==
'png'
||
$img_ext
==
'jpeg'
||
$img_ext
==
'jpg'
||
$img_ext
==
'gif'
){
$imgPath
=
'assets/uploads/user/CUST_'
.
$user_id
.
'.'
.
$imgExt
;
$bannername
=
$encname
.
'.'
.
$img_ext
;
move_uploaded_file
(
$data
[
'file'
][
"tmp_name"
],
"./"
.
$imgPath
);
$imagePath
=
"./assets/uploads/"
.
$bannername
;
$post_data
[
'profile_image'
]
=
$imgPath
;
$post_data
[
'profile_image'
]
=
"assets/uploads/"
.
$bannername
;
move_uploaded_file
(
$data
[
'file'
][
"tmp_name"
],
$imagePath
);
$state
=
$this
->
db
->
where
(
'customer_id'
,
$user_id
)
->
update
(
'customer'
,
$post_data
);
$state
=
$this
->
db
->
where
(
'customer_id'
,
$user_id
)
->
update
(
'customer'
,
$post_data
);
if
(
$state
){
if
(
$state
){
$img_error
=
1
;
$img_error
=
1
;
...
...
application/views/payment/payment.php
View file @
e680e527
...
@@ -5,10 +5,10 @@
...
@@ -5,10 +5,10 @@
<body>
<body>
<center><h1
style=
"margin-top: 20%"
>
Please do not refresh this page...
</h1></center>
<center><h1
style=
"margin-top: 20%"
>
Please do not refresh this page...
</h1></center>
<form
action=
"
<?=
$r
equest
Url
?>
"
method=
"post"
id=
"BayanPay_online_payment"
>
<form
action=
"
<?=
$rUrl
?>
"
method=
"post"
id=
"BayanPay_online_payment"
>
<input
type=
"hidden"
name=
"MerchantID"
value=
"
<?php
echo
$m
erchant
Id
;
?>
"
>
<input
type=
"hidden"
name=
"MerchantID"
value=
"
<?php
echo
$mId
;
?>
"
>
<input
type=
"hidden"
name=
"CollaboratorID"
value=
"
<?php
echo
$col
laborator
Id
;
?>
"
>
<input
type=
"hidden"
name=
"CollaboratorID"
value=
"
<?php
echo
$col
ab
Id
;
?>
"
>
<input
type=
"hidden"
name=
"requestParameter"
value=
"
<?=
$requestParam
eter
?>
"
>
<input
type=
"hidden"
name=
"requestParameter"
value=
"
<?=
$requestParam
?>
"
>
</form>
</form>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
document
.
addEventListener
(
"DOMContentLoaded"
,
function
(
event
)
{
document
.
addEventListener
(
"DOMContentLoaded"
,
function
(
event
)
{
...
...
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