diff --git a/app/Console/Commands/TestBot.php b/app/Console/Commands/TestBot.php new file mode 100644 index 000000000000..bb4b4a249a6f --- /dev/null +++ b/app/Console/Commands/TestBot.php @@ -0,0 +1,54 @@ +info(date('Y-m-d').' Running TestBot...'); + + $clientId = env('MSBOT_CLIENT_ID'); + $clientSecret = env('MSBOT_CLIENT_SECRET'); + + $data = sprintf('grant_type=client_credentials&client_id=%s&client_secret=%s&scope=https://graph.microsoft.com/.default', $clientId, $clientSecret); + $curl = curl_init(); + + $opts = [ + CURLOPT_URL => MSBOT_LOGIN_URL, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_POST => 'POST', + CURLOPT_POSTFIELDS => $data, + ]; + + curl_setopt_array($curl, $opts); + $response = print_r(curl_exec($response)); + curl_close($curl); + + print_r($response); + } +} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 179e423388f1..722a14dbe77f 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -21,8 +21,9 @@ class Kernel extends ConsoleKernel 'App\Console\Commands\SendRenewalInvoices', 'App\Console\Commands\ChargeRenewalInvoices', 'App\Console\Commands\SendReminders', - 'App\Console\Commands\TestOFX', 'App\Console\Commands\GenerateResources', + 'App\Console\Commands\TestOFX', + 'App\Console\Commands\TestBot', ]; /** diff --git a/app/Http/routes.php b/app/Http/routes.php index a01aaf7bb24b..b001ce159856 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -626,6 +626,7 @@ if (!defined('CONTACT_EMAIL')) { define('EMAIL_MARKUP_URL', env('EMAIL_MARKUP_URL', 'https://developers.google.com/gmail/markup')); define('OFX_HOME_URL', env('OFX_HOME_URL', 'http://www.ofxhome.com/index.php/home/directory/all')); define('GOOGLE_ANALYITCS_URL', env('GOOGLE_ANALYITCS_URL', 'https://www.google-analytics.com/collect')); + define('MSBOT_LOGIN_URL', 'https://login.microsoftonline.com/common/oauth2/v2.0/token'); define('BLANK_IMAGE', 'data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs='); diff --git a/public/images/round_logo.png b/public/images/round_logo.png index fd878ea4e90d..0c66352847ba 100644 Binary files a/public/images/round_logo.png and b/public/images/round_logo.png differ