Fixed F2F error & aff salt bug

This commit is contained in:
BrettonYe
2023-01-30 23:42:19 +08:00
committed by BrettonYe
parent 7d35957edf
commit 6729204f81
4 changed files with 4 additions and 4 deletions

View File

@@ -266,7 +266,7 @@ class Helpers
public static function getPriceTag($amount): string
{
$currentCurrency = session('currency');
$standard = sysConfig('standard_currency');
$standard = sysConfig('standard_currency', 'CNY');
$currencyLib = array_column(config('common.currency'), 'symbol', 'code');
if (! empty($currentCurrency) && isset($currencyLib[$currentCurrency]) && $currentCurrency !== $standard) {
return $currencyLib[$currentCurrency].CurrencyExchange::convert($currentCurrency, $amount);

View File

@@ -57,7 +57,7 @@ class F2Fpay extends Gateway
exit;
}
if ($result['code'] === 10000 && $result['msg'] === 'Success') {
if ($result['code'] === '10000' && $result['msg'] === 'Success') {
if ($request->has('out_trade_no') && in_array($request->input('trade_status'), ['TRADE_FINISHED', 'TRADE_SUCCESS'])) {
if ($this->paymentReceived($request->input('out_trade_no'))) {
exit('success');

View File

@@ -52,7 +52,7 @@ class UserService extends BaseService
{
$affSalt = sysConfig('aff_salt');
if (isset($affSalt)) {
$aff = (new Hashids($affSalt, 8))->encode(self::$user->id());
$aff = (new Hashids($affSalt, 8))->encode(self::$user->id);
} else {
$aff = self::$user->id;
}

View File

@@ -88,7 +88,7 @@ if (! function_exists('filterEmoji')) {
// 获取系统设置
if (! function_exists('sysConfig')) {
function sysConfig($key = false, $default = null)
function sysConfig(string $key = null, string $default = null)
{
return $key ? config('settings.'.$key, $default) : config('settings');
}