update online user stat

This commit is contained in:
Tokumeikoi
2020-06-05 13:25:32 +08:00
parent 3200c427ce
commit 47a6c4077a
6 changed files with 12 additions and 31 deletions

View File

@ -2,12 +2,7 @@
namespace App\Console\Commands;
use App\Utils\Helper;
use Illuminate\Console\Command;
use Stripe\Source;
use Stripe\Stripe;
use Stripe\StripeClient;
use Omnipay\Omnipay;
class Test extends Command
{
@ -42,21 +37,5 @@ class Test extends Command
*/
public function handle()
{
$gateway = Omnipay::create('Stripe');
$gateway->setApiKey('sk_test_gDIIPtUgWZHbnTR7CUWZS8k500NsLS9SYB');
$formData = array('number' => '4242424242424242', 'expiryMonth' => '6', 'expiryYear' => '2030', 'cvv' => '333');
$response = $gateway->purchase(array('amount' => '10.00', 'currency' => 'USD', 'card' => $formData))->send();
if ($response->isRedirect()) {
// redirect to offsite payment gateway
$response->redirect();
} elseif ($response->isSuccessful()) {
// payment was successful: update database
print_r($response);
} else {
// payment failed: display message to customer
echo $response->getMessage();
}
}
}

View File

@ -42,7 +42,6 @@ class V2boardCache extends Command
*/
public function handle()
{
$this->cacheServerStat();
}
private function cacheServerStat()
@ -63,8 +62,7 @@ class V2boardCache extends Command
'd' => $serverLog->d,
'online' => $serverLog->online
];
Cache::put(CacheKey::get('SERVER_STAT', $serverLog->server_id), json_encode($data), 3600);
ServerStat::create($data);
// ServerStat::create($data);
}
}
}