官方SDK - 回调通知验签和解密
RequestParam requestParam = new RequestParam.Builder()
.serialNumber(wechatPayCertificateSerialNumber)
.nonce(nonce)
.signature(signature)
.timestamp(timestamp)
.body(requestBody)
.build();
NotificationConfig config = new RSAAutoCertificateConfig.Builder()
.merchantId(merchantId)
.privateKeyFromPath(privateKeyPath)
.merchantSerialNumber(merchantSerialNumber)
.apiV3Key(apiV3key)
.build();
NotificationParser parser = new NotificationParser(config);
Transaction transaction = parser.parse(requestParam, Transaction.class);
回调URL用动态地址。/xx/{商户号}
可以通过通知中的请求头的Wechatpay-Serial判断,每个商户号下唯一,5年内不会变