下载支付宝sdk,
配置了参数
// 商户PID
public static final String PARTNER = "208891151199****"; //16位数字
// 商户收款账号
public static final String SELLER = "service@wisdu**.com"; /收款账号
// 商户私钥,特别注意(pkcs8格式)
public static final String RSA_PRIVATE = "MIICXAIBAAKBgQDnEe0UZxIYb1VNKPkmLV2VM57J6oKeHCfVQ2Ket13a0Nt4UqxXK8wQTVwq+xMOMX6mcOSWqHIzSu4pHVmnidm3Iy5WGvNfJNYER8coirJX32Xl1zL9IwtTOgX6v3qvoGoD182NP627rYl9HZiPS8Ftmz0rq2KxIzverxigfZE7twIDAQABAoGBAJwr63ZsqzhElvyNgscgxi0/NET38Mv375wd7RukhxSLMKpEBiLsgQFLp82M4DYpkZXgmz6QHo84R3sWUTAA5Vmuu05dCLIu38A35lTFthnr7i+o/mfcoGPnUHEjCNkaeceNYWmieeJAPP/Y/8Nw/3ZQVoZ5Kdu3/QwWDgw1frnxAkEA/EISEsdBAe9L+Cfo+xph6kT4tmF9wDS0nGxXgCJyEo4W9A312X17WHIjXz5wJjyV9EAKNqsxY9beGaa+So5+RQJBAOp/ZUMv5u6zW0AhMS5dXqMGBN0jp6nnBNikZYlJ3C8XndR/D/8Gqz33Oizzt4DF47uVEhtxmIr4LykikywR38sCQEn21XXMFrOKhqvsh9OYmL0oHATd8RE6Yvq6ia14bBokr3Y/4aYztMbqMJTsqdWMTiuf217MM18i0VyUF5ek0EECQHFPperVVs25NTrDzzQMQhKccfU5qWbcDudwaO/yFMdcrhNkYqJk4pJKyH24Ns+uz+BwpBNGzOM6Ee/amSsOaAkCQBhMiOaO9ULhNSe0D/B0aEa1t2h0OF8s2RgOkS309IaLTOGOPKafoeb6WRnpEKWklHdj0KERPvuT6xFUD8*****=";
// 支付宝公钥,这个可以不用写
public static final String RSA_PUBLIC = "";
注意钥匙是加密的,很长很长的字符串
集成了以后一直报错,官网demo里面的代码要修改一下,
在SignUtils类里将KeyFactory keyf = KeyFactory.getInstance(ALGORITHM);这句换成KeyFactory keyf = KeyFactory.getInstance(ALGORITHM,"BC");