Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/ladybirdweb/agorainv…
Browse files Browse the repository at this point in the history
…oicing into development
  • Loading branch information
ashu555 committed Apr 21, 2019
2 parents 78efa87 + 53f7e5a commit 4fe7d64
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 34 deletions.
8 changes: 4 additions & 4 deletions app/Http/Controllers/Auth/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,18 +207,18 @@ public function retryOTP(Request $request)
case 'voice':
$array = json_decode($result, true);
$response = ['type' => 'success',
'message' => 'Voice call has been sent to '.$number.'.Please Enter the OTP received on the call to login!!', ];
'message' => 'Voice call has been sent to '.$number.'.Please Enter the OTP received on the call to login!!', ];
break;

default:
$array = json_decode($result, true);
$response = ['type' => 'success',
'message' => 'Voice call has been sent to '.$number.'.Please Enter the OTP received on the call to login!!', ];
'message' => 'Voice call has been sent to '.$number.'.Please Enter the OTP received on the call to login!!', ];
break;

}

return response()->json($response);
return response()->json($response);
} catch (\Exception $ex) {
$result = [$ex->getMessage()];

Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/Auth/BaseAuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ public static function sendOtp($mobile, $code)
{
$client = new \GuzzleHttp\Client();
$number = $code.$mobile;
$key = ApiKey::where('id', 1)->select('msg91_auth_key','msg91_sender')->first();
$key = ApiKey::where('id', 1)->select('msg91_auth_key', 'msg91_sender')->first();
$response = $client->request('GET', 'https://control.msg91.com/api/sendotp.php', [
'query' => ['authkey' => $key->msg91_auth_key, 'mobile' => $number,'sender'=>$key->msg91_sender],
'query' => ['authkey' => $key->msg91_auth_key, 'mobile' => $number, 'sender'=>$key->msg91_sender],
]);
$send = $response->getBody()->getContents();
$array = json_decode($send, true);
Expand All @@ -74,7 +74,7 @@ public function sendForReOtp($mobile, $code, $type)
$number = $code.$mobile;
$key = ApiKey::where('id', 1)->value('msg91_auth_key');
$response = $client->request('GET', 'https://control.msg91.com/api/retryotp.php', [
'query' => ['authkey' => $key, 'mobile' => $number,'retrytype'=>$type],
'query' => ['authkey' => $key, 'mobile' => $number, 'retrytype'=>$type],
]);
$send = $response->getBody()->getContents();
$array = json_decode($send, true);
Expand Down
2 changes: 0 additions & 2 deletions app/Http/Controllers/AutoUpdate/AutoUpdateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ public function addNewProductToAUS($product_name, $product_sku)
$addProduct = $this->postCurl($url, "api_key_secret=$api_key_secret&api_function=products_add&product_title=$product_name&product_sku=$product_sku&product_key=$key&product_status=1");
}



/*
* Add New Version
*/
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Common/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function getKeys(ApiKey $apikeys)
$pipedriveStatus = StatusSetting::pluck('pipedrive_status')->first();
$model = $apikeys->find(1);

return view('themes.default1.common.apikey', compact('model', 'status', 'licenseSecret', 'licenseUrl', 'siteKey', 'secretKey', 'captchaStatus', 'updateStatus', 'updateSecret', 'updateUrl', 'mobileStatus', 'mobileauthkey','msg91Sender', 'emailStatus', 'twitterStatus', 'twitterKeys', 'zohoStatus', 'zohoKey', 'rzpStatus', 'rzpKeys', 'mailchimpSetting', 'mailchimpKey', 'termsStatus', 'termsUrl', 'pipedriveKey', 'pipedriveStatus'));
return view('themes.default1.common.apikey', compact('model', 'status', 'licenseSecret', 'licenseUrl', 'siteKey', 'secretKey', 'captchaStatus', 'updateStatus', 'updateSecret', 'updateUrl', 'mobileStatus', 'mobileauthkey', 'msg91Sender', 'emailStatus', 'twitterStatus', 'twitterKeys', 'zohoStatus', 'zohoKey', 'rzpStatus', 'rzpKeys', 'mailchimpSetting', 'mailchimpKey', 'termsStatus', 'termsUrl', 'pipedriveKey', 'pipedriveStatus'));
} catch (\Exception $ex) {
return redirect('/')->with('fails', $ex->getMessage());
}
Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/Front/CartController.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public function cart(Request $request)
$items = $this->addProduct($id);
\Cart::add($items); //Add Items To the Cart Collection
}

return redirect('show/cart');
} catch (\Exception $ex) {
app('log')->error($ex->getMessage());
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/License/LicenseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function deleteProductFromAPL($product)
$url = $this->url;
$api_key_secret = $this->api_key_secret;
$productId = $this->searchProductId($product->product_sku);
$productTitle = $product->name;
$productTitle = $product->name;
$productSku = $product->sku;
$delProduct = $this->postCurl($url, "api_key_secret=$api_key_secret&api_function=products_edit
&product_id=$productId&product_title=$productTitle&product_sku=$productSku&product_status=1&delete_record=1");
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/Order/ExtendedBaseInvoiceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function edit($invoiceid, Request $request)
$totalSum = array_sum($payment);
}

return view('themes.default1.invoice.editInvoice', compact('userid','date','invoiceid', 'invoice', 'totalSum'));
return view('themes.default1.invoice.editInvoice', compact('userid', 'date', 'invoiceid', 'invoice', 'totalSum'));
}

public function postEdit($invoiceid, Request $request)
Expand All @@ -89,8 +89,8 @@ public function postEdit($invoiceid, Request $request)
$total = $request->input('total');
$status = $request->input('status');
$paid = $request->input('paid');
$invoice = Invoice::where('id', $invoiceid)->update(['grand_total'=>$total, 'status'=>$status,
'date'=>\Carbon\Carbon::parse($request->input('date'))]);
$invoice = Invoice::where('id', $invoiceid)->update(['grand_total'=> $total, 'status'=>$status,
'date' => \Carbon\Carbon::parse($request->input('date')), ]);
$order = Order::where('invoice_id', $invoiceid)->update(['price_override'=>$total]);

return redirect()->back()->with('success', \Lang::get('message.updated-successfully'));
Expand Down
5 changes: 2 additions & 3 deletions app/Http/Controllers/Order/InvoiceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ public function createInvoiceItems($invoiceid, $cart, $codevalue = '')

public function invoiceGenerateByForm(Request $request, $user_id = '')
{
$this->validate($request, [
$this->validate($request, [
'date' => 'required',
'domain' => 'sometimes|nullable|regex:/^(?!:\/\/)(?=.{1,255}$)((.{1,63}\.){1,127}(?![0-9]*$)[a-z0-9-]+\.?)$/i',
'plan' => 'required_if:subscription,true',
Expand Down Expand Up @@ -495,7 +495,7 @@ public function checkTax($productid, $userid)
if ($this->tax_option->findOrFail(1)->tax_enable == 1) {
$taxs = $this->getTaxWhenEnable($productid, $taxs[0], $userid);
} elseif ($this->tax_option->tax_enable == 0) {//if tax_enable is 0

$taxClassId = Tax::where('country', '')->where('state', 'Any State')
->pluck('tax_classes_id')->first(); //In case of India when
//other tax is available and tax is not enabled
Expand All @@ -506,7 +506,6 @@ public function checkTax($productid, $userid)
} elseif ($geoip_country != 'IN') {//In case of other country
// when tax is available and tax is not enabled(Applicable
//when Global Tax class for any country and state is not there)


$taxClassId = Tax::where('state', $geoip_state)
->orWhere('country', $geoip_country)->pluck('tax_classes_id')->first();
Expand Down
5 changes: 2 additions & 3 deletions app/Http/Controllers/Product/ProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

// use Illuminate\Http\Request;
use App\Http\Controllers\License\LicenseController;
use App\Http\Controllers\AutoUpdate\AutoUpdateController;
use App\Http\Controllers\License\LicensePermissionsController;
use App\Model\Common\Setting;
use App\Model\Common\StatusSetting;
Expand Down Expand Up @@ -419,7 +418,7 @@ public function update($id, Request $request)
$licenseStatus = StatusSetting::pluck('license_status')->first();
if ($licenseStatus == 1) {
$addProductInLicensing = $this->licensing->editProduct($input['name'], $input['product_sku']);
}
}
$product = $this->product->where('id', $id)->first();
if ($request->hasFile('image')) {
$image = $request->file('image')->getClientOriginalName();
Expand Down Expand Up @@ -473,7 +472,7 @@ public function destroy(Request $request)
$product = $this->product->where('id', $id)->first();
if ($product) {
$licenseStatus = StatusSetting::pluck('license_status')->first();
if($licenseStatus ==1) {
if ($licenseStatus == 1) {
$this->licensing->deleteProductFromAPL($product);
}
$product->delete();
Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/User/ClientController.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ public function show($id)
$currency = $client->currency;
$orders = $order->where('client', $id)->get();
$comments = $client->comments()->where('user_id', $client->id)->get();

return view(
'themes.default1.user.client.show',
compact(
Expand Down
10 changes: 5 additions & 5 deletions app/Http/Requests/User/ClientRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ public function rules()
switch ($this->method()) {
case 'POST':
return [
'first_name' => 'required',
'last_name' => 'required',
'email' => 'required|email|unique:users',
'mobile' => 'required',
'bussiness' => 'required',
'first_name' => 'required',
'last_name' => 'required',
'email' => 'required|email|unique:users',
'mobile' => 'required',
'bussiness' => 'required',
'timezone_id' => 'required',
'address' => 'required',
'zip' => 'required',
Expand Down
2 changes: 1 addition & 1 deletion app/Traits/ApiKeySettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function updatemobileDetails(Request $request)
$status = $request->input('status');
$key = $request->input('msg91_auth_key');
StatusSetting::find(1)->update(['msg91_status'=>$status]);
ApiKey::find(1)->update(['msg91_auth_key'=>$key,'msg91_sender'=>$request->input('msg91_sender')]);
ApiKey::find(1)->update(['msg91_auth_key'=>$key, 'msg91_sender'=>$request->input('msg91_sender')]);

return ['message' => 'success', 'update'=>'Msg91 Settings Updated'];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function up()
{
Schema::table('api_keys', function (Blueprint $table) {
$table->string('msg91_auth_key', 255)->nullable();
$table->string('msg91_sender',50)->nullable();
$table->string('msg91_sender', 50)->nullable();
});
}

Expand Down
5 changes: 0 additions & 5 deletions database/seeds/DatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use App\Model\Payment\PromotionType;
use App\Model\Payment\TaxOption;
use App\Model\Product\Product;
use App\Model\Product\ProductGroup;
use App\Model\Product\Type;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Seeder;
Expand Down Expand Up @@ -184,8 +183,6 @@ public function run()
}
}



class PromotionTableSeeder extends Seeder
{
public function run()
Expand All @@ -197,8 +194,6 @@ public function run()
}
}



class PromotionTypeTableSeeder extends Seeder
{
public function run()
Expand Down
3 changes: 1 addition & 2 deletions resources/lang/en/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@
'lic_api_secret' => 'API Secret',
'lic_api_url' => 'API URL',
'msg91_key' => 'Msg91 Auth Key',
'msg91_sender' => 'Sender'
, 'consumer_key' => 'Twitter Consumer Key',
'msg91_sender' => 'Sender', 'consumer_key' => 'Twitter Consumer Key',
'consumer_secret' => 'Twitter Consumer Secret',
'access_token' => 'Twitter Access Token',
'token_secret' => 'Twitter Access Token Secret',
Expand Down

0 comments on commit 4fe7d64

Please sign in to comment.