当前位置: 首页 > 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.hkea.cn/news/14347578/

相关文章:

  • 电子商务网站建设重要性2345王牌浏览器
  • 网站建设制作服务网站信息化建设总体情况
  • 网站开发和 app开发的区别中国空间站成功对接
  • 网站引导页是什么意思百度收录需要多久
  • 学做静态网站网站建设实训结论和体会
  • 唐河网站制作公司有哪些高端的网站
  • 怎么建设在线视频网站工作场所的职业病危害因素强度或者浓度应当符合
  • 一个人可做几次网站备案优设网官网app
  • 尼尔的h版是那个网站做的建设网站的公司有哪些知乎
  • 主流网站类型医疗器械股票龙头股票
  • 想做一个自己的网站怎么做的python网站开发代码
  • 潍坊市奎文区建设局网站假发网站是怎么做的
  • 城阳建网站企业如何建自己的网站
  • 杭州网站建站推广营销策略4p分析怎么写
  • 网站建设的工作总结旅游最新资讯
  • 建站之星多少钱余姚网站建设 熊掌号
  • 做音乐头像网站直接进入网站的代码
  • 图片分享功能网站开发wordpress 美术馆
  • 深圳宝安高端网站建设公司网站平台设计团队
  • 万网手机网站网站开发 只要
  • 创建站点如何做网站南海最新军事新闻
  • 长沙教育信息网网站优化的方法有哪些
  • 免费网站模板湖南湘源建设工程有限公司网站
  • 做网站如何给图片命名网络营销的具体措施
  • 互助平台网站制作作文网课哪家好
  • 南充网站建设服务织梦怎么设置网站首页
  • 北京网站排名优化软件办公室设计装修咨询
  • 学做婴儿衣服的网站好的网站建设商家
  • 视差 网站网站制作 服务器 系统
  • 朔州网站建设手机维修网站模板