Files
webman-buildadmin-mall/config/playx.php

60 lines
3.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* PlayX 积分商城对接配置
*/
return [
// 返还比例:新增保障金 = ABS(yesterday_win_loss_net) * 返还比例(仅亏损时)
'return_ratio' => floatval(env('PLAYX_RETURN_RATIO', '0.1')),
// 解锁比例:今日可领取上限 = yesterday_total_deposit * 解锁比例
'unlock_ratio' => floatval(env('PLAYX_UNLOCK_RATIO', '0.1')),
// 提现折算:积分 → 现金(如 10 分 = 1 元)
'points_to_cash_ratio' => floatval(env('PLAYX_POINTS_TO_CASH_RATIO', '0.1')),
// Daily Push 签名校验PlayX 调用商城时使用)
'daily_push_secret' => strval(env('PLAYX_DAILY_PUSH_SECRET', '')),
/**
* 合作方 JWT 验签密钥HS256。非空时dailyPush 等回调需带 Authorization: Bearer
* 仅写入部署环境变量,勿提交仓库。
*/
'partner_jwt_secret' => strval(env('PLAYX_PARTNER_JWT_SECRET', '')),
// token 会话缓存过期时间(秒)
'session_expire_seconds' => intval(env('PLAYX_SESSION_EXPIRE_SECONDS', '3600')),
/**
* 为 true 时verifyToken 不向 PlayX 请求;当前实现为联调占位——不校验请求中的 token
* 每次签发新 session用户标识见 verify_token_local_default_*(待对方提供校验接口后请设为 false 并走远程校验)。
*/
'verify_token_local_only' => filter_var(env('PLAYX_VERIFY_TOKEN_LOCAL_ONLY', '1'), FILTER_VALIDATE_BOOLEAN),
/** verify_token_local_only 为 true 时写入 mall_session 的 playx 用户标识 */
'verify_token_local_default_user_id' => strval(env('PLAYX_VERIFY_TOKEN_LOCAL_DEFAULT_USER_ID', 'testmyr')),
/** verify_token_local_only 为 true 时写入 mall_session 的展示用户名 */
'verify_token_local_default_username' => strval(env('PLAYX_VERIFY_TOKEN_LOCAL_DEFAULT_USERNAME', 'yangyang123')),
// PlayX API 配置(商城调用 PlayX 时使用)
'api' => [
'base_url' => strval(env('PLAYX_API_BASE_URL', '')),
'secret_key' => strval(env('PLAYX_API_SECRET_KEY', '')),
// 完整 https URL回调 Body merchant_code+request_date+request_id+token签名同序HMAC 同 angpow相对路径拼基址 + 商户体
'token_verify_url' => strval(env('PLAYX_TOKEN_VERIFY_URL', '/api/v1/auth/verify-token')),
'bonus_grant_url' => '/api/v1/bonus/grant',
'balance_credit_url' => '/api/v1/balance/credit',
'transaction_status_url' => '/api/v1/transaction/status',
],
// Angpow Import API商城调用对方 cashmarket/merchant-api 时使用)
'angpow_import' => [
// 对方 base_url例如 https://ss2-staging2.ttwd8.com
'base_url' => strval(env('PLAYX_ANGPOW_IMPORT_BASE_URL', '')),
// 路径:文档示例为 /api/v3/merchant/angpow-imports对方 curl 示例为 /cashmarket/v3/merchant-api/angpow-imports
'path' => strval(env('PLAYX_ANGPOW_IMPORT_PATH', '/api/v3/merchant/angpow-imports')),
// merchant_code固定 plx 或按环境配置)
'merchant_code' => strval(env('PLAYX_ANGPOW_MERCHANT_CODE', 'plx')),
// HMAC-SHA1 的 auth key生产环境由 BA 提供)
'auth_key' => strval(env('PLAYX_ANGPOW_IMPORT_AUTH_KEY', '')),
// HTTPS指定 CA 证书包路径(推荐,下载 https://curl.se/ca/cacert.pem 后填绝对路径,可避免 cURL error 60
'ca_file' => strval(env('PLAYX_ANGPOW_IMPORT_CACERT', '')),
// 是否校验 SSL生产必须为 true本地无 CA 时可临时 false勿用于生产
'verify_ssl' => filter_var(env('PLAYX_ANGPOW_IMPORT_VERIFY_SSL', '1'), FILTER_VALIDATE_BOOLEAN),
// 固定货币展示映射
'currency' => 'MYR',
'visual_name' => 'Angpow',
],
];