Commit 7018f12a by Tobin

daily commit

parent fdf33bd6
......@@ -6,433 +6,475 @@ if (isset($_SERVER['HTTP_ORIGIN'])) {
header('Access-Control-Max-Age: 86400');
}
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD']))
header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD']))
header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']))
header("Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}");
if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']))
header("Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}");
exit(0);
}
exit(0);
}
class Api extends CI_Controller {
var $auth_token;
public function __construct() {
parent::__construct();
$this->load->model('Api_model');
$this->load->model('Validation_model');
$method = $this->router->fetch_method();
$data = (array) json_decode(file_get_contents('php://input'));
if($method == 'profile') {
$data = $_POST;
}
if (isset(apache_request_headers()['Auth'])) {
var $auth_token;
public function __construct() {
parent::__construct();
$this->load->model('Api_model');
$this->load->model('Validation_model');
$method = $this->router->fetch_method();
$data = (array) json_decode(file_get_contents('php://input'));
if($method == 'profile') {
$data = $_POST;
}
if (isset(apache_request_headers()['Auth'])) {
$this->auth_token = apache_request_headers()['Auth'];
$data['auth_token'] = $this->auth_token;
}
$res = $this->Validation_model->validation_check($method, $data);
if($res['state'] == 1) {
$this->errorResponse($res['response']['code'], $res['response']['message']);
die;
}
}
public function index() {
$res = $this->Validation_model->validation_check('login',array('email_id'=>'adarsh'));
}
public function response($data) {
$result = array(
'code' => 1,
'message' => 'Success',
'responseResult' =>$data
);
print json_encode($result);
}
public function errorResponse($errorCode, $errorDesc) {
$result = array(
'code' => 0,
'message' => 'Failure',
'errorCode'=> $errorCode,
'errorDesc'=> $errorDesc
);
print json_encode($result);
}
public function login(){
$data = (array) json_decode(file_get_contents('php://input'));
$res = $this->Api_model->login($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function register(){
$data = (array) json_decode(file_get_contents('php://input'));
$res = $this->Api_model->register($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function forgot(){
$data = (array) json_decode(file_get_contents('php://input'));
$res = $this->Api_model->forgot($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function popular() {
$res = $this->Api_model->popular();
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function category() {
$res = $this->Api_model->category();
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function locality() {
$res = $this->Api_model->locality();
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function favourite(){
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->favourite($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function favouritelist() {
$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->favouritelist($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function bookedlist() {
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->bookedlist($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function bookingdetails() {
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->bookingdetails($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function cancel() {
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->cancel($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function confirm() {
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->confirm($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function userinfo() {
$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->userinfo($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function profile() {
$data = $_POST;
if(isset($_FILES['profile_picture'])) {
$data['file'] = $_FILES['profile_picture'];
}
$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->update_profile($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function tempbooking() {
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->tempbooking($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function recommend() {
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->recommend($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function discover() {
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->discover($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function event() {
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->event($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function search() {
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->search($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function searchEvent($str = null) {
$data['str'] = $str;
$res = $this->Api_model->searchEvent($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function paymentGateway(){
BayanPayPayment();
$networkOnlineArray =
array('Network_Online_setting' =>
array(
'merchantKey' => "+Hu4bL6iVk943JmFAvGtWEYMODFry4fad2I+iM0X2m0=",
'merchantId' => '201901291000002',
'collaboratorId' => 'NI',
'iv' => '0123456789abcdef',
'url' => false
),
'Block_Existence_Indicator' => array(
'transactionDataBlock' => true,
'billingDataBlock' => true,
'shippingDataBlock' => true,
'paymentDataBlock' => false,
'merchantDataBlock' => false,
'otherDataBlock' => false,
'DCCDataBlock' => false
),
'Field_Existence_Indicator_Transaction' => array(
'merchantOrderNumber' => time(),
'amount' => '100.00',
'successUrl' => $this->baseurl(),
'failureUrl' => $this->baseurl(),
'transactionMode' => 'INTERNET',
'payModeType' => 'CC',
'transactionType' => '01',
'currency' => 'AED'
),
'Field_Existence_Indicator_Billing' => array(
'billToFirstName' => 'Soloman',
'billToLastName' => 'Vandy',
'billToStreet1' => '123,ParkStreet',
'billToStreet2' => 'Park Street',
'billToCity' => 'Mumbai',
'billToState' => 'Maharashtra',
'billtoPostalCode' => '400081',
'billToCountry' => 'IN',
'billToEmail' => '[email protected]',
'billToMobileNumber' => '9820998209',
'billToPhoneNumber1' => '',
'billToPhoneNumber2' => '',
'billToPhoneNumber3' => ''
),
'Field_Existence_Indicator_Shipping' => array(
'shipToFirstName' => 'Soloman',
'shipToLastName' => 'Vandy',
'shipToStreet1' => '123ParkStreet',
'shipToStreet2' => 'parkstreet',
'shipToCity' => 'Mumbai',
'shipToState' => 'Maharashtra',
'shipToPostalCode' => '400081',
'shipToCountry' => 'IN',
'shipToPhoneNumber1' => '',
'shipToPhoneNumber2' => '',
'shipToPhoneNumber3' => '',
'shipToMobileNumber' => '9820998209'
),
'Field_Existence_Indicator_Payment' => array(
'cardNumber' => '4111111111111111', // 1. Card Number
'expMonth' => '08', // 2. Expiry Month
'expYear' => '2020', // 3. Expiry Year
'CVV' => '123', // 4. CVV
'cardHolderName' => 'Soloman', // 5. Card Holder Name
'cardType' => 'Visa', // 6. Card Type
'custMobileNumber'=> '9820998209', // 7. Customer Mobile Number
'paymentID' => '123456', // 8. Payment ID
'OTP' => '123456', // 9. OTP field
'gatewayID' => '1026', // 10.Gateway ID
'cardToken' => '1202' // 11.Card Token
),
'Field_Existence_Indicator_Merchant' =>
array(
'UDF1' => '115.121.181.112', // This is a ‘user-defined field’ that can be used to send additional information about the transaction.
'UDF2' => 'abc', // This is a ‘user-defined field’ that can be used to send additional information about the transaction.
'UDF3' => 'abc', // This is a ‘user-defined field’ that can be used to send additional information about the transaction.
'UDF4' => 'abc', // This is a ‘user-defined field’ that can be used to send additional information about the transaction.
'UDF5' => 'abc', // This is a ‘user-defined field’ that can be used to send additional information about the transaction.
'UDF6' => 'abc', // This is a ‘user-defined field’ that can be used to send additional information about the transaction.
'UDF7' => 'abc', // This is a ‘user-defined field’ that can be used to send additional information about the transaction.
'UDF8' => 'abc', // This is a ‘user-defined field’ that can be used to send additional information about the transaction.
'UDF9' => 'abc', // This is a ‘user-defined field’ that can be used to send additional information about the transaction.
'UDF10' => 'abc' // This is a ‘user-defined field’ that can be used to send additional information about the transaction.
),
'Field_Existence_Indicator_OtherData' =>
array(
'custID' => '12345',
'transactionSource' => 'IVR',
'productInfo' => 'Book',
'isUserLoggedIn' => 'Y',
'itemTotal' => '500.00, 1000.00',
'itemCategory' => 'CD, Book',
'ignoreValidationResult' => 'FALSE'
),
'Field_Existence_Indicator_DCC' =>
array(
'DCCReferenceNumber' => '09898787', // DCC Reference Number
'foreignAmount' => '240.00', // Foreign Amount
'ForeignCurrency' => 'USD' // Foreign Currency
)
);
$networkOnlineObject = new NetworkonlieBitmapPaymentIntegration($networkOnlineArray);
if(isset($_REQUEST['responseParameter']) && $_REQUEST['responseParameter'] != ''){
$response = $networkOnlineObject->decryptData($_REQUEST['responseParameter'],$networkOnlineObject->merchantKey,$networkOnlineObject->iv);
$networkOnlineObject->AddLog('Network Online Response : '.print_r($response, TRUE),'16');
}
$requestParameter = $networkOnlineObject->NeoPostData;
// if($networkOnlineObject->url)
// $requestUrl = 'https://www.timesofmoney.com/direcpay/secure/PaymentTxnServlet';
// else
$requestUrl = 'https://staging.bayanpay.sa/direcpay/secure/PaymentTxnServlet';
echo '<form action="'.$requestUrl.'" method="post" name="network_online_payment"
id="network_online_payment">
<input type="hidden" name="requestParameter" value='.$requestParameter.'>
<input type="submit" value="Submit">
</form>';
}
function baseurl(){
if(isset($_SERVER['HTTPS']))
$protocol = ($_SERVER['HTTPS'] && $_SERVER['HTTPS'] != "off") ? "https" : "http";
else
$protocol = 'http';
return $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
}
}
\ No newline at end of file
$res = $this->Validation_model->validation_check($method, $data);
if($res['state'] == 1) {
$this->errorResponse($res['response']['code'], $res['response']['message']);
die;
}
}
public function index() {
$res = $this->Validation_model->validation_check('login',array('email_id'=>'adarsh'));
}
public function response($data) {
$result = array(
'code' => 1,
'message' => 'Success',
'responseResult' =>$data
);
print json_encode($result);
}
public function errorResponse($errorCode, $errorDesc) {
$result = array(
'code' => 0,
'message' => 'Failure',
'errorCode'=> $errorCode,
'errorDesc'=> $errorDesc
);
print json_encode($result);
}
public function login(){
$data = (array) json_decode(file_get_contents('php://input'));
$res = $this->Api_model->login($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function register(){
$data = (array) json_decode(file_get_contents('php://input'));
$res = $this->Api_model->register($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function forgot(){
$data = (array) json_decode(file_get_contents('php://input'));
$res = $this->Api_model->forgot($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function popular() {
$res = $this->Api_model->popular();
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function category() {
$res = $this->Api_model->category();
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function locality() {
$res = $this->Api_model->locality();
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function favourite(){
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->favourite($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function favouritelist() {
$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->favouritelist($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function bookedlist() {
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->bookedlist($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function bookingdetails() {
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->bookingdetails($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function cancel() {
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->cancel($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function confirm() {
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->confirm($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function userinfo() {
$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->userinfo($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function profile() {
$data = $_POST;
if(isset($_FILES['profile_picture'])) {
$data['file'] = $_FILES['profile_picture'];
}
$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->update_profile($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function tempbooking() {
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->tempbooking($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function recommend() {
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->recommend($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function discover() {
$data = (array) json_decode(file_get_contents('php://input'));
//$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->discover($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function event() {
$data = (array) json_decode(file_get_contents('php://input'));
//$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->event($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function search() {
$data = (array) json_decode(file_get_contents('php://input'));
//$data['auth_token'] = $this->auth_token;
$res = $this->Api_model->search($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function searchEvent($str = null) {
$data['str'] = $str;
$res = $this->Api_model->searchEvent($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function payNow($auth_token='',$amount=0,$booking_id='',$event_id=''){
if(empty($auth_token) || empty($amount) || empty($booking_id)){
redirect('http://localhost:4200/failure');
}
$payData = array('auth_token'=>$auth_token,'amount'=>$amount,'booking_id'=>$booking_id);
$res = $this->Api_model->payNow($payData);
if($res['status']==1){
$this->paymentGateway($amount,$res['transaction_id'],$event_id,$booking_id);
}
else{
redirect('http://localhost:4200/failure?event_id='.$eventid);
}
}
public function paymentSuccessUrl(){
$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);
$ref_id = explode('|',$response['Transaction_related_information']);
$transaction_id = $ref_id[1];
$last_id = explode('|',$response['Merchant_Information']);
$lastid = $last_id[1];
$eventid = $last_id[2];
$booking_id = $last_id[3];
$this->Api_model->update_payment($response,$transaction_id,$lastid,'1') ;
redirect('http://localhost:4200/bookingdetails?booking_id='.$booking_id);
}
}
public function paymentFailureUrl(){
$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);
$ref_id = explode('|',$response['Transaction_related_information']);
$transaction_id = $ref_id[1];
$last_id = explode('|',$response['Merchant_Information']);
$lastid = $last_id[1];
$eventid = $last_id[2];
$booking_id = $last_id[3];
$this->Api_model->update_payment($response,$transaction_id,$lastid,'0');
redirect('http://localhost:4200/failure?event_id='.$eventid);
}
}
public function paymentGateway($amount='0',$lastid='0',$event_id='0',$booking_id='0'){
BayanPayPayment();
$BayanPayArray = $this->bayanPayArray($amount,$lastid,$event_id,$booking_id);
$BayanPayOnlineObject = new BayanPayBitmapPaymentIntegration($BayanPayArray);
$requestParameter = $BayanPayOnlineObject->BayanPostData;
if($BayanPayOnlineObject->url){
$requestUrl = 'https://payments.bayanpay.sa/direcpay/secure/PaymentTxnServlet';
}
else{
$requestUrl = 'https://staging.bayanpay.sa/direcpay/secure/PaymentTxnServlet';
}
$this->load->view('payment/payment',array('requestUrl'=>$requestUrl,
'requestParameter'=>$requestParameter));
}
function baseurl(){
if(isset($_SERVER['HTTPS']))
$protocol = ($_SERVER['HTTPS'] && $_SERVER['HTTPS'] != "off") ? "https" : "http";
else
$protocol = 'http';
return $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
}
function bayanPayArray($amount = '0',$lastid='',$event_id='',$booking_id=''){
$BayanPayArray =
array(
'BayanPay_Online_setting' => array(
'merchantKey' => "+Hu4bL6iVk943JmFAvGtWEYMODFry4fad2I+iM0X2m0=",
'merchantId' => '201901291000002',
'collaboratorId' => 'BAYANPAY',
'iv' => '0123456789abcdef',
'url' => false// Set to false if you are using testing environment , set to true if you are using live environment
),
'Block_Existence_Indicator' => array(
'transactionDataBlock' => true,
'billingDataBlock' => true,
'shippingDataBlock' => true,
'paymentDataBlock' => false,
'merchantDataBlock' => true,
'otherDataBlock' => false,
'DCCDataBlock' => false
),
'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' => 'Soloman',
'billToLastName' => 'Vandy',
'billToStreet1' => '123,ParkStreet',
'billToStreet2' => 'Park Street',
'billToCity' => 'Riyadh',
'billToState' => 'Riyadh',
'billtoPostalCode' => '400081',
'billToCountry' => 'IN',
'billToEmail' => '[email protected]',
'billToMobileNumber' => '9820998209',
'billToPhoneNumber1' => '',
'billToPhoneNumber2' => '',
'billToPhoneNumber3' => ''
),
'Field_Existence_Indicator_Shipping' => array(
'shipToFirstName' => 'Soloman',
'shipToLastName' => 'Vandy',
'shipToStreet1' => '123ParkStreet',
'shipToStreet2' => 'parkstreet',
'shipToCity' => 'Riyadh',
'shipToState' => 'Riyadh',
'shipToPostalCode' => '400081',
'shipToCountry' => 'IN',
'shipToPhoneNumber1' => '',
'shipToPhoneNumber2' => '',
'shipToPhoneNumber3' => '',
'shipToMobileNumber' => '9820998209'
),
'Field_Existence_Indicator_Payment' => array(
'cardNumber' => '4111111111111111', // 1. Card Number
'expMonth' => '08', // 2. Expiry Month
'expYear' => '2020', // 3. Expiry Year
'CVV' => '123', // 4. CVV
'cardHolderName' => 'Soloman', // 5. Card Holder Name
'cardType' => 'Visa', // 6. Card Type
'custMobileNumber' => '9820998209', // 7. Customer Mobile Number
'paymentID' => '123456', // 8. Payment ID
'OTP' => '123456', // 9. OTP field
'gatewayID' => '1026', // 10.Gateway ID
'cardToken' => '1202' // 11.Card Token
),
'Field_Existence_Indicator_Merchant' => array(
'UDF1' => $lastid,
'UDF2' => $event_id,
'UDF3' => $booking_id
),
'Field_Existence_Indicator_OtherData' => array(
'custID' => '12345',
'transactionSource' => 'IVR',
'productInfo' => 'Book',
'isUserLoggedIn' => 'Y',
'itemTotal' => '500.00, 1000.00',
'itemCategory' => 'CD, Book',
'ignoreValidationResult'=> 'FALSE'
),
'Field_Existence_Indicator_DCC' => array(
'DCCReferenceNumber' => '09898787', // DCC Reference Number
'foreignAmount' => '240.00', // Foreign Amount
'ForeignCurrency' => 'USD' // Foreign Currency
)
);
return $BayanPayArray;
}
}
?>
\ No newline at end of file
......@@ -370,7 +370,8 @@ class Api_model extends CI_Model {
if($res_count > 0) {
$rs = $this->db->where('bookId',$data['bookingCode'])->update('booking',array('status'=>1));
if($rs) {
$result = $this->db->select('booking.id AS book_id,booking.event_id,booking.bookId AS bookingCode,booking.qrcode,booking.no_of_ticket,booking.amount,booking.status AS book_status,events.event_name,events.event_discription,event_gallery.media_url,venue.location,customer.name AS customer_name,customer.profile_image,venue.venue_name,venue.location_lat AS lat,venue.location_lng AS lng, booking.ticket_details')->where('booking.bookId',$data['bookingCode'])->from('booking')->join('events','booking.event_id = events.event_id')->join('event_date_time','booking.event_date_id = event_date_time.id')->join('venue', 'venue.id = events.venue_id')->join('event_gallery', 'events.event_id = event_gallery.event_id AND event_gallery.media_type = 0', 'LEFT')->join('customer','customer.customer_id = booking.customer_id')->get()->row();
$result = $this->db->select('booking.id AS book_id,booking.event_id,booking.bookId AS bookingCode,booking.qrcode,booking.no_of_ticket,booking.amount,booking.status AS book_status,events.event_name,events.event_discription,event_gallery.media_url,venue.location,customer.name AS customer_name,customer.profile_image,venue.venue_name,venue.location_lat AS lat,venue.location_lng AS lng, booking.ticket_details,event_date_time.date,event_date_time.time')->where('booking.bookId',$data['bookingCode'])->from('booking')->join('events','booking.event_id = events.event_id')->join('event_date_time','booking.event_date_id = event_date_time.id')->join('venue', 'venue.id = events.venue_id')->join('event_gallery', 'events.event_id = event_gallery.event_id AND event_gallery.media_type = 0', 'LEFT')->join('customer','customer.customer_id = booking.customer_id')->get()->row();
if(count($result)>0){
$res = array('status'=>1,'data'=>$result);
} else {
......@@ -484,16 +485,19 @@ class Api_model extends CI_Model {
unset($post_data['auth_token']);
$post_data['customer_id'] = $user_id;
$post_data['ticket_details'] = json_encode($post_data['ticket_details']);
$post_data['qrcode'] = $this->generateQR($post_data);
$post_data['status'] = 3;
$code = 'TO';
$ymd = date('ymd');
$squence = rand(1111,9999);
$squence = str_pad($squence,4,0,STR_PAD_LEFT);
$post_data['bookId'] = $code.$ymd.$squence;
$post_data['qrcode'] = genQRcode($post_data['bookId']);
$post_data['booking_date'] = date('Y-m-d H:i:s');
$rs = $this->db->insert('booking', $post_data);
if($rs){
$res = array('status'=>1,'data'=>array('bookingCode'=>$post_data['bookId']));
$res = array('status'=>1,
'data'=>array('user_id'=>$user_id,
'bookingCode'=>$post_data['bookId']));
} else {
$res = array('status'=>0,'message'=>'Seat booking failed','code'=>'ER37');
}
......@@ -590,8 +594,8 @@ class Api_model extends CI_Model {
function discover($data) {
try {
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) {
//$user_id = $this->auth_token_get($data['auth_token']);
//if($user_id > 0) {
$cat_id = $data['cat_id'];
$city_id = $data['city'];
$category = $this->db->where('cat_id',$cat_id)->get('event_category')->row();
......@@ -625,9 +629,9 @@ class Api_model extends CI_Model {
} else {
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13');
}
} else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
//} else {
//$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
//}
} catch(Exception $e) {
......@@ -640,11 +644,11 @@ class Api_model extends CI_Model {
function event($data) {
try {
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) {
$user_id = (!isset($data['auth_token']) || empty($data['auth_token']))?'':$this->auth_token_get($data['auth_token']);
//if($user_id > 0) {
$event_id = $data['event_id'];
$this->db->query("SET SESSION group_concat_max_len = 20000");
$result = $this->db->query("SELECT events.has_payment,events.event_id, AVG(review.rate) AS rate, MAX(booking.id) AS attendees, events.event_name,events.event_discription AS event_description,events.seat_pricing, events.custom_seat_layout, events.seat_pricing, venue.layout, venue.layout_details,venue.venue_name,venue.venue_details,venue.location,venue.location_lat AS lat,venue.location_lng AS lng, GROUP_CONCAT(DISTINCT `event_gallery`.`media_url`) AS media_url,favourite.status AS fav_status, events.max_booking, host_categories.show_layout, GROUP_CONCAT(DISTINCT tags.tag_name) AS tag, GROUP_CONCAT(DISTINCT CONCAT_WS('#',event_date_time.id,event_date_time.date,event_date_time.time)) AS date_time FROM events INNER JOIN event_date_time ON events.event_id = event_date_time.event_id INNER JOIN venue ON venue.id = events.venue_id LEFT JOIN `event_gallery` ON `events`.`event_id` = `event_gallery`.`event_id` AND `event_gallery`.`status` != 0 LEFT JOIN booking on booking.event_id = events.event_id LEFT JOIN favourite ON favourite.event_id = events.event_id AND favourite.user_id = ".$user_id." AND favourite.status = 1 LEFT JOIN event_tags ON events.event_id = event_tags.event_id LEFT JOIN tags on tags.tag_id = event_tags.tag_id LEFT JOIN review ON events.event_id = review.event_id INNER JOIN host_categories ON venue.host_cat_id = host_categories.host_cat_id WHERE events.event_id = ".$event_id." GROUP BY events.event_id, event_date_time.event_id")->result();
$result = $this->db->query("SELECT events.has_payment,events.event_id, AVG(review.rate) AS rate, MAX(booking.id) AS attendees, events.event_name,events.event_discription AS event_description,events.seat_pricing, events.custom_seat_layout, events.seat_pricing, venue.layout, venue.layout_details,venue.venue_name,venue.venue_details,venue.location,venue.location_lat AS lat,venue.location_lng AS lng, GROUP_CONCAT(DISTINCT `event_gallery`.`media_url`) AS media_url,favourite.status AS fav_status, events.max_booking, host_categories.show_layout, GROUP_CONCAT(DISTINCT tags.tag_name) AS tag, GROUP_CONCAT(DISTINCT CONCAT_WS('#',event_date_time.id,event_date_time.date,event_date_time.time)) AS date_time FROM events INNER JOIN event_date_time ON events.event_id = event_date_time.event_id INNER JOIN venue ON venue.id = events.venue_id LEFT JOIN `event_gallery` ON `events`.`event_id` = `event_gallery`.`event_id` AND `event_gallery`.`status` != 0 LEFT JOIN booking on booking.event_id = events.event_id LEFT JOIN favourite ON favourite.event_id = events.event_id AND favourite.user_id = '".$user_id."' AND favourite.status = 1 LEFT JOIN event_tags ON events.event_id = event_tags.event_id LEFT JOIN tags on tags.tag_id = event_tags.tag_id LEFT JOIN review ON events.event_id = review.event_id INNER JOIN host_categories ON venue.host_cat_id = host_categories.host_cat_id WHERE events.event_id = ".$event_id." GROUP BY events.event_id, event_date_time.event_id")->result();
if(count($result)>0){
$resultData = array();
$event_layout = '';
......@@ -705,9 +709,9 @@ class Api_model extends CI_Model {
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13');
}
} else {
/*} else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
}*/
} catch(Exception $e) {
......@@ -719,20 +723,17 @@ class Api_model extends CI_Model {
function search($data) {
try {
$per_page = 10;
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) {
$user_id = (!isset($data['auth_token']) || empty($data['auth_token']))?'':$this->auth_token_get($data['auth_token']);
//if($user_id > 0) {
$where = '';
if(isset($data['venue_id'])) {
$where = ' AND events.venue_id='.$data['venue_id'];
}
if(isset($data['cat_id'])) {
if(isset($data['cat_id']) && !empty($data['cat_id'])) {
$where = ' AND events.category_id='.$data['cat_id'];
}
$case = "AND event_date_time.date >= DATE_FORMAT(NOW(),'%Y-%m-%d')";
if(isset($data['choose_date'])) {
if(isset($data['choose_date']) && !empty($data['choose_date'])) {
switch ($data['choose_date']) {
case '1':
$case = "";
......@@ -768,13 +769,15 @@ class Api_model extends CI_Model {
$case = "AND event_date_time.date >= DATE_FORMAT(NOW(),'%Y-%m-%d')";
break;
}
$where = ' AND events.venue_id='.$data['venue_id'];
// $where = ' AND events.venue_id='.$data['venue_id'];
}
$count = $this->db->query("SELECT events.event_id FROM events INNER JOIN event_date_time ON events.event_id = event_date_time.event_id $case WHERE events.status = 1 $where GROUP BY events.event_id")->num_rows();
if(isset($data['venue_id']) && !empty($data['venue_id'])) {
$where = ' AND locality.id ='.$data['venue_id'];
}
$count = $this->db->query("SELECT events.event_id FROM events INNER JOIN event_date_time ON events.event_id = event_date_time.event_id $case WHERE events.status = 1 $where GROUP BY events.event_id")->num_rows();
if($count > 0) {
if(isset($data['page'])) {
......@@ -786,7 +789,25 @@ class Api_model extends CI_Model {
$page_limit = ($page - 1) * $per_page;
if($count > $page_limit) {
$result = $this->db->query("SELECT events.event_id, AVG(review.rate) AS rate, MAX(booking.id) AS attendees, events.event_name,events.event_discription AS event_description,events.seat_pricing, events.custom_seat_layout, venue.layout, venue.layout_details,`event_gallery`.`media_url`,favourite.status AS fav_status, GROUP_CONCAT(DISTINCT tags.tag_name) AS tag FROM events INNER JOIN event_date_time ON events.event_id = event_date_time.event_id $case INNER JOIN venue ON venue.id = events.venue_id LEFT JOIN `event_gallery` ON `events`.`event_id` = `event_gallery`.`event_id` AND `event_gallery`.`media_type` = 0 LEFT JOIN booking on booking.event_id = events.event_id LEFT JOIN favourite ON favourite.event_id = events.event_id AND favourite.user_id = ".$user_id." AND favourite.status = 1 LEFT JOIN event_tags ON events.event_id = event_tags.event_id LEFT JOIN tags on tags.tag_id = event_tags.tag_id LEFT JOIN review ON events.event_id = review.event_id WHERE events.status = 1 $where GROUP BY events.event_id ORDER BY attendees DESC LIMIT ". $page_limit.", ".$per_page)->result();
$result = $this->db->query("
SELECT events.event_id, AVG(review.rate) AS rate,
MAX(booking.id) AS attendees, events.event_name,
events.event_discription AS event_description,events.seat_pricing,
events.custom_seat_layout, venue.layout, venue.layout_details,
`event_gallery`.`media_url`,favourite.status AS fav_status,
GROUP_CONCAT(DISTINCT tags.tag_name) AS tag
FROM events
INNER JOIN event_date_time ON events.event_id = event_date_time.event_id $case
INNER JOIN venue ON venue.id = events.venue_id
LEFT JOIN locality ON locality.id = venue.locality_id
LEFT JOIN `event_gallery` ON `events`.`event_id` = `event_gallery`.`event_id` AND `event_gallery`.`media_type` = 0
LEFT JOIN booking on booking.event_id = events.event_id
LEFT JOIN favourite ON favourite.event_id = events.event_id AND favourite.user_id = '$user_id' AND favourite.status = 1
LEFT JOIN event_tags ON events.event_id = event_tags.event_id
LEFT JOIN tags on tags.tag_id = event_tags.tag_id
LEFT JOIN review ON events.event_id = review.event_id
WHERE events.status = 1 $where GROUP BY events.event_id ORDER BY attendees DESC LIMIT ". $page_limit.", ".$per_page)->result();
if(count($result)>0){
$resultData = array();
foreach ($result as $rs) {
......@@ -834,9 +855,9 @@ class Api_model extends CI_Model {
} else {
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13');
}
} else {
/*} else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
}*/
} catch(Exception $e) {
......@@ -854,6 +875,32 @@ class Api_model extends CI_Model {
$res = array('status'=>1,'data'=>$response);
return $res;
}
function payNow($data){
try{
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) {
$this->db->insert('transaction',array('customer_id'=>$user_id,'booking_id'=>$data['booking_id'],'datetime'=>date('Y-m-d h:i:s'),'amount'=>$data['amount']));
$last_id = $this->db->insert_id();
$res = array('status'=>1,'transaction_id'=>$last_id);
}else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
}catch(Exception $e){
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
function update_payment($response,$transactionid,$last_id,$status){
try{
$this->db->update('transaction',array('transaction_id'=>$transactionid,'transaction_response'=>json_encode($response),'status'=>$status),array('id'=>$last_id));
$res = array('status'=>1);
}catch(Exception $e){
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
}
?>
\ No newline at end of file
......@@ -3,99 +3,268 @@
class Validation_model extends CI_Model {
public $validation_array = array(
'login'=> array('email_id'=>array('required'=>array('code'=>'ER02', 'message'=>'Email id is null or empty'),
'email'=>array('code'=>'ER03', 'message'=>'Invalid Email id')
),
'password'=>array('required'=>array('code'=>'ER04', 'message'=>'Password is null or empty'),
)
),
'register'=> array('email_id'=>array('required'=>array('code'=>'ER02', 'message'=>'Email id is null or empty'),
'email'=>array('code'=>'ER03', 'message'=>'Invalid Email id')
),
'phone'=>array('required'=>array('code'=>'ER07', 'message'=>'Phone no is null or empty'),
'phone'=>array('code'=>'ER08', 'message'=>'Invalid Phone no'),
),
'password'=>array('required'=>array('code'=>'ER04', 'message'=>'Password is null or empty'),
)
),
'forgot'=> array('email_id'=>array('required'=>array('code'=>'ER02', 'message'=>'Email id is null or empty'),
'email'=>array('code'=>'ER03', 'message'=>'Invalid Email id')
)
),
'popular'=>array(),
'category'=>array(),
'locality'=>array(),
'favourite'=>array('event_id'=>array('required'=>array('code'=>'ER16', 'message'=>'Event id is null or empty')
),
'auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),
),
'status'=>array('required'=>array('code'=>'ER18', 'message'=>'Favourite status is missing'),
),
),
'favouritelist'=>array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),
),
),
'bookedlist'=>array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),
),
),
'bookingdetails'=>array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),
),
'bookingCode'=>array('required'=>array('code'=>'ER23', 'message'=>'Booking code is null or empty'),
),
),
'cancel'=>array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),
),
'bookingCode'=>array('required'=>array('code'=>'ER23', 'message'=>'Booking code is null or empty'),
),
),
'confirm'=>array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),
),
'bookingCode'=>array('required'=>array('code'=>'ER23', 'message'=>'Booking code is null or empty'),
),
),
'userinfo'=>array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),
),
),
'profile'=>array('name'=>array('required'=>array('code'=>'ER27', 'message'=>'Name is null or empty')
),
'gender'=>array('required'=>array('code'=>'ER28', 'message'=>'Gender is null or empty')
),
'dob'=>array('required'=>array('code'=>'ER29', 'message'=>'Date of birth is null or empty')
),
'city'=>array('required'=>array('code'=>'ER30', 'message'=>'City no is null or empty')
),
'auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),
),
),
'tempbooking'=>array('event_id'=>array('required'=>array('code'=>'ER16', 'message'=>'Event id is null or empty')
),
'event_date_id'=>array('required'=>array('code'=>'ER33', 'message'=>'Event date and time is null or empty')
),
'amount'=>array('required'=>array('code'=>'ER35', 'message'=>'Amount is null or empty')
),
'no_of_ticket'=>array('required'=>array('code'=>'ER36', 'message'=>'no of ticket is null or empty')
),
'auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),
),
),
'recommend'=>array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),
),
),
'search'=>array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),
),
),
'discover'=>array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),
),
'cat_id'=>array('required'=>array('code'=>'ER38', 'message'=>'Category id null or empty')
),
),
'event'=>array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),
),
'event_id'=>array('required'=>array('code'=>'ER16', 'message'=>'Event id is null or empty')
),
),
'searchEvent'=>array()
);
'login' => array(
'email_id' => array(
'required' => array(
'code' => 'ER02',
'message' => 'Email id is null or empty'
) ,
'email' => array(
'code' => 'ER03',
'message' => 'Invalid Email id'
)
) ,
'password' => array(
'required' => array(
'code' => 'ER04',
'message' => 'Password is null or empty'
) ,
)
) ,
'register' => array(
'email_id' => array(
'required' => array(
'code' => 'ER02',
'message' => 'Email id is null or empty'
) ,
'email' => array(
'code' => 'ER03',
'message' => 'Invalid Email id'
)
) ,
'phone' => array(
'required' => array(
'code' => 'ER07',
'message' => 'Phone no is null or empty'
) ,
'phone' => array(
'code' => 'ER08',
'message' => 'Invalid Phone no'
) ,
) ,
'password' => array(
'required' => array(
'code' => 'ER04',
'message' => 'Password is null or empty'
) ,
)
) ,
'forgot' => array(
'email_id' => array(
'required' => array(
'code' => 'ER02',
'message' => 'Email id is null or empty'
) ,
'email' => array(
'code' => 'ER03',
'message' => 'Invalid Email id'
)
)
) ,
'popular' => array() ,
'category' => array() ,
'locality' => array() ,
'paymentResponse' => array() ,
'paymentFailureUrl' => array() ,
'paymentSuccessUrl' => array() ,
'favourite' => array(
'event_id' => array(
'required' => array(
'code' => 'ER16',
'message' => 'Event id is null or empty'
)
) ,
'auth_token' => array(
'required' => array(
'code' => 'ER17',
'message' => 'User Id is null or empty'
) ,
) ,
'status' => array(
'required' => array(
'code' => 'ER18',
'message' => 'Favourite status is missing'
) ,
) ,
) ,
'favouritelist' => array(
'auth_token' => array(
'required' => array(
'code' => 'ER17',
'message' => 'User Id is null or empty'
) ,
) ,
) ,
'bookedlist' => array(
'auth_token' => array(
'required' => array(
'code' => 'ER17',
'message' => 'User Id is null or empty'
) ,
) ,
) ,
'bookingdetails' => array(
'auth_token' => array(
'required' => array(
'code' => 'ER17',
'message' => 'User Id is null or empty'
) ,
) ,
'bookingCode' => array(
'required' => array(
'code' => 'ER23',
'message' => 'Booking code is null or empty'
) ,
) ,
) ,
'cancel' => array(
'auth_token' => array(
'required' => array(
'code' => 'ER17',
'message' => 'User Id is null or empty'
) ,
) ,
'bookingCode' => array(
'required' => array(
'code' => 'ER23',
'message' => 'Booking code is null or empty'
) ,
) ,
) ,
'confirm' => array(
'auth_token' => array(
'required' => array(
'code' => 'ER17',
'message' => 'User Id is null or empty'
) ,
) ,
'bookingCode' => array(
'required' => array(
'code' => 'ER23',
'message' => 'Booking code is null or empty'
) ,
) ,
) ,
'userinfo' => array(
'auth_token' => array(
'required' => array(
'code' => 'ER17',
'message' => 'User Id is null or empty'
) ,
) ,
) ,
'profile' => array(
'name' => array(
'required' => array(
'code' => 'ER27',
'message' => 'Name is null or empty'
)
) ,
'gender' => array(
'required' => array(
'code' => 'ER28',
'message' => 'Gender is null or empty'
)
) ,
'dob' => array(
'required' => array(
'code' => 'ER29',
'message' => 'Date of birth is null or empty'
)
) ,
'city' => array(
'required' => array(
'code' => 'ER30',
'message' => 'City no is null or empty'
)
) ,
'auth_token' => array(
'required' => array(
'code' => 'ER17',
'message' => 'User Id is null or empty'
) ,
) ,
) ,
'tempbooking' => array(
'event_id' => array(
'required' => array(
'code' => 'ER16',
'message' => 'Event id is null or empty'
)
) ,
'event_date_id' => array(
'required' => array(
'code' => 'ER33',
'message' => 'Event date and time is null or empty'
)
) ,
'amount' => array(
'required' => array(
'code' => 'ER35',
'message' => 'Amount is null or empty'
)
) ,
'no_of_ticket' => array(
'required' => array(
'code' => 'ER36',
'message' => 'no of ticket is null or empty'
)
) ,
'auth_token' => array(
'required' => array(
'code' => 'ER17',
'message' => 'User Id is null or empty'
) ,
) ,
) ,
'recommend' => array(
'auth_token' => array(
'required' => array(
'code' => 'ER17',
'message' => 'User Id is null or empty'
) ,
) ,
) ,
'search' => array(
/*'auth_token' => array(
'required' => array(
'code' => 'ER17',
'message' => 'User Id is null or empty'
) ,
) ,*/
) ,
'discover' => array(
// 'auth_token' => array(
// 'required' => array(
// 'code' => 'ER17',
// 'message' => 'User Id is null or empty'
// ) ,
// ) ,
'cat_id' => array(
'required' => array(
'code' => 'ER38',
'message' => 'Category id null or empty'
)
) ,
) ,
'event' => array(
/*'auth_token' => array(
'required' => array(
'code' => 'ER17',
'message' => 'User Id is null or empty'
) ,
) ,*/
'event_id' => array(
'required' => array(
'code' => 'ER16',
'message' => 'Event id is null or empty'
)
) ,
) ,
'payNow' => array(),
'searchEvent' => array()
);
public function _consruct(){
......
<html>
<head>
<title>Merchant Checkout Page</title>
</head>
<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="requestParameter" value="<?= $requestParameter ?>">
</form>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function(event) {
document.getElementById("BayanPay_online_payment").submit();
});
</script>
</body>
</html>
\ No newline at end of file
<form action="<?php echo $requestUrl; ?>" method="post" name="network_online_payment"
id="network_online_payment">
<?php echo '<input type="hidden" name="requestParameter" value='.$requestParameter.'>'; ?>
<input type="submit" value="Submit">
</form>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment