@@ -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 { |
@@ -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)) { |
@@ -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; |
@@ -84,7 +84,8 @@ discard block |
||
| 84 | 84 | $getProductId = $this->postCurl($url, "api_key_secret=$api_key_secret&api_function=search |
| 85 | 85 | &search_type=product&search_keyword=$product_sku"); |
| 86 | 86 | $details = json_decode($getProductId); |
| 87 | - if ($details->api_error_detected == 0 && is_array($details->page_message)) {//This is not true if Product_sku is updated |
|
| 87 | + if ($details->api_error_detected == 0 && is_array($details->page_message)) { |
|
| 88 | +//This is not true if Product_sku is updated |
|
| 88 | 89 | $productId = $details->page_message[0]->product_id; |
| 89 | 90 | } |
| 90 | 91 | |
@@ -120,7 +121,8 @@ discard block |
||
| 120 | 121 | &search_type=client&search_keyword=$email"); |
| 121 | 122 | |
| 122 | 123 | $details = json_decode($getUserId); |
| 123 | - if ($details->api_error_detected == 0 && is_array($details->page_message)) {//This is not true if email is updated |
|
| 124 | + if ($details->api_error_detected == 0 && is_array($details->page_message)) { |
|
| 125 | +//This is not true if email is updated |
|
| 124 | 126 | $userId = $details->page_message[0]->client_id; |
| 125 | 127 | } |
| 126 | 128 | |
@@ -18,24 +18,28 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | public function getDetailsWhenUserStateIsIndian($user_state, $origin_state, $productid, $geoip_state, $geoip_country, $status = 1) |
| 20 | 20 | { |
| 21 | - if ($user_state != '') {//Get the CGST,SGST,IGST,STATE_CODE of the user,if user from INdia |
|
| 21 | + if ($user_state != '') { |
|
| 22 | +//Get the CGST,SGST,IGST,STATE_CODE of the user,if user from INdia |
|
| 22 | 23 | $c_gst = $user_state->c_gst; |
| 23 | 24 | $s_gst = $user_state->s_gst; |
| 24 | 25 | $i_gst = $user_state->i_gst; |
| 25 | 26 | $ut_gst = $user_state->ut_gst; |
| 26 | 27 | $state_code = $user_state->state_code; |
| 27 | 28 | |
| 28 | - if ($state_code == $origin_state) {//If user and origin state are same |
|
| 29 | + if ($state_code == $origin_state) { |
|
| 30 | +//If user and origin state are same |
|
| 29 | 31 | $rateForSameState = $this->getTaxWhenIndianSameState($user_state, $origin_state, $productid, $c_gst, $s_gst, $state_code, $status); |
| 30 | 32 | $taxes = $rateForSameState['taxes']; |
| 31 | 33 | $status = $rateForSameState['status']; |
| 32 | 34 | $value = $rateForSameState['value']; |
| 33 | - } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {//If user is from other state |
|
| 35 | + } elseif ($state_code != $origin_state && $ut_gst == 'NULL') { |
|
| 36 | +//If user is from other state |
|
| 34 | 37 | $rateForOtherState = $this->getTaxWhenIndianOtherState($user_state, $origin_state, $productid, $i_gst, $state_code, $status); |
| 35 | 38 | $taxes = $rateForOtherState['taxes']; |
| 36 | 39 | $status = $rateForOtherState['status']; |
| 37 | 40 | $value = $rateForOtherState['value']; |
| 38 | - } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {//if user from Union Territory |
|
| 41 | + } elseif ($state_code != $origin_state && $ut_gst != 'NULL') { |
|
| 42 | +//if user from Union Territory |
|
| 39 | 43 | $rateForUnionTerritory = $this->getTaxWhenUnionTerritory($user_state, $origin_state, $productid, $c_gst, $ut_gst, $state_code, $status); |
| 40 | 44 | $taxes = $rateForUnionTerritory['taxes']; |
| 41 | 45 | $status = $rateForUnionTerritory['status']; |
@@ -56,13 +60,15 @@ discard block |
||
| 56 | 60 | $taxClassId = Tax::where('state', $geoip_state) |
| 57 | 61 | ->orWhere('country', $geoip_country) |
| 58 | 62 | ->pluck('tax_classes_id')->first(); |
| 59 | - if ($taxClassId) { //if state equals the user State or country equals user country |
|
| 63 | + if ($taxClassId) { |
|
| 64 | +//if state equals the user State or country equals user country |
|
| 60 | 65 | $taxForSpecificCountry = $this->getTaxForSpecificCountry($taxClassId, $productid, $status); |
| 61 | 66 | $taxes = $taxForSpecificCountry['taxes']; |
| 62 | 67 | $status = $taxForSpecificCountry['status']; |
| 63 | 68 | $value = $taxForSpecificCountry['value']; |
| 64 | 69 | $rate = $taxForSpecificCountry['value']; |
| 65 | - } else {//if Tax is selected for Any Country Any State |
|
| 70 | + } else { |
|
| 71 | +//if Tax is selected for Any Country Any State |
|
| 66 | 72 | $taxClassId = Tax::where('country', '') |
| 67 | 73 | ->where('state', 'Any State') |
| 68 | 74 | ->pluck('tax_classes_id')->first(); |
@@ -96,13 +102,15 @@ discard block |
||
| 96 | 102 | $status = 0; |
| 97 | 103 | } |
| 98 | 104 | $rate = $value; |
| 99 | - } else {//In case of other country |
|
| 105 | + } else { |
|
| 106 | +//In case of other country |
|
| 100 | 107 | //when tax is available and tax is not enabled |
| 101 | 108 | //(Applicable when Global Tax class for any country and state is not there) |
| 102 | 109 | $taxClassId = Tax::where('state', $geoip_state) |
| 103 | 110 | ->orWhere('country', $geoip_country) |
| 104 | 111 | ->pluck('tax_classes_id')->first(); |
| 105 | - if ($taxClassId) { //if state equals the user State |
|
| 112 | + if ($taxClassId) { |
|
| 113 | +//if state equals the user State |
|
| 106 | 114 | $taxes = $this->getTaxByPriority($taxClassId); |
| 107 | 115 | $value = $this->getValueForOthers($productid, $taxClassId, $taxes); |
| 108 | 116 | if ($value == '') { |
@@ -90,10 +90,12 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | public function getAgents($agents, $productid, $plan) |
| 92 | 92 | { |
| 93 | - if (!$agents) {//If agents is not received in the request in the case when |
|
| 93 | + if (!$agents) { |
|
| 94 | +//If agents is not received in the request in the case when |
|
| 94 | 95 | // 'modify agent' is not allowed for the Product,get the no of Agents from the Plan Table. |
| 95 | 96 | $planForAgent = Product::find($productid)->planRelation->find($plan); |
| 96 | - if ($planForAgent) {//If Plan Exists For the Product ie not a Product without Plan |
|
| 97 | + if ($planForAgent) { |
|
| 98 | +//If Plan Exists For the Product ie not a Product without Plan |
|
| 97 | 99 | $noOfAgents = $planForAgent->planPrice->first()->no_of_agents; |
| 98 | 100 | $agents = $noOfAgents ? $noOfAgents : 0; //If no. of Agents is specified then that,else 0(Unlimited Agents) |
| 99 | 101 | } else { |
@@ -106,7 +108,8 @@ discard block |
||
| 106 | 108 | |
| 107 | 109 | public function getQuantity($qty, $productid, $plan) |
| 108 | 110 | { |
| 109 | - if (!$qty) {//If quantity is not received in the request in the case when 'modify quantity' is not allowed for the Product,get the Product qUANTITY from the Plan Table. |
|
| 111 | + if (!$qty) { |
|
| 112 | +//If quantity is not received in the request in the case when 'modify quantity' is not allowed for the Product,get the Product qUANTITY from the Plan Table. |
|
| 110 | 113 | $planForQty = Product::find($productid)->planRelation->find($plan); |
| 111 | 114 | if ($planForQty) { |
| 112 | 115 | $quantity = Product::find($productid)->planRelation->find($plan)->planPrice->first()->product_quantity; |
@@ -134,7 +134,8 @@ discard block |
||
| 134 | 134 | { |
| 135 | 135 | try { |
| 136 | 136 | foreach ($invoiceChecked as $key => $value) { |
| 137 | - if ($key != 0) {//If Payment is linked to Invoice |
|
| 137 | + if ($key != 0) { |
|
| 138 | +//If Payment is linked to Invoice |
|
| 138 | 139 | $invoice = Invoice::find($value); |
| 139 | 140 | $invoice_status = 'pending'; |
| 140 | 141 | $payment = Payment::where('invoice_id', $value)->create([ |
@@ -159,7 +160,8 @@ discard block |
||
| 159 | 160 | $invoice->status = $invoice_status; |
| 160 | 161 | $invoice->save(); |
| 161 | 162 | } |
| 162 | - } elseif (count($invoiceChecked) == 1 || $amtToCredit > 0) {//If Payment is not linked to any invoice and is to be credited to User Accunt |
|
| 163 | + } elseif (count($invoiceChecked) == 1 || $amtToCredit > 0) { |
|
| 164 | +//If Payment is not linked to any invoice and is to be credited to User Accunt |
|
| 163 | 165 | $totalExtraSum = Payment::where('user_id', $clientid)->where('invoice_id', 0) |
| 164 | 166 | ->pluck('amt_to_credit')->first(); //Get the total Extra Amt Paid |
| 165 | 167 | if ($totalExtraSum) { |
@@ -230,7 +232,8 @@ discard block |
||
| 230 | 232 | try { |
| 231 | 233 | $sum = 0; |
| 232 | 234 | foreach ($invoiceChecked as $key => $value) { |
| 233 | - if ($key != 0) {//If Payment is linked to Invoice |
|
| 235 | + if ($key != 0) { |
|
| 236 | +//If Payment is linked to Invoice |
|
| 234 | 237 | $invoice = Invoice::find($value); |
| 235 | 238 | Payment::where('user_id', $clientid)->where('invoice_id', 0) |
| 236 | 239 | ->update(['amt_to_credit'=>$amtToCredit]); |