package com.izouma.nineth.config;

import com.izouma.nineth.utils.sandpay.SandpayAccountClient;
import com.izouma.nineth.utils.sandpay.SandpayClient;
import com.izouma.nineth.utils.sandpay.SandpayNewClient;
import lombok.AllArgsConstructor;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@AllArgsConstructor
@Configuration
@EnableConfigurationProperties(SandpayProperties.class)
public class SandpayConfig {

    private SandpayProperties sandpayProperties;

    @Bean
    public SandpayClient sandpayClient(){
        SandpayClient sandpayClient = new SandpayClient(sandpayProperties);
        return sandpayClient;
    }

    /**
     * 资金交易专用
     * @return
     */
    @Bean
    public SandpayAccountClient sandpayAccountClient(){
        SandpayAccountClient sandpayAccountClient = new SandpayAccountClient(sandpayProperties);
        return sandpayAccountClient;
    }


    /**
     * 新支付平台
     * @return
     */
    @Bean
    public SandpayNewClient sandpayNewClient(){
        SandpayNewClient sandpayNewClient = new SandpayNewClient(sandpayProperties);
        return sandpayNewClient;
    }



}
