package com.jeesharp.business.modules.pay.paytype.alipay.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 支付宝渠道 YAML 配置（占位/联调；后续可迁至 {@code pay_alipay_config} 库表）。
 *
 * @author jeesharp
 * @since 2026-05-25
 */
@Data
@Component
@ConfigurationProperties(prefix = "ali.pay")
public class AliPayChannelProperties {

    /**
     * 是否启用支付宝渠道（false 时仍装配占位 Kit，避免 legacy 代码 NPE；真实下单前请改为 true 并填密钥）
     */
    private boolean enabled = false;

    /** 异步通知地址，对应 {@code PayNotifyController} {@code /api/pay/payNotify/aliPayNotify} */
    private String notifyUrl = "http://127.0.0.1:8080/api/pay/payNotify/aliPayNotify";

    private String appId = "demo-alipay-app-id";

    private String privateKey = "MOCK_MERCHANT_PRIVATE_KEY";

    private String aliPayPublicKey = "MOCK_ALIPAY_PUBLIC_KEY";

    private String serviceUrl = "https://openapi.alipay.com/gateway.do";

    private String charset = "UTF-8";

    private String signType = "RSA2";

    /** 是否证书模式（true 时需配置 appCertPath / aliPayCertPath / aliPayRootCertPath） */
    private boolean certModel = false;

    private String appCertPath;

    private String aliPayCertPath;

    private String aliPayRootCertPath;
}
