Merge branch 'master' of bitbucket.org:venbainformationtechnology/golf_backend
This commit is contained in:
commit
f7fba0c3c1
@ -26,14 +26,14 @@ class Database extends Config
|
||||
*/
|
||||
public array $default = [
|
||||
'DSN' => '',
|
||||
'hostname' => '43.225.55.221',
|
||||
'username' => 'mprkvcoi_golf879',
|
||||
'password' => 'j3Lq(S1J9HFd',
|
||||
'database' => 'mprkvcoi_golf879',
|
||||
// 'hostname' => 'localhost',
|
||||
// 'username' => 'root',
|
||||
// 'password' => '',
|
||||
// 'database' => 'golf',
|
||||
// 'hostname' => '43.225.55.221',
|
||||
// 'username' => 'mprkvcoi_golf879',
|
||||
// 'password' => 'j3Lq(S1J9HFd',
|
||||
// 'database' => 'mprkvcoi_golf879',
|
||||
'hostname' => 'localhost',
|
||||
'username' => 'root',
|
||||
'password' => '',
|
||||
'database' => 'golf',
|
||||
'DBDriver' => 'mysqli',
|
||||
'DBPrefix' => '',
|
||||
'pConnect' => false,
|
||||
|
||||
@ -119,7 +119,7 @@ class PaymentController extends BaseController
|
||||
$credits_data['order_id'] = $orderId;
|
||||
$credits_data['cost_with_tax'] = round( ( $packageData[0]['cost'] + (($packageData[0]['cost'] * ($gst + $pst) ) / 100) ) , 2 );
|
||||
|
||||
$creditsModel_pack_count = $this->creditsModel->selectCount('id')->where('package_name',$packageData[0]['package_name'])->where('order_id',$orderId)->get()->getRow()->id;
|
||||
$creditsModel_pack_count = $this->creditsModel->selectCount('id')->where('package_name',$packageData[0]['package_name'])->where('order_id',$orderId)->where('member_id', session()->get('logged_user'))->get()->getRow()->id;
|
||||
$single_pack_no_of_count = $CartData[$i]['count'] - $creditsModel_pack_count;
|
||||
// if($CartData[0]['order_id'] == null)
|
||||
// {
|
||||
@ -145,14 +145,21 @@ class PaymentController extends BaseController
|
||||
$data['pst'] = $pst;
|
||||
$data['packageArray'] = $packageArray;
|
||||
$data['userdata'] = $this->MemberModel->where('id',session()->get('logged_user'))->find();
|
||||
//$data['userAddress'] = $this->MemberAddressModel->where('member_id',session()->get('logged_user'))->findAll();
|
||||
// echo '<pre>';
|
||||
// print_r($data);
|
||||
// echo '</pre>';
|
||||
// die();
|
||||
|
||||
$if_trans_exist = $this->TransactionModel->where('member_id', session()->get('logged_user'))
|
||||
->where('order_id', $orderId )->find();
|
||||
if($if_trans_exist){
|
||||
//skip insertion
|
||||
}else{
|
||||
//Trancaction Table initial entry for this transaction
|
||||
$TrancactionData['status'] = 'initialized';
|
||||
$TrancactionData['member_id'] = session()->get('logged_user');
|
||||
$TrancactionData['order_id'] = $orderId;
|
||||
$insert = $this->TransactionModel->save($TrancactionData);
|
||||
}
|
||||
|
||||
echo view('checkout',$data);
|
||||
//echo view('payment_form',$data);
|
||||
|
||||
} else { return redirect()->to(base_url()."view/".md5(session()->get('logged_user'))); }
|
||||
}
|
||||
|
||||
@ -181,7 +188,9 @@ class PaymentController extends BaseController
|
||||
$order_id = $data->order_id;
|
||||
$add = $data->address;
|
||||
parse_str( $add, $address);
|
||||
|
||||
|
||||
|
||||
|
||||
//print_r($add);die();
|
||||
|
||||
$Final_amount = round( ( $amount + (($amount * ($gst + $pst) ) / 100) ) , 2 );
|
||||
@ -224,19 +233,21 @@ class PaymentController extends BaseController
|
||||
$result = json_decode( $data ,true);
|
||||
//Trancaction Table Data
|
||||
$TrancactionData['status'] = 'success';
|
||||
$TrancactionData['member_id'] = session()->get('logged_user');
|
||||
//$TrancactionData['member_id'] = session()->get('logged_user');
|
||||
$TrancactionData['first_name'] = $address['name'];
|
||||
$TrancactionData['last_name'] = $address['last_name'];
|
||||
$TrancactionData['address'] = $address['address'];
|
||||
$TrancactionData['state'] = $address['state'];
|
||||
$TrancactionData['city'] = $address['city'];
|
||||
$TrancactionData['zip_code'] = $address['pincode'];
|
||||
// $TrancactionData['order_id'] = $order_id;
|
||||
$TrancactionData['transaction_id'] = $result['payment']['id'];
|
||||
$TrancactionData['payment_order_id'] = $result['payment']['order_id'];
|
||||
$TrancactionData['order_id'] = $order_id;
|
||||
$TrancactionData['transaction'] = json_encode($response->getResult());
|
||||
$insert = $this->TransactionModel->save($TrancactionData);
|
||||
if( $insert)
|
||||
$update = $this->TransactionModel->where('member_id', session()->get('logged_user'))
|
||||
->where('order_id', $order_id )
|
||||
->set($TrancactionData)->update();
|
||||
if( $update)
|
||||
{
|
||||
$this->creditsModel->where('order_id', $order_id )->where('member_id', session()->get('logged_user'))
|
||||
->set(array( 'is_active' => 1 , 'transaction_id' => $result['payment']['id'] ))->update();
|
||||
@ -251,20 +262,23 @@ class PaymentController extends BaseController
|
||||
$result = json_decode( $data ,true);
|
||||
//Trancaction Table Data
|
||||
$TrancactionData['status'] = 'failed';
|
||||
$TrancactionData['member_id'] = session()->get('logged_user');
|
||||
// $TrancactionData['member_id'] = session()->get('logged_user');
|
||||
$TrancactionData['first_name'] = $address['name'];
|
||||
$TrancactionData['last_name'] = $address['last_name'];
|
||||
$TrancactionData['address'] = $address['address'];
|
||||
$TrancactionData['state'] = $address['state'];
|
||||
$TrancactionData['city'] = $address['city'];
|
||||
$TrancactionData['zip_code'] = $address['pincode'];
|
||||
$TrancactionData['order_id'] = $order_id;
|
||||
//$TrancactionData['order_id'] = $order_id;
|
||||
$TrancactionData['transaction'] = json_encode($response->getErrors());
|
||||
$insert = $this->TransactionModel->save($TrancactionData);
|
||||
if( $insert)
|
||||
$update = $this->TransactionModel->where('member_id', session()->get('logged_user'))
|
||||
->where('order_id', $order_id )
|
||||
->set($TrancactionData)->update();
|
||||
if( $update)
|
||||
{
|
||||
|
||||
$this->creditsModel->where('order_id', $order_id )->delete();
|
||||
$this->cartModel->where('order_id', $order_id )->set(array('order_id'=>null))->update();
|
||||
}
|
||||
|
||||
echo json_encode(array('errors' => $response->getErrors()));
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
<img src="<?= base_url()."/public"; ?>/assets/member_images/failed_Icon.png" alt="" width="60" height="60"/>
|
||||
<h1 style="color: red">Payment Failed!</h1>
|
||||
<!-- <p>The order confirmation has been sent to your registered mail id</p> -->
|
||||
<a href="<?= base_url('payment'); ?>">Retry with other payment options</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -43,7 +44,7 @@
|
||||
<div class="trans-id"><?= $order_id; ?></div>
|
||||
</div>
|
||||
<div class="aside-content">
|
||||
<div class="trans-date label">Transactions Date</div>
|
||||
<div class="trans-date label">Transaction Date</div>
|
||||
<div class="trans-date"><?= $formattedDate; ?></div>
|
||||
</div>
|
||||
<div class="aside-content aside-content-last">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user