package com.jsowell.adapay.config.merchant;

import com.jsowell.adapay.config.AbstractAdapayConfig;
import com.jsowell.adapay.factory.AdapayConfigFactory;
import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 万车充adapay配置类
 */
@Component
@Getter
@Setter
public class JsowellAdapayConfig extends AbstractAdapayConfig {
    @Value("${adapay.debugFlag}")
    private boolean debugFlag;

    @Value("${adapay.prodMode}")
    private boolean prodMode;

    @Value("${adapay.jsowell.apiKey}")
    private String apiKey;

    @Value("${adapay.jsowell.mockApiKey}")
    private String mockApiKey;

    @Value("${adapay.jsowell.rsaPrivateKey}")
    private String rsaPrivateKey;

    @Value("${adapay.jsowell.appId}")
    private String adapayAppId;

    @Value("${adapay.jsowell.wechatAppId}")
    private String wechatAppId;

    @Value("${adapay.jsowell.alipayAppId}")
    private String alipayAppId;

    @Override
    public void afterPropertiesSet() throws Exception {
        // key为微信小程序id
        AdapayConfigFactory.register(wechatAppId, this);
        // key为支付宝小程序id
        AdapayConfigFactory.register(alipayAppId, this);
    }
}
