mirror of
https://github.com/v2board/v2board.git
synced 2025-06-13 21:28:27 +08:00
update online user stat
This commit is contained in:
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user