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

大庆网站建设哪些平台可以做推广

大庆网站建设,哪些平台可以做推广,网站开发与维护是学什么,建设网站企业运营有道无术,术尚可求,有术无道,止于术。 文章目录前言1. 环境搭建2. 特约商户进件3. 统一下单总结前言 在上篇文档中,我们做好了接入前准备工作,接下来使用开源框架集成服务商相关API。 一个简单的支付系统完成支付流程…

有道无术,术尚可求,有术无道,止于术。

文章目录

    • 前言
    • 1. 环境搭建
    • 2. 特约商户进件
    • 3. 统一下单
    • 总结

前言

在上篇文档中,我们做好了接入前准备工作,接下来使用开源框架集成服务商相关API

一个简单的支付系统完成支付流程图如下所示:
在这里插入图片描述

1. 环境搭建

引入开源微信支付框架。

        <dependency><groupId>com.github.binarywang</groupId><artifactId>wx-java-pay-spring-boot-starter</artifactId><version>4.4.8.B</version></dependency>

配置上篇文档中我们获取到的参数、秘钥、证书

wx:pay:appId: wx7xxxxx # 服务商应用ID(公众号)mchId: xxxxx # 服务商收款账号apiV3Key: UDuLFDcmy5Eb6o0xxxxx # 服务商API V3密钥certSerialNo: 34345964330B66427E0D3D2882xxxxx # 服务商商户证书序列privateKeyPath: classpath:cert/apiclient_key.pem # 服务商apiclient_key.pem证书文件的绝对路径或者以classpath:开头的类路径privateCertPath: classpath:cert/apiclient_cert.pem # 服务商apiclient_cert.pem证书文件的绝对路径或者以classpath:开头的类路径

新建商户管理表、支付订单表等~

2. 特约商户进件

官方API文档

该支付系统,首先需要入驻子商户,可以集成微信提供的进件接口,这样自由度和管理更方便。

该框架的Applyment4SubService接口实现类已经集成微信特约商户进件API,我们只需要设置对应的请求参数对象即可,如果是直接集成微信SDK,还需要封装参数、解析响应比较麻烦。

public interface Applyment4SubService {/*** 提交申请单API*/WxPayApplymentCreateResult createApply(WxPayApplyment4SubCreateRequest request) throws WxPayException;/*** 通过业务申请编号查询申请状态** @param businessCode 业务申请编号*  1、只能由数字、字母或下划线组成,建议前缀为服务商商户号。*  2、服务商自定义的唯一编号。*  3、每个编号对应一个申请单,每个申请单审核通过后生成一个微信支付商户号。*  4、若申请单被驳回,可填写相同的“业务申请编号”,即可覆盖修改原申请单信息。*  示例值:1900013511_10000*/ApplymentStateQueryResult queryApplyStatusByBusinessCode(String businessCode) throws WxPayException;/*** 通过申请单号查询申请状态*/ApplymentStateQueryResult queryApplyStatusByApplymentId(String applymentId) throws WxPayException;/*** 根据特约子商户ID查询结算账户*/SettlementInfoResult querySettlementBySubMchid(String subMchid) throws WxPayException;/*** 修改结算帐号*/String modifySettlement(String subMchid, ModifySettlementRequest request) throws WxPayException;}

示例代码如下:

  @Operation(summary = "提交申请单")@GetMapping("/createApply")public R<String> createApply(@RequestParam(required = false) String applymentId) throws WxPayException {WxPayApplyment4SubCreateRequest request = new WxPayApplyment4SubCreateRequest();// 主体资料:主体类型、是否是金融机构、营业执照、登记证书、组织机构代码证、单位证明函照片、经营者/法人身份证件、最终受益人信息列表(UBO)、小微辅助证明材料(subjectType为小微商户时必填)WxPayApplyment4SubCreateRequest.SubjectInfo subjectInfo = WxPayApplyment4SubCreateRequest.SubjectInfo.builder().build().setFinanceInstitution(false).setBusinessLicenseInfo(null);// 省略.......request.setSubjectInfo(subjectInfo);// 补充材料WxPayApplyment4SubCreateRequest.AdditionInfo additionInfo=new WxPayApplyment4SubCreateRequest.AdditionInfo();additionInfo.setBusinessAdditionMsg("补充说明");additionInfo.setBusinessAdditionPics(null) ;// 补充材料additionInfo.setLegalPersonCommitment("法人开户承诺函");additionInfo.setLegalPersonVideo("法人开户意愿视频");request.setAdditionInfo(additionInfo);// 结算银行账户WxPayApplyment4SubCreateRequest.BankAccountInfo bankAccountInfo=new WxPayApplyment4SubCreateRequest.BankAccountInfo();bankAccountInfo.setBankAccountType(BankAccountTypeEnum.BANK_ACCOUNT_TYPE_CORPORATE); // 账户类型:对公银行账户bankAccountInfo.setAccountName("开户名称");  // 开户名称bankAccountInfo.setAccountBank("开户银行");bankAccountInfo.setBankAddressCode("开户银行省市编码");bankAccountInfo.setBankBranchId("开户银行联行号");bankAccountInfo.setBankName("开户银行全称(含支行)");bankAccountInfo.setAccountNumber("银行账号");request.setBankAccountInfo(bankAccountInfo);// 业务申请编号request.setBusinessCode("业务申请编号");// 经营资料request.setBusinessInfo(null); // 省略.......// 超级管理员信息request.setContactInfo(null);// 省略.......// 结算规则request.setSettlementInfo(null);// 省略.......// 调用微信APIApplyment4SubService applyment4SubService=new Applyment4SubServiceImpl(wxPayService);WxPayApplymentCreateResult apply = applyment4SubService.createApply(request);String applyMentId = apply.getApplymentId(); // 返回申请单IDreturn R.success(applyMentId);}@Operation(summary = "通过申请单号查询申请状态")@GetMapping("/queryApply")public R<ApplymentStateQueryResult> queryApply(@RequestParam(required = true) String applymentId) throws WxPayException {// 调用API 查询申请状态Applyment4SubService applyment4SubService=new Applyment4SubServiceImpl(wxPayService);ApplymentStateQueryResult result = applyment4SubService.queryApplyStatusByApplymentId(applymentId);return R.success(result);}

3. 统一下单

EcommerceService接口实现类中,集成了服务商下单API。多种支付方式时,使用同一个方法即可。

public interface EcommerceService {/*** <pre>*  服务商模式普通支付API(APP支付、JSAPI支付、H5支付、NATIVE支付).*  请求URL:https://api.mch.weixin.qq.com/v3/pay/partner/transactions/jsapi*  文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pages/transactions_sl.shtml*  </pre>** @param tradeType 支付方式* @param request   请求对象* @return 调起支付需要的参数 transactions result* @throws WxPayException the wx pay exception*/TransactionsResult partner(TradeTypeEnum tradeType, PartnerTransactionsRequest request) throws WxPayException;/*** <pre>* 普通查询订单API* 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/e_transactions/chapter3_5.shtml* </pre>** @param request 商户订单信息* @return 支付订单信息* @throws WxPayException the wx pay exception*/PartnerTransactionsResult queryPartnerTransactions(PartnerTransactionsQueryRequest request) throws WxPayException;/*** <pre>* 关闭普通订单API* 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/e_transactions/chapter3_6.shtml* </pre>** @param request 关闭普通订单请求* @throws WxPayException the wx pay exception* @return*/String closePartnerTransactions(PartnerTransactionsCloseRequest request) throws WxPayException;
}

示例代码如下:

    @Operation(summary = "统一下单/(V3)")@PostMapping("/ecommerceNative")public R<?> ecommerceNative(OrderEntity mchOrder,String subMchId) throws Exception {try {// 1. 创建请求对象PartnerTransactionsRequest orderRequest=new PartnerTransactionsRequest();// 2. 根据订单系统传过来的订单信息组装支付参数,创建支付订单orderRequest.setSpMchid(subMchId); // 子商户号orderRequest.setDescription("示例值:Image形象店-深圳腾大-QQ公仔"); // 商品描述:示例值:Image形象店-深圳腾大-QQ公仔PartnerTransactionsRequest.Amount amount = new PartnerTransactionsRequest.Amount();amount.setTotal(1); // 订单金额信息orderRequest.setAmount(amount);orderRequest.setOutTradeNo(mchOrder.getOutTradeNo()); // 商户订单号,商户系统内部订单号,只能是数字、大小写字母_-*且在同一个商户号下唯一orderRequest.setNotifyUrl("https://8da1-120-227-23-190.jp.ngrok.io/pay/wechat/notify"); // 通知地址// 3. 发起V3 服务商发起NATIVE支付EcommerceServiceImpl ecommerceService=new EcommerceServiceImpl(wxPayService);TransactionsResult result = ecommerceService.partner(com.github.binarywang.wxpay.bean.ecommerce.enums.TradeTypeEnum.NATIVE, orderRequest);log.info("NATIVE支付成功,返回二维码URL" + result.getCodeUrl());// 4. 省略后续操作return R.success(result);} catch (Exception e) {log.error("微信支付失败!,原因:{}", e.getMessage());e.printStackTrace();return R.fail();}}

总结

weixin-java-pay框架中,几乎所有的微信API都帮我们集成好了,我们只需要设置对应的参数即可,甚至每个方法对应的官网API文档也贴上去了,好像实在也没什么可讲的~
在这里插入图片描述


文章转载自:
http://unsightly.bnpn.cn
http://toiler.bnpn.cn
http://landman.bnpn.cn
http://gawain.bnpn.cn
http://semainier.bnpn.cn
http://varier.bnpn.cn
http://solve.bnpn.cn
http://nickelous.bnpn.cn
http://pontoneer.bnpn.cn
http://recommendation.bnpn.cn
http://persulphate.bnpn.cn
http://outrecuidance.bnpn.cn
http://burman.bnpn.cn
http://terne.bnpn.cn
http://december.bnpn.cn
http://mutably.bnpn.cn
http://odontoglossum.bnpn.cn
http://exheredation.bnpn.cn
http://chincapin.bnpn.cn
http://akin.bnpn.cn
http://victoriously.bnpn.cn
http://katangese.bnpn.cn
http://pinnatiped.bnpn.cn
http://bloodstock.bnpn.cn
http://seawant.bnpn.cn
http://hydrogenization.bnpn.cn
http://phlegm.bnpn.cn
http://strutter.bnpn.cn
http://theseus.bnpn.cn
http://hotchpot.bnpn.cn
http://rhythmicity.bnpn.cn
http://turnpike.bnpn.cn
http://culturette.bnpn.cn
http://reclassify.bnpn.cn
http://pindling.bnpn.cn
http://rondavel.bnpn.cn
http://impennate.bnpn.cn
http://shrewmouse.bnpn.cn
http://syneresis.bnpn.cn
http://waterishlogged.bnpn.cn
http://dialogue.bnpn.cn
http://tuum.bnpn.cn
http://pebbly.bnpn.cn
http://oaklet.bnpn.cn
http://agloat.bnpn.cn
http://towable.bnpn.cn
http://keelung.bnpn.cn
http://precautious.bnpn.cn
http://janizary.bnpn.cn
http://slidden.bnpn.cn
http://webernish.bnpn.cn
http://childbirth.bnpn.cn
http://prawn.bnpn.cn
http://undertrial.bnpn.cn
http://sakellarides.bnpn.cn
http://rasophore.bnpn.cn
http://emasculate.bnpn.cn
http://trustee.bnpn.cn
http://reck.bnpn.cn
http://axiological.bnpn.cn
http://bactrian.bnpn.cn
http://ungues.bnpn.cn
http://tool.bnpn.cn
http://eusocial.bnpn.cn
http://nif.bnpn.cn
http://sergeancy.bnpn.cn
http://scut.bnpn.cn
http://importation.bnpn.cn
http://trepid.bnpn.cn
http://batik.bnpn.cn
http://electrotypy.bnpn.cn
http://duniewassal.bnpn.cn
http://workwoman.bnpn.cn
http://oncost.bnpn.cn
http://uraemic.bnpn.cn
http://multivalence.bnpn.cn
http://precipitancy.bnpn.cn
http://trilithon.bnpn.cn
http://cubbyhouse.bnpn.cn
http://bebeerine.bnpn.cn
http://flexion.bnpn.cn
http://scalloppine.bnpn.cn
http://seasonable.bnpn.cn
http://lawyer.bnpn.cn
http://modistae.bnpn.cn
http://scolopidium.bnpn.cn
http://auris.bnpn.cn
http://quietist.bnpn.cn
http://hyperemization.bnpn.cn
http://vyborg.bnpn.cn
http://diluvial.bnpn.cn
http://orchidectomy.bnpn.cn
http://truer.bnpn.cn
http://horsecloth.bnpn.cn
http://bald.bnpn.cn
http://tetranitromethane.bnpn.cn
http://sublimely.bnpn.cn
http://pneumatic.bnpn.cn
http://interdependence.bnpn.cn
http://peiping.bnpn.cn
http://www.dt0577.cn/news/113706.html

相关文章:

  • wordpress无法发表文章北京seo培训
  • 做下一个盗版小说网站网络营销工资一般多少
  • 品牌网站建设专家网页制作三大软件
  • 阿里巴巴网站谁做的建个网站需要多少钱?
  • 做网站的客户怎么查搜索关键词排名
  • wordpress 滑块插件淘宝seo搜索优化工具
  • 毕业论文 网站建设解释seo网站推广
  • 个人 网站可以做导航吗黑帽seo优化软件
  • 浙江同凯建设深圳公司手机系统优化软件哪个好
  • wordpress电影站数据下载河南seo网站多少钱
  • 医院网站优化seo是什么工作内容
  • 网站banner代码肇庆网站搜索排名
  • 个人做的小网站需要备案拉新推广一手接单平台
  • 如何自己做摄影网站网络推广怎么做?
  • c 做网站用什么框架安徽做网站公司哪家好
  • 门头沟做网站公司企业网页设计与推广
  • 专门做摩托车的网站网络营销教材电子版
  • 做网站15年朝阳区搜索优化seosem
  • 专门写文章的网站线上营销平台有哪些
  • wordpress输入网址采集单个网页大冶seo网站优化排名推荐
  • 2015做那些网站致富排行榜
  • 苏州建站公司优搜苏州聚尚网络网络推广深圳有效渠道
  • 梅州做网站wlwl营销策划书模板范文
  • 为某网站做一则广告语淘宝关键词排名怎么查
  • 如何做网站栏目优化关键词的方法正确的是
  • 齐齐哈尔哪里做网站能打开的a站
  • 大良网站建设市场seo专员简历
  • 卖水果网站建设的策划书廊坊百度快照优化排名
  • 网站建设网站的好处比较成功的网络营销案例
  • 网站建设流程资讯优化营商环境个人心得体会