Search in sources :

Example 1 with AliPayApiConfig

use of com.jpay.alipay.AliPayApiConfig in project leopard by tanhaichao.

the class AlipayClientImpl method init.

@PostConstruct
public void init() {
    alipay = AlipayBuilder.newBuilder(partner, privateKey).build();
    AliPayApiConfig aliPayApiConfig = AliPayApiConfig.New();
    aliPayApiConfig.setAppId(partner);
    aliPayApiConfig.setPrivateKey(privateKey);
    aliPayApiConfig.setAlipayPublicKey(publicKey);
    aliPayApiConfig.setServiceUrl(gatewayUrl);
    aliPayApiConfig.setCharset("UTF-8");
    aliPayApiConfig.setSignType("RSA2");
    aliPayApiConfig.build();
    System.err.println("appId:" + appId);
    System.err.println("gatewayUrl:" + gatewayUrl);
    AliPayApiConfigKit.putApiConfig(aliPayApiConfig);
    alipayClient = new DefaultAlipayClient(gatewayUrl, appId, privateKey, "json", "UTF-8", publicKey, "RSA2");
}
Also used : DefaultAlipayClient(com.alipay.api.DefaultAlipayClient) AliPayApiConfig(com.jpay.alipay.AliPayApiConfig) PostConstruct(javax.annotation.PostConstruct)

Aggregations

DefaultAlipayClient (com.alipay.api.DefaultAlipayClient)1 AliPayApiConfig (com.jpay.alipay.AliPayApiConfig)1 PostConstruct (javax.annotation.PostConstruct)1