@@ -54,7 +54,8 @@ |
||
| 54 | 54 | $api = new Api($rzp_key, $rzp_secret); |
| 55 | 55 | $payment = $api->payment->fetch($input['razorpay_payment_id']); |
| 56 | 56 | |
| 57 | - if (count($input) && !empty($input['razorpay_payment_id'])) { //Verify Razorpay Payment Id and Signature |
|
| 57 | + if (count($input) && !empty($input['razorpay_payment_id'])) { |
|
| 58 | +//Verify Razorpay Payment Id and Signature |
|
| 58 | 59 | |
| 59 | 60 | //Fetch payment information by razorpay_payment_id |
| 60 | 61 | try { |
@@ -128,7 +128,7 @@ |
||
| 128 | 128 | \Cart::clear(); |
| 129 | 129 | $status = 'success'; |
| 130 | 130 | $message = view('themes.default1.front.postPaymentTemplate', compact('invoice','date','orders', |
| 131 | - 'invoiceItems', 'state', 'currency'))->render(); |
|
| 131 | + 'invoiceItems', 'state', 'currency'))->render(); |
|
| 132 | 132 | |
| 133 | 133 | return ['status'=>$status, 'message'=>$message]; |
| 134 | 134 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | \Cart::clear(); |
| 129 | 129 | $status = 'success'; |
| 130 | - $message = view('themes.default1.front.postPaymentTemplate', compact('invoice','date','orders', |
|
| 130 | + $message = view('themes.default1.front.postPaymentTemplate', compact('invoice', 'date', 'orders', |
|
| 131 | 131 | 'invoiceItems', 'state', 'currency'))->render(); |
| 132 | 132 | |
| 133 | 133 | return ['status'=>$status, 'message'=>$message]; |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | \Cart::clear(); |
| 148 | 148 | $status = 'success'; |
| 149 | 149 | |
| 150 | - $message = view('themes.default1.front.postRenewTemplate', compact('invoice','date','order', |
|
| 150 | + $message = view('themes.default1.front.postRenewTemplate', compact('invoice', 'date', 'order', |
|
| 151 | 151 | 'product', 'invoiceItem', 'state', 'currency'))->render(); |
| 152 | 152 | |
| 153 | 153 | return ['status'=>$status, 'message'=>$message]; |
@@ -33,6 +33,6 @@ |
||
| 33 | 33 | return ''; |
| 34 | 34 | |
| 35 | 35 | // return "Product has been {$eventName}"; |
| 36 | - // \Auth::user()->activity; |
|
| 36 | + // \Auth::user()->activity; |
|
| 37 | 37 | } |
| 38 | 38 | } |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -\Event::listen('App\Events\PaymentGateway', function ($event) { |
|
| 3 | +\Event::listen('App\Events\PaymentGateway', function($event) { |
|
| 4 | 4 | $controller = new App\Plugins\Paypal\Controllers\ProcessController(); |
| 5 | 5 | // echo $controller->PassToPayment($event->para); |
| 6 | 6 | }); |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | protected $fillable = ['tax_enable', 'inclusive', 'shop_inclusive', 'cart_inclusive', 'rounding', 'Gst_no']; |
| 13 | 13 | protected static $logName = 'Tax Class'; |
| 14 | 14 | protected static $logAttributes = ['tax_enable', 'inclusive', |
| 15 | - 'shop_inclusive', 'cart_inclusive', 'rounding', 'Gst_no', ]; |
|
| 15 | + 'shop_inclusive', 'cart_inclusive', 'rounding', 'Gst_no', ]; |
|
| 16 | 16 | protected static $logOnlyDirty = true; |
| 17 | 17 | |
| 18 | 18 | public function getDescriptionForEvent(string $eventName): string |
@@ -86,7 +86,8 @@ discard block |
||
| 86 | 86 | $i_gst = $user_state->i_gst; |
| 87 | 87 | $ut_gst = $user_state->ut_gst; |
| 88 | 88 | $state_code = $user_state->state_code; |
| 89 | - if ($state_code == $origin_state) {//If user and origin state are same |
|
| 89 | + if ($state_code == $origin_state) { |
|
| 90 | +//If user and origin state are same |
|
| 90 | 91 | $taxClassId = TaxClass::where('name', 'Intra State GST') |
| 91 | 92 | ->pluck('id')->toArray(); //Get the class Id of state |
| 92 | 93 | if ($taxClassId) { |
@@ -95,7 +96,8 @@ discard block |
||
| 95 | 96 | } else { |
| 96 | 97 | $taxes = [0]; |
| 97 | 98 | } |
| 98 | - } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {//If user is from other state |
|
| 99 | + } elseif ($state_code != $origin_state && $ut_gst == 'NULL') { |
|
| 100 | +//If user is from other state |
|
| 99 | 101 | |
| 100 | 102 | $taxClassId = TaxClass::where('name', 'Inter State GST') |
| 101 | 103 | ->pluck('id')->toArray(); //Get the class Id of state |
@@ -105,7 +107,8 @@ discard block |
||
| 105 | 107 | } else { |
| 106 | 108 | $taxes = [0]; |
| 107 | 109 | } |
| 108 | - } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {//if user from Union Territory |
|
| 110 | + } elseif ($state_code != $origin_state && $ut_gst != 'NULL') { |
|
| 111 | +//if user from Union Territory |
|
| 109 | 112 | $taxClassId = TaxClass::where('name', 'Union Territory GST') |
| 110 | 113 | ->pluck('id')->toArray(); //Get the class Id of state |
| 111 | 114 | if ($taxClassId) { |
@@ -130,14 +133,16 @@ discard block |
||
| 130 | 133 | ->pluck('tax_classes_id')->first(); |
| 131 | 134 | $value = ''; |
| 132 | 135 | $rate = ''; |
| 133 | - if ($taxClassId) { //if state equals the user State |
|
| 136 | + if ($taxClassId) { |
|
| 137 | +//if state equals the user State |
|
| 134 | 138 | |
| 135 | 139 | $taxes = $cartController->getTaxByPriority($taxClassId); |
| 136 | 140 | |
| 137 | 141 | // $taxes = $this->cartController::getTaxByPriority($taxClassId); |
| 138 | 142 | $value = $cartController->getValueForOthers($productid, $taxClassId, $taxes); |
| 139 | 143 | $rate = $value; |
| 140 | - } else {//if Tax is selected for Any State Any Country |
|
| 144 | + } else { |
|
| 145 | +//if Tax is selected for Any State Any Country |
|
| 141 | 146 | $taxClassId = Tax::where('country', '')->where('state', 'Any State')->pluck('tax_classes_id')->first(); |
| 142 | 147 | if ($taxClassId) { |
| 143 | 148 | $taxes = $cartController->getTaxByPriority($taxClassId); |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | $state_code = $user_state->state_code; |
| 33 | 33 | if ($state_code == $origin_state) {//If user and origin state are same |
| 34 | 34 | $taxClassId = TaxClass::where('name', 'Intra State GST') |
| 35 | - ->pluck('id')->toArray(); //Get the class Id of state |
|
| 35 | + ->pluck('id')->toArray(); //Get the class Id of state |
|
| 36 | 36 | if ($taxClassId) { |
| 37 | 37 | $taxes = $cartController->getTaxByPriority($taxClassId); |
| 38 | 38 | $value = $cartController->getValueForSameState($productid, $c_gst, $s_gst, $taxClassId, $taxes); |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | { |
| 9 | 9 | protected $table = 'addons'; |
| 10 | 10 | protected $fillable = ['product', 'subscription', 'name', |
| 11 | - 'description', 'regular_price', 'selling_price', 'tax_addon', |
|
| 11 | + 'description', 'regular_price', 'selling_price', 'tax_addon', |
|
| 12 | 12 | 'show_on_order', 'auto_active_payment', 'suspend_parent', ]; |
| 13 | 13 | |
| 14 | 14 | public function relation() |
@@ -59,17 +59,17 @@ discard block |
||
| 59 | 59 | $new_promotion = $this->promotion->select('code', 'type', 'id')->get(); |
| 60 | 60 | |
| 61 | 61 | return\ DataTables::of($new_promotion) |
| 62 | - ->addColumn('checkbox', function ($model) { |
|
| 62 | + ->addColumn('checkbox', function($model) { |
|
| 63 | 63 | return "<input type='checkbox' class='promotion_checkbox' |
| 64 | 64 | value=".$model->id.' name=select[] id=check>'; |
| 65 | 65 | }) |
| 66 | - ->addColumn('code', function ($model) { |
|
| 66 | + ->addColumn('code', function($model) { |
|
| 67 | 67 | return ucfirst($model->code); |
| 68 | 68 | }) |
| 69 | - ->addColumn('type', function ($model) { |
|
| 69 | + ->addColumn('type', function($model) { |
|
| 70 | 70 | return $this->type->where('id', $model->type)->first()->name; |
| 71 | 71 | }) |
| 72 | - ->addColumn('products', function ($model) { |
|
| 72 | + ->addColumn('products', function($model) { |
|
| 73 | 73 | $selected = $this->promoRelation->select('product_id') |
| 74 | 74 | ->where('promotion_id', $model->id)->get(); |
| 75 | 75 | $result = []; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | return 'None'; |
| 83 | 83 | } |
| 84 | 84 | }) |
| 85 | - ->addColumn('action', function ($model) { |
|
| 85 | + ->addColumn('action', function($model) { |
|
| 86 | 86 | return '<a href='.url('promotions/'.$model->id.'/edit') |
| 87 | 87 | ." class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit' |
| 88 | 88 | style='color:white;'> </i> Edit</a>"; |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | ." class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit' |
| 88 | 88 | style='color:white;'> </i> Edit</a>"; |
| 89 | 89 | }) |
| 90 | - ->rawColumns(['checkbox', 'code', 'products', 'action']) |
|
| 90 | + ->rawColumns(['checkbox', 'code', 'products', 'action']) |
|
| 91 | 91 | |
| 92 | 92 | ->make(true); |
| 93 | 93 | } |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | ->pluck('product_id', 'product_id')->toArray(); |
| 150 | 150 | |
| 151 | 151 | return view('themes.default1.payment.promotion.edit', |
| 152 | - compact('product', 'promotion', 'selectedProduct', 'type')); |
|
| 152 | + compact('product', 'promotion', 'selectedProduct', 'type')); |
|
| 153 | 153 | } catch (\Exception $ex) { |
| 154 | 154 | return redirect()->back()->with('fails', $ex->getMessage()); |
| 155 | 155 | } |
@@ -255,12 +255,12 @@ discard block |
||
| 255 | 255 | |
| 256 | 256 | $userId = \Auth::user()->id; |
| 257 | 257 | \Cart::update($productid, [ |
| 258 | - 'id' => $productid, |
|
| 259 | - 'price' => $value, |
|
| 260 | - 'conditions' => $coupon, |
|
| 258 | + 'id' => $productid, |
|
| 259 | + 'price' => $value, |
|
| 260 | + 'conditions' => $coupon, |
|
| 261 | 261 | |
| 262 | - // new item price, price can also be a string format like so: '98.67' |
|
| 263 | - ]); |
|
| 262 | + // new item price, price can also be a string format like so: '98.67' |
|
| 263 | + ]); |
|
| 264 | 264 | $items = \Cart::getContent(); |
| 265 | 265 | \Session::put('items', $items); |
| 266 | 266 | |
@@ -70,37 +70,37 @@ discard block |
||
| 70 | 70 | public function getTax() |
| 71 | 71 | { |
| 72 | 72 | return \DataTables::of($this->tax->select('id', 'tax_classes_id', 'name', 'country', 'state', 'rate')->get()) |
| 73 | - ->addColumn('checkbox', function ($model) { |
|
| 73 | + ->addColumn('checkbox', function($model) { |
|
| 74 | 74 | return "<input type='checkbox' class='tax_checkbox' |
| 75 | 75 | value=".$model->id.' name=select[] id=check>'; |
| 76 | 76 | }) |
| 77 | - ->addColumn('tax_classes_id', function ($model) { |
|
| 77 | + ->addColumn('tax_classes_id', function($model) { |
|
| 78 | 78 | return ucfirst($this->tax_class->where('id', $model->tax_classes_id)->first()->name); |
| 79 | 79 | }) |
| 80 | - ->addColumn('name', function ($model) { |
|
| 80 | + ->addColumn('name', function($model) { |
|
| 81 | 81 | return ucfirst($model->name); |
| 82 | 82 | }) |
| 83 | 83 | |
| 84 | 84 | // ->showColumns('name', 'level') |
| 85 | - ->addColumn('country', function ($model) { |
|
| 85 | + ->addColumn('country', function($model) { |
|
| 86 | 86 | if ($this->country->where('country_code_char2', $model->country)->first()) { |
| 87 | 87 | return ucfirst($this->country |
| 88 | 88 | ->where('country_code_char2', $model->country)->first()->country_name); |
| 89 | 89 | } |
| 90 | 90 | }) |
| 91 | - ->addColumn('state', function ($model) { |
|
| 91 | + ->addColumn('state', function($model) { |
|
| 92 | 92 | if ($this->state->where('state_subdivision_code', $model->state)->first()) { |
| 93 | 93 | return $this->state |
| 94 | 94 | ->where('state_subdivision_code', $model->state) |
| 95 | 95 | ->first()->state_subdivision_name; |
| 96 | 96 | } |
| 97 | 97 | }) |
| 98 | - ->addColumn('rate', function ($model) { |
|
| 98 | + ->addColumn('rate', function($model) { |
|
| 99 | 99 | return $model->rate; |
| 100 | 100 | }) |
| 101 | 101 | |
| 102 | 102 | // ->showColumns('rate') |
| 103 | - ->addColumn('action', function ($model) { |
|
| 103 | + ->addColumn('action', function($model) { |
|
| 104 | 104 | return '<a href='.url('tax/'.$model->id.'/edit'). |
| 105 | 105 | " class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit' |
| 106 | 106 | style='color:white;'> </i> Edit</a>"; |
@@ -112,26 +112,26 @@ discard block |
||
| 112 | 112 | public function getTaxTable() |
| 113 | 113 | { |
| 114 | 114 | return \DataTables::of(TaxByState::select('id', 'state', 'c_gst', 's_gst', 'i_gst', 'ut_gst')->get()) |
| 115 | - ->addColumn('id', function ($model) { |
|
| 115 | + ->addColumn('id', function($model) { |
|
| 116 | 116 | return $model->id; |
| 117 | 117 | }) |
| 118 | 118 | |
| 119 | - ->addColumn('state', function ($model) { |
|
| 119 | + ->addColumn('state', function($model) { |
|
| 120 | 120 | return ucfirst($model->state); |
| 121 | 121 | }) |
| 122 | - ->addColumn('c_gst', function ($model) { |
|
| 122 | + ->addColumn('c_gst', function($model) { |
|
| 123 | 123 | return ucfirst($model->c_gst); |
| 124 | 124 | }) |
| 125 | - ->addColumn('s_gst', function ($model) { |
|
| 125 | + ->addColumn('s_gst', function($model) { |
|
| 126 | 126 | return ucfirst($model->s_gst); |
| 127 | 127 | }) |
| 128 | - ->addColumn('i_gst', function ($model) { |
|
| 128 | + ->addColumn('i_gst', function($model) { |
|
| 129 | 129 | return ucfirst($model->i_gst); |
| 130 | 130 | }) |
| 131 | - ->addColumn('ut_gst', function ($model) { |
|
| 131 | + ->addColumn('ut_gst', function($model) { |
|
| 132 | 132 | return ucfirst($model->ut_gst); |
| 133 | 133 | }) |
| 134 | - ->rawColumns(['id', 'state', 'c_gst', 's_gst', 'i_gst', 'ut_gst']) |
|
| 134 | + ->rawColumns(['id', 'state', 'c_gst', 's_gst', 'i_gst', 'ut_gst']) |
|
| 135 | 135 | ->make(true); |
| 136 | 136 | } |
| 137 | 137 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | ->addColumn('country', function ($model) { |
| 86 | 86 | if ($this->country->where('country_code_char2', $model->country)->first()) { |
| 87 | 87 | return ucfirst($this->country |
| 88 | - ->where('country_code_char2', $model->country)->first()->country_name); |
|
| 88 | + ->where('country_code_char2', $model->country)->first()->country_name); |
|
| 89 | 89 | } |
| 90 | 90 | }) |
| 91 | 91 | ->addColumn('state', function ($model) { |
@@ -112,27 +112,27 @@ discard block |
||
| 112 | 112 | public function getTaxTable() |
| 113 | 113 | { |
| 114 | 114 | return \DataTables::of(TaxByState::select('id', 'state', 'c_gst', 's_gst', 'i_gst', 'ut_gst')->get()) |
| 115 | - ->addColumn('id', function ($model) { |
|
| 116 | - return $model->id; |
|
| 117 | - }) |
|
| 118 | - |
|
| 119 | - ->addColumn('state', function ($model) { |
|
| 120 | - return ucfirst($model->state); |
|
| 121 | - }) |
|
| 122 | - ->addColumn('c_gst', function ($model) { |
|
| 123 | - return ucfirst($model->c_gst); |
|
| 124 | - }) |
|
| 125 | - ->addColumn('s_gst', function ($model) { |
|
| 126 | - return ucfirst($model->s_gst); |
|
| 127 | - }) |
|
| 128 | - ->addColumn('i_gst', function ($model) { |
|
| 129 | - return ucfirst($model->i_gst); |
|
| 130 | - }) |
|
| 131 | - ->addColumn('ut_gst', function ($model) { |
|
| 132 | - return ucfirst($model->ut_gst); |
|
| 133 | - }) |
|
| 134 | - ->rawColumns(['id', 'state', 'c_gst', 's_gst', 'i_gst', 'ut_gst']) |
|
| 135 | - ->make(true); |
|
| 115 | + ->addColumn('id', function ($model) { |
|
| 116 | + return $model->id; |
|
| 117 | + }) |
|
| 118 | + |
|
| 119 | + ->addColumn('state', function ($model) { |
|
| 120 | + return ucfirst($model->state); |
|
| 121 | + }) |
|
| 122 | + ->addColumn('c_gst', function ($model) { |
|
| 123 | + return ucfirst($model->c_gst); |
|
| 124 | + }) |
|
| 125 | + ->addColumn('s_gst', function ($model) { |
|
| 126 | + return ucfirst($model->s_gst); |
|
| 127 | + }) |
|
| 128 | + ->addColumn('i_gst', function ($model) { |
|
| 129 | + return ucfirst($model->i_gst); |
|
| 130 | + }) |
|
| 131 | + ->addColumn('ut_gst', function ($model) { |
|
| 132 | + return ucfirst($model->ut_gst); |
|
| 133 | + }) |
|
| 134 | + ->rawColumns(['id', 'state', 'c_gst', 's_gst', 'i_gst', 'ut_gst']) |
|
| 135 | + ->make(true); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | /** |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | ->withInput(); |
| 369 | 369 | } |
| 370 | 370 | $this->tax_class->fill($request->except('tax-name', 'level', |
| 371 | - 'active', 'country', 'country1', 'rate'))->save(); |
|
| 371 | + 'active', 'country', 'country1', 'rate'))->save(); |
|
| 372 | 372 | $country = ($request->input('rate')) ? $request->input('country') : $request->input('country1'); |
| 373 | 373 | |
| 374 | 374 | $this->tax->fill($request->except('tax-name', 'name', 'country'))->save(); |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | //dd($this->invoice->get()); |
| 48 | 48 | return \Datatable::collection($this->subscription->get()) |
| 49 | 49 | |
| 50 | - ->addColumn('user_id', function ($model) { |
|
| 50 | + ->addColumn('user_id', function($model) { |
|
| 51 | 51 | $user = $model->user()->first(); |
| 52 | 52 | $first = $user->first_name; |
| 53 | 53 | $last = $user->last_name; |
@@ -55,18 +55,18 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'</a>'; |
| 57 | 57 | }) |
| 58 | - ->addColumn('plan_id', function ($model) { |
|
| 58 | + ->addColumn('plan_id', function($model) { |
|
| 59 | 59 | $name = $this->plan->where('id', $model->plan_id)->first()->name; |
| 60 | 60 | |
| 61 | 61 | return $name; |
| 62 | 62 | }) |
| 63 | - ->addColumn('order_id', function ($model) { |
|
| 63 | + ->addColumn('order_id', function($model) { |
|
| 64 | 64 | $name = $this->order->where('id', $model->order_id)->first()->id; |
| 65 | 65 | |
| 66 | 66 | return $name; |
| 67 | 67 | }) |
| 68 | 68 | ->showColumns('ends_at') |
| 69 | - ->addColumn('action', function ($model) { |
|
| 69 | + ->addColumn('action', function($model) { |
|
| 70 | 70 | return '<a href='.url('subscriptions/'.$model->id)." |
| 71 | 71 | class='btn btn-sm btn-primary'>View</a>"; |
| 72 | 72 | }) |