| | |
| | | import com.java110.utils.util.PayUtil; |
| | | import org.bouncycastle.util.encoders.Base64; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import com.java110.core.log.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.client.RestTemplate; |
| | |
| | | @Autowired |
| | | private RestTemplate outRestTemplate; |
| | | |
| | | public static final String wechatReturnUrl = "https://api.mch.weixin.qq.com/secapi/pay/refund"; |
| | | public static final String wechatReturnUrl = "https://api.plutuspay.com/open/v2/refund"; |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(ReturnPayFeeMoneyAdapt.class); |
| | | |
| | |
| | | throw new IllegalArgumentException("未配置公众号或者小程序信息"); |
| | | } |
| | | String privateKey = CommunitySettingFactory.getRemark(smallWeChatDtos.get(0).getObjId(), "PLUTUS_PRIVATE_KEY"); |
| | | String devId = CommunitySettingFactory.getValue(smallWeChatDto.getObjId(), "PLUTUS_DEV_ID"); |
| | | |
| | | String param = PlutusFactory.Encryption(parameters.toJSONString(),privateKey,smallWeChatDtos.get(0).getPayPassword()); |
| | | String param = PlutusFactory.Encryption(parameters.toJSONString(),privateKey,smallWeChatDtos.get(0).getPayPassword(),devId); |
| | | System.out.println(param); |
| | | |
| | | String str = PlutusFactory.post(wechatReturnUrl, param); |
| | |
| | | throw new IllegalArgumentException("支付失败签名失败"); |
| | | } |
| | | //解密 |
| | | byte[] bb = PlutusFactory.decrypt(Base64.decode(content), PlutusFactory.SECRET_KEY); |
| | | byte[] bb = PlutusFactory.decrypt(Base64.decode(content), smallWeChatDtos.get(0).getPayPassword()); |
| | | //服务器返回内容 |
| | | String paramOut = new String(bb); |
| | | |