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 XixiaoAdapayConfig extends AbstractAdapayConfig {

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

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

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

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

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

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

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

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