wallet tron transactions
This commit is contained in:
47
app/Jobs/Wallet/WalletAddressTransactionQueue.php
Normal file
47
app/Jobs/Wallet/WalletAddressTransactionQueue.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Wallet;
|
||||
|
||||
use App\Bean\Queue\Wallet\QueueEventBean;
|
||||
use App\Exceptions\QueueException;
|
||||
use App\Service\Coin\Tron\UsdtTrx20Service;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class WalletAddressTransactionQueue implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//钱包地址交易账变处理队列
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*/
|
||||
public function handle(array $params): void
|
||||
{
|
||||
$oQueueEventBean = new QueueEventBean($params);
|
||||
$oUsdtTrx20Service = new UsdtTrx20Service();
|
||||
try {
|
||||
$oUsdtTrx20Service->walletAddressTransactionConsumer($oQueueEventBean);
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
}
|
||||
|
||||
public static function putToQueue(QueueEventBean $bean,$delaySec = null): \Illuminate\Foundation\Bus\PendingDispatch
|
||||
{
|
||||
$queue = self::dispatch($bean->toArrayNotNull())->onQueue(QueueEventBean::QUEUE_NAME);
|
||||
if(!empty($delaySec)){
|
||||
$queue->delay(now()->addSeconds($delaySec));
|
||||
}
|
||||
return $queue;
|
||||
}
|
||||
}
|
||||
46
app/Jobs/Wallet/WalletBlockQueue.php
Normal file
46
app/Jobs/Wallet/WalletBlockQueue.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Wallet;
|
||||
|
||||
use App\Bean\Queue\Wallet\QueueWalletBlockBean;
|
||||
use App\Service\Coin\Tron\UsdtTrx20Service;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class WalletBlockQueue implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//处理tron区块任务
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*/
|
||||
public function handle(array $params): void
|
||||
{
|
||||
$oQueueWalletBlockBean = new QueueWalletBlockBean($params);
|
||||
$oUsdtTrx20Service = new UsdtTrx20Service();
|
||||
try {
|
||||
$oUsdtTrx20Service->tronBlockConsumer($oQueueWalletBlockBean);
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
}
|
||||
|
||||
public static function putToQueue(QueueWalletBlockBean $bean,$delaySec = null): \Illuminate\Foundation\Bus\PendingDispatch
|
||||
{
|
||||
$queue = self::dispatch($bean->toArrayNotNull())->onQueue(QueueWalletBlockBean::QUEUE_NAME);
|
||||
if(!empty($delaySec)){
|
||||
$queue->delay(now()->addSeconds($delaySec));
|
||||
}
|
||||
return $queue;
|
||||
}
|
||||
}
|
||||
43
app/Jobs/Wallet/WalletBlockTransactionQueue.php
Normal file
43
app/Jobs/Wallet/WalletBlockTransactionQueue.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Wallet;
|
||||
|
||||
use App\Bean\Queue\Wallet\QueueWalletBlockTransactionBean;
|
||||
use App\Exceptions\QueueException;
|
||||
use App\Service\Coin\Tron\UsdtTrx20Service;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class WalletBlockTransactionQueue implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*/
|
||||
public function handle(array $params): void
|
||||
{
|
||||
$oQueueWalletBlockTransactionBean = new QueueWalletBlockTransactionBean($params);
|
||||
$oUsdtTrx20Service = new UsdtTrx20Service();
|
||||
try {
|
||||
$oUsdtTrx20Service->tronBlockTransactionConsumer($oQueueWalletBlockTransactionBean);
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
}
|
||||
|
||||
public static function putToQueue(QueueWalletBlockTransactionBean $bean): \Illuminate\Foundation\Bus\PendingDispatch
|
||||
{
|
||||
return self::dispatch($bean->toArrayNotNull())->onQueue(QueueWalletBlockTransactionBean::QUEUE_NAME);
|
||||
}
|
||||
}
|
||||
36
app/Jobs/Wallet/WalletNotifyToPlatformQueue.php
Normal file
36
app/Jobs/Wallet/WalletNotifyToPlatformQueue.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Wallet;
|
||||
|
||||
use App\Bean\Queue\Wallet\QueueNotifyToPlatformBean;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class WalletNotifyToPlatformQueue implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//通知到平台
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public static function putToQueue(QueueNotifyToPlatformBean $bean): \Illuminate\Foundation\Bus\PendingDispatch
|
||||
{
|
||||
return self::dispatch($bean->toArrayNotNull())->onQueue(QueueNotifyToPlatformBean::QUEUE_NAME);
|
||||
}
|
||||
}
|
||||
55
app/Jobs/Wallet/WalletPlatformTransactionQueue.php
Normal file
55
app/Jobs/Wallet/WalletPlatformTransactionQueue.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Wallet;
|
||||
|
||||
use App\Bean\Queue\Wallet\QueueWalletPlatformTransactionBean;
|
||||
use App\Exceptions\QueueException;
|
||||
use App\Models\Wallet\Wallet\WalletAddressTransactionModel;
|
||||
use App\Service\PlatformRechargeService;
|
||||
use App\Service\PlatformWithdrawService;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class WalletPlatformTransactionQueue implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//处理平台到账账变
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*/
|
||||
public function handle(array $params): void
|
||||
{
|
||||
$bean = new QueueWalletPlatformTransactionBean($params);
|
||||
$oWithdrawService = new PlatformWithdrawService();
|
||||
$oRechargeSService = new PlatformRechargeService();
|
||||
try {
|
||||
$type = $bean->getType();
|
||||
//提现
|
||||
if ($type == WalletAddressTransactionModel::TYPE_WITHDRAW) {
|
||||
$oWithdrawService->walletPlatformTransactionConsumer($bean);
|
||||
}
|
||||
//充值
|
||||
if ($type == WalletAddressTransactionModel::TYPE_RECHARGE) {
|
||||
$oRechargeSService->walletPlatformTransactionConsumer($bean);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static function putToQueue(QueueWalletPlatformTransactionBean $bean): \Illuminate\Foundation\Bus\PendingDispatch
|
||||
{
|
||||
return self::dispatch($bean->toArrayNotNull())->onQueue(QueueWalletPlatformTransactionBean::QUEUE_NAME);
|
||||
}
|
||||
}
|
||||
47
app/Jobs/Wallet/WalletPlatformWithdrawTransferQueue.php
Normal file
47
app/Jobs/Wallet/WalletPlatformWithdrawTransferQueue.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Wallet;
|
||||
|
||||
use App\Bean\Queue\Wallet\QueueWalletPlatformWithdrawTransferBean;
|
||||
use App\Exceptions\QueueException;
|
||||
use App\Service\PlatformWithdrawService;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class WalletPlatformWithdrawTransferQueue implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//处理提现任务
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*/
|
||||
public function handle(array $params): void
|
||||
{
|
||||
$bean = new QueueWalletPlatformWithdrawTransferBean($params);
|
||||
$oService = new PlatformWithdrawService();
|
||||
try {
|
||||
$oService->withdrawTransferConsumer($bean);
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
}
|
||||
|
||||
public static function putToQueue(QueueWalletPlatformWithdrawTransferBean $bean, $delaySec = null): \Illuminate\Foundation\Bus\PendingDispatch
|
||||
{
|
||||
$queue = self::dispatch($bean->toArrayNotNull())->onQueue(QueueWalletPlatformWithdrawTransferBean::QUEUE_NAME);
|
||||
if(!empty($delaySec)){
|
||||
$queue->delay(now()->addSeconds($delaySec));
|
||||
}
|
||||
return $queue;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user