@@ -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 { |
@@ -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); |
@@ -475,7 +475,8 @@ discard block |
||
| 475 | 475 | if ($this->tax_option->findOrFail(1)->inclusive == 0) { |
| 476 | 476 | if ($this->tax_option->findOrFail(1)->tax_enable == 1) { |
| 477 | 477 | $taxs = $this->getTaxWhenEnable($productid, $taxs[0], $userid); |
| 478 | - } elseif ($this->tax_option->tax_enable == 0) {//if tax_enable is 0 |
|
| 478 | + } elseif ($this->tax_option->tax_enable == 0) { |
|
| 479 | +//if tax_enable is 0 |
|
| 479 | 480 | |
| 480 | 481 | $taxClassId = Tax::where('country', '')->where('state', 'Any State') |
| 481 | 482 | ->pluck('tax_classes_id')->first(); //In case of India when |
@@ -484,13 +485,15 @@ discard block |
||
| 484 | 485 | $rate = $this->getTotalRate($taxClassId, $productid, $taxs); |
| 485 | 486 | $taxs = $rate['taxes']; |
| 486 | 487 | $rate = $rate['rate']; |
| 487 | - } elseif ($geoip_country != 'IN') {//In case of other country |
|
| 488 | + } elseif ($geoip_country != 'IN') { |
|
| 489 | +//In case of other country |
|
| 488 | 490 | // when tax is available and tax is not enabled(Applicable |
| 489 | 491 | //when Global Tax class for any country and state is not there) |
| 490 | 492 | |
| 491 | 493 | $taxClassId = Tax::where('state', $geoip_state) |
| 492 | 494 | ->orWhere('country', $geoip_country)->pluck('tax_classes_id')->first(); |
| 493 | - if ($taxClassId) { //if state equals the user State |
|
| 495 | + if ($taxClassId) { |
|
| 496 | +//if state equals the user State |
|
| 494 | 497 | $rate = $this->getTotalRate($taxClassId, $productid, $taxs); |
| 495 | 498 | $taxs = $rate['taxes']; |
| 496 | 499 | $rate = $rate['rate']; |
@@ -533,11 +536,13 @@ discard block |
||
| 533 | 536 | $i_gst = 0; |
| 534 | 537 | $ut_gst = 0; |
| 535 | 538 | $state_code = ''; |
| 536 | - if ($user_state != '') {//Get the CGST,SGST,IGST,STATE_CODE of the user |
|
| 539 | + if ($user_state != '') { |
|
| 540 | +//Get the CGST,SGST,IGST,STATE_CODE of the user |
|
| 537 | 541 | $tax = $this->getTaxWhenState($user_state, $productid, $origin_state); |
| 538 | 542 | $taxes = $tax['taxes']; |
| 539 | 543 | $value = $tax['value']; |
| 540 | - } else {//If user from other Country |
|
| 544 | + } else { |
|
| 545 | +//If user from other Country |
|
| 541 | 546 | $tax = $this->getTaxWhenOtherCountry($geoip_state, $geoip_country, $productid); |
| 542 | 547 | $taxes = $tax['taxes']; |
| 543 | 548 | $value = $tax['value']; |
@@ -25,7 +25,8 @@ |
||
| 25 | 25 | $currencyAndSymbol = $cart_controller->currency(); |
| 26 | 26 | $currency = $currencyAndSymbol['currency']; |
| 27 | 27 | $symbol = $currencyAndSymbol['symbol']; |
| 28 | - if ($symbol == '') { //If user has no currency symbol(In case of old customers) |
|
| 28 | + if ($symbol == '') { |
|
| 29 | +//If user has no currency symbol(In case of old customers) |
|
| 29 | 30 | $symbol = Currency::where('code', $currency)->pluck('symbol')->first(); |
| 30 | 31 | $symbol = \Auth::user()->update(['currency_symbol'=> $symbol]); |
| 31 | 32 | } |
@@ -96,7 +96,8 @@ |
||
| 96 | 96 | $pluginName[] = $plugin->name; //get the name of active plugin |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - if (count($models) > 0) {//If more than 1 plugin is active it will check the currencies allowed for that plugin.If the currencies allowed matches the passed arguement(currency),that plugin name is returned |
|
| 99 | + if (count($models) > 0) { |
|
| 100 | +//If more than 1 plugin is active it will check the currencies allowed for that plugin.If the currencies allowed matches the passed arguement(currency),that plugin name is returned |
|
| 100 | 101 | for ($i = 0; $i < count($pluginName); $i++) { |
| 101 | 102 | $currencies = explode(',', $models[$i]->currencies); |
| 102 | 103 | if (in_array($currency, $currencies)) { |
@@ -183,7 +183,8 @@ discard block |
||
| 183 | 183 | $this->product_upload->save(); |
| 184 | 184 | $this->product->where('id', $product_id->id)->update(['version'=>$request->input('version')]); |
| 185 | 185 | $autoUpdateStatus = StatusSetting::pluck('update_settings')->first(); |
| 186 | - if ($autoUpdateStatus == 1) { //If License Setting Status is on,Add Product to the License Manager |
|
| 186 | + if ($autoUpdateStatus == 1) { |
|
| 187 | +//If License Setting Status is on,Add Product to the License Manager |
|
| 187 | 188 | $updateClassObj = new \App\Http\Controllers\AutoUpdate\AutoUpdateController(); |
| 188 | 189 | $addProductToAutoUpdate = $updateClassObj->addNewVersion($product_id->id, $request->input('version'), '1'); |
| 189 | 190 | } |
@@ -270,7 +271,8 @@ discard block |
||
| 270 | 271 | |
| 271 | 272 | try { |
| 272 | 273 | $licenseStatus = StatusSetting::pluck('license_status')->first(); |
| 273 | - if ($licenseStatus == 1) { //If License Setting Status is on,Add Product to the License Manager |
|
| 274 | + if ($licenseStatus == 1) { |
|
| 275 | +//If License Setting Status is on,Add Product to the License Manager |
|
| 274 | 276 | $addProductToLicensing = $this->licensing->addNewProduct($input['name'], $input['product_sku']); |
| 275 | 277 | } |
| 276 | 278 | $licenseCont = new \App\Http\Controllers\AutoUpdate\AutoUpdateController(); |
@@ -80,7 +80,8 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function checkoutForm(Request $request) |
| 82 | 82 | { |
| 83 | - if (!\Auth::user()) {//If User is not Logged in then send him to login Page |
|
| 83 | + if (!\Auth::user()) { |
|
| 84 | +//If User is not Logged in then send him to login Page |
|
| 84 | 85 | $url = $request->segments(); //The requested url (chekout).Save it in Session |
| 85 | 86 | \Session::put('session-url', $url[0]); |
| 86 | 87 | $content = Cart::getContent(); |
@@ -106,7 +107,8 @@ discard block |
||
| 106 | 107 | |
| 107 | 108 | try { |
| 108 | 109 | $domain = $request->input('domain'); |
| 109 | - if ($domain) {//Store the Domain in session when user Logged In |
|
| 110 | + if ($domain) { |
|
| 111 | +//Store the Domain in session when user Logged In |
|
| 110 | 112 | foreach ($domain as $key => $value) { |
| 111 | 113 | \Session::put('domain'.$key, $value); |
| 112 | 114 | } |
@@ -131,7 +133,8 @@ discard block |
||
| 131 | 133 | public function getAttributes($content) |
| 132 | 134 | { |
| 133 | 135 | try { |
| 134 | - if (count($content) > 0) {//after ProductPurchase this is not true as cart is cleared |
|
| 136 | + if (count($content) > 0) { |
|
| 137 | +//after ProductPurchase this is not true as cart is cleared |
|
| 135 | 138 | foreach ($content as $key => $item) { |
| 136 | 139 | $attributes[] = $item->attributes; |
| 137 | 140 | $cart_currency = $attributes[0]['currency']['currency']; //Get the currency of Product in the cart |
@@ -36,7 +36,8 @@ |
||
| 36 | 36 | $productCheck = $orders->product() |
| 37 | 37 | ->select('github_owner', 'github_repository', 'type') |
| 38 | 38 | ->where('id', $orders->product)->first(); |
| 39 | - if ($permissions['downloadPermission'] == 1) { //If the Product has doownlaod permission |
|
| 39 | + if ($permissions['downloadPermission'] == 1) { |
|
| 40 | +//If the Product has doownlaod permission |
|
| 40 | 41 | if (!$productCheck->github_owner == '' && !$productCheck->github_repository == '') { |
| 41 | 42 | $listUrl = $this->downloadGithubPopup($orders->client, $orders->invoice()->first()->id, $productid); |
| 42 | 43 | } else { |
@@ -177,11 +177,13 @@ |
||
| 177 | 177 | |
| 178 | 178 | //if product has Update expiry date ie subscription is generated |
| 179 | 179 | if ($updateEndDate) { |
| 180 | - if ($downloadPermission['allowDownloadTillExpiry'] == 1) {//Perpetual download till expiry permission selected |
|
| 180 | + if ($downloadPermission['allowDownloadTillExpiry'] == 1) { |
|
| 181 | +//Perpetual download till expiry permission selected |
|
| 181 | 182 | $getDownload = $this->whenDownloadTillExpiry($updateEndDate, $productid, $versions, $clientid, $invoiceid); |
| 182 | 183 | |
| 183 | 184 | return $getDownload; |
| 184 | - } elseif ($downloadPermission['allowDownloadTillExpiry'] == 0) {//When download retires after subscription |
|
| 185 | + } elseif ($downloadPermission['allowDownloadTillExpiry'] == 0) { |
|
| 186 | +//When download retires after subscription |
|
| 185 | 187 | $getDownload = $this->whenDownloadExpiresAfterExpiry($countExpiry, $countVersions, $updateEndDate, $productid, $versions, $clientid, $invoiceid); |
| 186 | 188 | |
| 187 | 189 | return $getDownload; |