当前位置: 首页 > news >正文

专门做眼镜的国外网站工程建设指挥部网站

专门做眼镜的国外网站,工程建设指挥部网站,什么公司做网站,天津建设工程1.将p12证书转为pem证书#xff0c;得到商户私钥 openssl pkcs12 -in apiclient_cert.p12 -out apiclient_cert.pem -nodes 密码是#xff1a;商户id 2.将获取到的apiclient_cert.pem证书#xff0c;复制出这一块内容#xff0c;其他的不要 3.下载这个工具包 https://gi…1.将p12证书转为pem证书得到商户私钥 openssl pkcs12 -in apiclient_cert.p12 -out apiclient_cert.pem -nodes 密码是商户id 2.将获取到的apiclient_cert.pem证书复制出这一块内容其他的不要 3.下载这个工具包 https://github.com/wechatpay-apiv3/CertificateDownloader 4.在test包中运行 生成证书 5.引入腾讯的sdk https://github.com/wechatpay-apiv3/wechatpay-apache-httpclient dependencygroupIdcom.github.wechatpay-apiv3/groupIdartifactIdwechatpay-apache-httpclient/artifactIdversion0.2.2/version/dependency 6.测试示例 import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; import com.wechat.pay.contrib.apache.httpclient.WechatPayHttpClientBuilder; import com.wechat.pay.contrib.apache.httpclient.util.PemUtil; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.util.EntityUtils;import java.io.ByteArrayOutputStream; import java.io.FileInputStream; import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.List;public class test {public static void main(String[] args) throws Exception {String apiV3key SYKJ20234545weasdq;// 商户号String mchId 150923821451;// 商户证书序列号String mchSerialNo 79D9A85662A93453457720657B19;// 商户私钥String mchPrivateKeyFilePath D:\\可删除\\apiclient_cert.pem;// 微信支付平台证书String wechatpayCertificateFilePath E:\\allrun2\\微信支付证书工具\\wechatpay_38023669B5DBFED58B2B16B3D38CA15DB983E002.pem;//下载成功后保存证书的路径String outputFilePath E:\\allrun2\\微信支付证书工具;//native统一下单String nativePay https://api.mch.weixin.qq.com/v3/pay/transactions/native;WechatPayHttpClientBuilder builder WechatPayHttpClientBuilder.create().withMerchant(mchId, mchSerialNo, PemUtil.loadPrivateKey(new FileInputStream(mchPrivateKeyFilePath)));if (wechatpayCertificateFilePath null) {//不做验签builder.withValidator(response - true);} else {ListX509Certificate certs new ArrayList();certs.add(PemUtil.loadCertificate(new FileInputStream(wechatpayCertificateFilePath)));builder.withWechatpay(certs);}/*HttpGet httpGet new HttpGet(CertDownloadPath);httpGet.addHeader(Accept, application/json);try (CloseableHttpClient client builder.build()) {CloseableHttpResponse response client.execute(httpGet);int statusCode response.getStatusLine().getStatusCode();String body EntityUtils.toString(response.getEntity());if (statusCode 200) {System.out.println(body: body);} else {System.out.println(download failed,resp code statusCode ,body body);throw new IOException(request failed);}}*/HttpPost httpPost new HttpPost(nativePay);httpPost.addHeader(Accept, application/json);httpPost.addHeader(Content-type,application/json; charsetutf-8);ObjectMapper objectMapper new ObjectMapper();ByteArrayOutputStream bos new ByteArrayOutputStream();ObjectNode rootNode objectMapper.createObjectNode();rootNode.put(mchid,mchId).put(appid, wxf3152dbae1f27a61).put(description, Ima5677公仔).put(notify_url, http://2j9c780335.zicp.vip/siyu-cloud-pay-biz/pms/wechatPay/callback).put(out_trade_no, 515414244);rootNode.putObject(amount).put(total, 1);objectMapper.writeValue(bos, rootNode);httpPost.setEntity(new StringEntity(bos.toString(UTF-8)));try (CloseableHttpClient httpClient builder.build()) {CloseableHttpResponse response httpClient.execute(httpPost);String bodyAsString EntityUtils.toString(response.getEntity());System.out.println(bodyAsString);}} }
http://www.pierceye.com/news/344757/

相关文章:

  • 网站做优化效果怎样iis怎么做网站空间
  • 重庆市建设局网站郑州网站建设哪一家好
  • wordpress指定分类广告金融网站排名优化
  • 美妆网站建设方案陕西网络公司网站建设
  • 北京地铁建设的网站深圳建网站兴田德润可信
  • 平台门户网站建设企业战略规划方案
  • 北京网站备案的地址住房和城乡建设部网站质保金
  • 网络营销自学网站腾讯云服务器cvm
  • 建设旅行网站策划书浙江省职业能力建设处网站
  • 网站项目建设的组织机构wordpress做登录
  • 定制杯子岳阳优化营商环境
  • 中学院新校区建设专题网站如何搭建网络教学平台
  • 网站开发课程设计体会房地产查询官网
  • 网站建设 响应式 北京出口外贸网站建设
  • 做网站图片格式做旅游网站的yi
  • 公司网站做二维码网址人防门电气图纸符号大全久久建筑网
  • 电商网站特点中国制造网怎么注册
  • 酒店网站建设便宜酒店设计
  • 东莞网站建设规范新版wordpress编辑
  • 自己的简历网站怎么做工业网页设计欣赏
  • 建设银行苏州官网招聘网站未明潮网站建设保密协议
  • 河南省住房和城乡建设厅查询网站叫外包公司做网站不肯给源代码的
  • 手机站模板权威发布是指什么
  • 青岛开发区做网站做网站的公司上海
  • 哈尔滨自助建站平台如何让网站火起来
  • 高州手机网站建设公司静态网页有哪些网站
  • 格兰仕网站开发方案表情包生成器在线制作
  • 便捷网站建设公司网站网页建设实训心得
  • 怎样做国外能看到的网站计算机大专生的出路
  • jsp网站开发四库全书怀化市住房与城乡建设厅网站