package com.ssj.alipay.utils;

import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;


/**
 * 支付宝工厂类
 * 2019年4月23日10:42:44
 * @author wuwen
 *
 */
public class AlipayClientFactory {

    private static  AlipayClient alipayClient;
    
    private AlipayClientFactory (){}

    public synchronized static AlipayClient getAlipayClient() {
        if (alipayClient == null) {
            alipayClient = new DefaultAlipayClient(AlipayPayConfig.ALIPAY_GATEWAY_NEW, AlipayPayConfig.APP_ID,
                    AlipayPayConfig.APP_PRIVATE_KEY, "json", AlipayPayConfig.CHARSET, AlipayPayConfig.ALIPAY_PUBLIC_KEY, "RSA2");
        }
        return alipayClient;
    }


}
