Files
lotteryLaravel/app/Services/Wallet/MainSiteWalletGateway.php

34 lines
855 B
PHP

<?php
namespace App\Services\Wallet;
use App\Models\Player;
/**
* 主站钱包对接:转入时扣主站余额,转出时给主站加款。
*
* 幂等键由彩票侧生成并与 transfer_orders.idempotent_key 对齐,主站应按同一键去重。
*/
interface MainSiteWalletGateway
{
/**
* 转入场景:主站钱包扣款 → 彩票钱包加款。
*/
public function debitMainForLotteryDeposit(
Player $player,
string $currencyCode,
int $amountMinor,
string $idempotentKey,
): MainSiteWalletResult;
/**
* 转出场景:给主站钱包加款(彩票侧已在本地扣减)。
*/
public function creditMainForLotteryWithdraw(
Player $player,
string $currencyCode,
int $amountMinor,
string $idempotentKey,
): MainSiteWalletResult;
}