本篇主要是正对Java对接支付宝的常用功能,需要开通个人的沙箱环境和内网穿透(我用了阿里云服务器)。

集成前提:开发者在集成和开发前需要了解一下常用的接入方式和架构建议,如下图所示:

1、登录网页版的个人支付宝

https://auth.alipay.com/login/ant_sso_index.htm

2、进入研发服务进入沙箱环境

3、通过开发平台去配置秘钥配置

https://opendocs.alipay.com/open/200/105311

4、配置yml文件和pom

alipay:appId: 2016110300790369 #在支付宝创建的应用的idnotifyUrl: http://127.0.0.1/api/pay/notify   #支付宝会悄悄的给我们发送一个请求,告诉我们支付成功的信息returnUrl: http://127.0.0.1/api/page/success  #同步通知,支付成功,一般跳转到成功页 http://127.0.0.1/api/page/success?charset=utf-8&out_trade_no=6837ec3c-11b5-4290-b423-54515caf2fa5&method=alipay.trade.page.pay.return&total_amount=93.80&sign=c7jnEO8n6O%2BZXpk7dF3zYtIJb9lTMIM0%2B%2FmLm2JjPgdH5vEib7wp49%2F2%2FMB05YyKOxk6PYI5B2W0k%2FdHi%2Biyk083ZKcwL3a4ToXusG%2BZji66PaYe3tIe72N%2FgzpKcxF9lwF2%2FR0%2FbPhTDJpqem2v9Ej0d1yszLVeBQzU8IuQRglM4U6ev5gt%2Bslv8BViBkXWuy2OM6pA7k6CFptHWwXBYsdg9Ik%2BAIh0LD3rZobpzyn1w7y71Bu2Nj8XHev2gzmkxjyRSuERZJVVBSNNqtGY6xxlNqzh9L5k%2B4FcwEqNv5UPgWlCnvT9BI%2FB3cCUcAUTOxcdLwi1W8gTaqeI3rStyw%3D%3D&trade_no=2020122122001400320501115075&auth_app_id=2016110300790369&version=1.0&app_id=2016110300790369&sign_type=RSA2&seller_id=2088102181741856&timestamp=2020-12-21+11%3A53%3A05signType: RSA2 #签名方式charset: utf-8 #字符编码格式gatewayUrl: https://openapi.alipaydev.com/gateway.do  #沙箱环境timeoutExpress: 30mformat: jsonmerchantPrivateKey: # 商户私钥alipayPublicKey:  #支付宝公钥
        <!-- 支付宝--><dependency><groupId>com.alipay.sdk</groupId><artifactId>alipay-sdk-java</artifactId><version>4.9.28.ALL</version></dependency><dependency><groupId>org.jdom</groupId><artifactId>jdom2</artifactId><version>2.0.6</version></dependency>

5、包含网页支付(已测试)、APP支付、提现、退款、回调接口

5.1、请求入口代码

package com.example.mybaties.controller;import com.example.mybaties.result.BaseResponse;
import com.example.mybaties.result.ResultGenerator;
import com.example.mybaties.service.AliPayService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;/*** @description: 支付宝下单支付* @author: lst* @date: 2020-12-01 16:58*/
@RestController
@RequestMapping("/pay")
@Api(value = "AliPayController", tags = "支付宝下单支付")
public class AliPayController {@Autowiredprivate AliPayService aliPayService;/*** @Description 支付宝下单支付* @author lst* @date 2020-12-1 17:27* @return com.example.mybaties.result.BaseResponse*/@PostMapping(value = "/place-order", produces = "application/json; charset=utf-8")@ApiOperation(value = "支付宝下单支付", notes = "支付宝下单支付", produces = "application/json")public BaseResponse placeOrder() {return ResultGenerator.genSuccessResult(aliPayService.placeOrder());}/*** @Description 网页版支付宝下单支付* @author lst* @date 2020-12-2 14:16* @return com.example.mybaties.result.BaseResponse*/@PostMapping(value = "/alipay-page", produces = "application/json; charset=utf-8")@ApiOperation(value = "网页版支付宝下单支付", notes = "网页版支付宝下单支付", produces = "application/json")public void alipayPage(HttpServletResponse response) {aliPayService.alipayPage(response);}/*** @Description  支付宝提现* @author lst* @date 2020-12-2 17:03* @param response*/@PostMapping(value = "/alipay-withdraw", produces = "application/json; charset=utf-8")@ApiOperation(value = "支付宝提现", notes = "支付宝提现", produces = "application/json")public void withdraw(HttpServletResponse response) {aliPayService.withdraw(response);}/*** @Description  支付宝退款* @author lst* @date 2020-12-21 14:19* @param response*/@PostMapping(value = "/alipay-refund", produces = "application/json; charset=utf-8")@ApiOperation(value = "支付宝退款", notes = "支付宝退款", produces = "application/json")public void refund(HttpServletResponse response) {aliPayService.refund(response);}/*** @Description 支付宝支付成功后,回调该接口* @author lst* @date 2020-12-1 17:27* @param request* @param response* @return java.lang.String*/@RequestMapping(value="/notify",method={RequestMethod.POST,RequestMethod.GET})@ApiOperation(value = "支付宝支付成功后,回调该接口", notes = "支付宝支付成功后,回调该接口", produces = "application/json")public String notify(HttpServletRequest request, HttpServletResponse response) {return aliPayService.notifyData(request,response);}}

5.2、实现层代码

package com.example.mybaties.service.impl;import com.example.mybaties.form.AlipayBean;
import com.example.mybaties.form.AlipayRefundForm;
import com.example.mybaties.form.WithdrawBean;
import com.example.mybaties.service.AliPayService;
import com.example.mybaties.utils.AlipayUtil;
import com.example.mybaties.utils.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.UUID;/*** @description: 支付宝下单支付* @author: lst* @date: 2020-12-01 17:01*/
@Service
@Slf4j
public class AliPayServiceImpl implements AliPayService {@Autowiredprivate AlipayUtil alipayUtil;/*** @Description 支付宝下单支付* @author lst* @date 2020-12-1 17:27* @return java.lang.String*/@Overridepublic String placeOrder() {String body = alipayUtil.alipay();return body;}/*** @Description 支付宝支付成功后,回调该接口* @author lst* @date 2020-12-1 17:27* @param request* @param response* @return java.lang.String*/@Overridepublic String notifyData(HttpServletRequest request, HttpServletResponse response) {return alipayUtil.notifyData(request,response);}/*** @Description 网页版支付宝下单支付* @author lst* @date 2020-12-1 17:27* @param response* @return java.lang.String*/@Overridepublic void alipayPage(HttpServletResponse response) {AlipayBean alipayBean = new AlipayBean();//商户订单号,商户网站订单系统中唯一订单号,必填alipayBean.setOut_trade_no(UUID.randomUUID().toString());//付款金额,必填alipayBean.setTotal_amount("93.8");//订单名称,必填alipayBean.setSubject("商品名称:网页版支付测试Java");//商品描述,可空alipayBean.setBody("商品信息");String payResult = alipayUtil.alipayPage(alipayBean);response.setContentType("text/html;charset=utf-8");try {response.getWriter().write("<html>");response.getWriter().write("<head>");response.getWriter().write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">");response.getWriter().write("</head>");response.getWriter().write("<body>");response.getWriter().write(payResult);response.getWriter().write("</body>");response.getWriter().write("</html>");response.getWriter().flush();response.getWriter().close();} catch (IOException e) {e.printStackTrace();}}/*** @Description  支付宝提现* @author lst* @date 2020-12-2 17:03* @param response* @return void*/@Overridepublic void withdraw(HttpServletResponse response) {WithdrawBean withdrawBean = new WithdrawBean();String payResult = alipayUtil.withdraw(withdrawBean);response.setContentType("text/html;charset=utf-8");try {response.getWriter().write("<html>");response.getWriter().write("<head>");response.getWriter().write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">");response.getWriter().write("<title>提现</title>");response.getWriter().write("</head>");response.getWriter().write("<body>");if("success".equals(payResult)){response.getWriter().write(" <div  style=\"color: red;font-size: 50px;margin: auto;\">恭喜提现成功</div>");}else{response.getWriter().write(" <div  style=\"color: red;font-size: 50px;margin: auto;\">提现失败</div>");}response.getWriter().write("</body>");response.getWriter().write("</html>");response.getWriter().flush();response.getWriter().close();} catch (IOException e) {e.printStackTrace();}}@Overridepublic void refund(HttpServletResponse response) {AlipayRefundForm alipayRefundForm = new AlipayRefundForm();String payResult = alipayUtil.alipayRefund(alipayRefundForm);response.setContentType("text/html;charset=utf-8");try {response.getWriter().write("<html>");response.getWriter().write("<head>");response.getWriter().write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">");response.getWriter().write("<title>退款</title>");response.getWriter().write("</head>");response.getWriter().write("<body>");if(StringUtil.isNotEmpty(payResult)){response.getWriter().write(" <div  style=\"color: red;font-size: 50px;margin: auto;\">恭喜退款成功</div>");}else{response.getWriter().write(" <div  style=\"color: red;font-size: 50px;margin: auto;\">退款失败</div>");}response.getWriter().write("</body>");response.getWriter().write("</html>");response.getWriter().flush();response.getWriter().close();} catch (IOException e) {e.printStackTrace();}}
}

5.3、支付工具类

package com.example.mybaties.utils;import com.alibaba.fastjson.JSONObject;
import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.domain.AlipayTradeAppPayModel;
import com.alipay.api.domain.AlipayTradeRefundModel;
import com.alipay.api.internal.util.AlipaySignature;
import com.alipay.api.request.AlipayFundTransToaccountTransferRequest;
import com.alipay.api.request.AlipayTradeAppPayRequest;
import com.alipay.api.request.AlipayTradePagePayRequest;
import com.alipay.api.request.AlipayTradeRefundRequest;
import com.alipay.api.response.AlipayFundTransToaccountTransferResponse;
import com.alipay.api.response.AlipayTradeAppPayResponse;
import com.alipay.api.response.AlipayTradeRefundResponse;
import com.example.mybaties.constants.AlipayProperties;
import com.example.mybaties.exceptionhandler.BaseException;
import com.example.mybaties.exceptionhandler.BaseExceptionEnum;
import com.example.mybaties.form.AlipayBean;
import com.example.mybaties.form.AlipayRefundForm;
import com.example.mybaties.form.WithdrawBean;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.UUID;/*** @description: 支付宝支付工具* @author: lst* @date: 2020-12-01 15:57* 支付宝管理:https://open.alipay.com/platform/developerIndex.htm* 支付宝对接文档:https://opendocs.alipay.com/open/54/106370*/
@Slf4j
@Component
public class AlipayUtil {@Autowiredprivate  AlipayProperties alipayProperties;/*** @Description  APP支付宝下单支付* @author lst* @date 2020-12-1 17:28* @param* @return java.lang.String*/public String alipay(){//TODO 1、实例化客户端AlipayClient  alipayClient = new DefaultAlipayClient(alipayProperties.getGatewayUrl(),alipayProperties.getAppId(), alipayProperties.getMerchantPrivateKey(), alipayProperties.getFormat(),alipayProperties.getCharset(), alipayProperties.getAlipayPublicKey(), alipayProperties.getSignType());//TODO 2、实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.trade.app.payAlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest();//TODO 3、SDK已经封装掉了公共参数,这里只需要传入业务参数。以下方法为sdk的model入参方式(model和biz_content同时存在的情况下取biz_content)。AlipayTradeAppPayModel model = new AlipayTradeAppPayModel();//商品信息model.setBody("商品信息");//商品名称model.setSubject("商品名称:App支付测试Java");//商品订单号(自动生成)model.setOutTradeNo(UUID.randomUUID().toString());//交易超时时间model.setTimeoutExpress(alipayProperties.getTimeoutExpress());//支付金额model.setTotalAmount("0.01");//销售产品码model.setProductCode("QUICK_MSECURITY_PAY");model.setTimeExpire("2020-12-21 17:52:00");request.setBizModel(model);//回调地址request.setNotifyUrl(alipayProperties.getNotifyUrl());log.info("请求数据:{},回调地址:{}",request.getBizModel(),request.getNotifyUrl());//这里和普通的接口调用不同,使用的是sdkExecuteAlipayTradeAppPayResponse response = null;try {response = alipayClient.sdkExecute(request);//就是orderString 可以直接给客户端请求,无需再做处理。log.info("支付宝返回数据:{}",response.getBody());} catch (AlipayApiException e) {e.printStackTrace();throw new BaseException(BaseExceptionEnum.ALIPAY_MSG_ERROR);}return response.getBody();}/*** @Description APP支付宝支付成功后,回调该接口* @author lst* @date 2020-12-1 17:29* @param request* @param response* @return java.lang.String*/public String notifyData(HttpServletRequest request, HttpServletResponse response){Map<String, String> params = new HashMap<String, String>();//TODO 1、从支付宝回调的request域中取值Map<String, String[]> requestParams = request.getParameterMap();for (Iterator<String> iter = requestParams.keySet().iterator(); iter.hasNext(); ) {String name = iter.next();String[] values = requestParams.get(name);String valueStr = "";for (int i = 0; i < values.length; i++) {valueStr = (i == values.length - 1) ? valueStr + values[i]: valueStr + values[i] + ",";}//乱码解决,这段代码在出现乱码时使用。//valueStr = new String(valueStr.getBytes("ISO-8859-1"), "utf-8");params.put(name, valueStr);}for (Map.Entry<String, String> entry : params.entrySet()) {log.info("key:{}, value:{}",entry.getKey(),entry.getValue());}//TODO 2.封装必须参数  商户订单号   订单内容    交易状态(TRADE_SUCCESS)String outTradeNo = request.getParameter("out_trade_no");String orderType = request.getParameter("body");String tradeStatus = request.getParameter("trade_status");log.info("商户订单号:{},订单内容:{},交易状态:{}",outTradeNo,orderType,tradeStatus);//TODO 3.签名验证(对支付宝返回的数据验证,确定是支付宝返回的)try {boolean signVerified = AlipaySignature.rsaCheckV1(params, alipayProperties.getAlipayPublicKey(), alipayProperties.getCharset(), alipayProperties.getSignType());if (signVerified) {//验签成功log.info("*******验签成功******");//TODO 业务处理逻辑return "success";} else {// 验签失败log.info("*******验签失败******");return "fail";}} catch (AlipayApiException e) {e.printStackTrace();return "fail";}}/*** @Description 网页版支付宝下单支付* @author lst* @date 2020-12-2 14:11* @param alipayBean* @return java.lang.String*/public String alipayPage(AlipayBean alipayBean){//TODO 1、实例化客户端AlipayClient  alipayClient = new DefaultAlipayClient(alipayProperties.getGatewayUrl(),alipayProperties.getAppId(), alipayProperties.getMerchantPrivateKey(), alipayProperties.getFormat(),alipayProperties.getCharset(), alipayProperties.getAlipayPublicKey(), alipayProperties.getSignType());//TODO 2、实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.trade.app.pay//2、创建一个支付请求 //设置请求参数AlipayTradePagePayRequest alipayRequest = new AlipayTradePagePayRequest();alipayRequest.setReturnUrl(alipayProperties.getReturnUrl());alipayRequest.setNotifyUrl(alipayProperties.getNotifyUrl());alipayBean.setTimeout_express(alipayProperties.getTimeoutExpress());//绝对超时时间,格式为yyyy-MM-dd HH:mm:ss   2016-12-31 10:05:01//alipayBean.setTime_expire("2020-12-21 17:52:00");alipayRequest.setBizContent(JSONObject.toJSONString(alipayBean));String result = "";try {result = alipayClient.pageExecute(alipayRequest).getBody();//会收到支付宝的响应,响应的是一个页面,只要浏览器显示这个页面,就会自动来到支付宝的收银台页面log.info("支付宝的响应:{}",result);} catch (AlipayApiException e) {e.printStackTrace();throw new BaseException(BaseExceptionEnum.ALIPAY_MSG_ERROR);}return result;}/*** @Description 支付宝提现* @author lst* @date 2020-12-2 17:04* @param withdrawBean* @return java.lang.String*/public String withdraw(WithdrawBean withdrawBean){//提现//TODO 1、实例化客户端AlipayClient  alipayClient = new DefaultAlipayClient(alipayProperties.getGatewayUrl(),alipayProperties.getAppId(), alipayProperties.getMerchantPrivateKey(), alipayProperties.getFormat(),alipayProperties.getCharset(), alipayProperties.getAlipayPublicKey(), alipayProperties.getSignType());//TODO 2、实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.trade.app.payAlipayFundTransToaccountTransferRequest alipayRequest = new AlipayFundTransToaccountTransferRequest();/* "\"out_biz_no\":\"3142321423432\"," +"\"payee_type\":\"ALIPAY_LOGONID\"," +"\"payee_account\":\"abc@sina.com\"," +"\"amount\":\"12.23\"," +"\"payer_show_name\":\"上海交通卡退款\"," +"\"payee_real_name\":\"张三\"," +"\"remark\":\"转账备注\"" +"  }"*///商户转账唯一订单号withdrawBean.setOut_biz_no(DateUtil.getDateTime14());withdrawBean.setPayee_type("ALIPAY_LOGONID");withdrawBean.setPayee_account("ycknrb8604@sandbox.com");withdrawBean.setPayee_real_name("ycknrb8604");withdrawBean.setAmount("22.4");withdrawBean.setPayer_show_name("");withdrawBean.setRemark("推推提现");String jsonData = JSONObject.toJSONString(withdrawBean);log.info("支付宝提现请求数据:{}",jsonData);alipayRequest.setBizContent(jsonData);//TODO 3、转账/提现try {AlipayFundTransToaccountTransferResponse response = alipayClient.execute(alipayRequest);log.info("支付宝的响应:{}",JSONObject.toJSON(response));if(response.isSuccess()){//提现成功return "success";}else {throw new BaseException(BaseExceptionEnum.ALIPAY_WITHDRAW_ERROR);}} catch (AlipayApiException e) {e.printStackTrace();throw new BaseException(BaseExceptionEnum.ALIPAY_WITHDRAW_ERROR);}}/*** @Description 支付宝退款* @author lst* @date 2020-12-21 14:12* @param alipayRefundForm* @return java.lang.String*/public String alipayRefund(AlipayRefundForm alipayRefundForm){//TODO 1、实例化客户端AlipayClient  alipayClient = new DefaultAlipayClient(alipayProperties.getGatewayUrl(),alipayProperties.getAppId(), alipayProperties.getMerchantPrivateKey(), alipayProperties.getFormat(),alipayProperties.getCharset(), alipayProperties.getAlipayPublicKey(), alipayProperties.getSignType());AlipayTradeRefundRequest aliPayRequest = new AlipayTradeRefundRequest();AlipayTradeRefundModel model = new AlipayTradeRefundModel();//订单支付时传入的商户订单号,不能和 trade_no同时为空model.setOutTradeNo("b87267c8-435b-449b-9ebb-e12efe06a1dd");//支付宝交易号,和商户订单号不能同时为空model.setTradeNo("2020122122001400320501115255");//需要退款的金额,该金额不能大于订单金额,单位为元,支持两位小数model.setRefundAmount("93.80");//退款的原因说明model.setRefundReason("正常退款");//标识一次退款请求,同一笔交易多次退款需要保证唯一,如需部分退款,则此参数必传。model.setOutRequestNo(DateUtil.getDateTime14());aliPayRequest.setBizModel(model);try {AlipayTradeRefundResponse aliPayResponse = alipayClient.execute(aliPayRequest);log.debug("aliPayResponse:{}", aliPayResponse);if (!"10000".equals(aliPayResponse.getCode())) {log.info("支付宝退款失败,支付宝交易号:{},状态码:{}", "2020122122001400320501115254", aliPayResponse.getCode());throw new BaseException(aliPayResponse.getSubMsg());}return aliPayResponse.getMsg();} catch (AlipayApiException e) {e.printStackTrace();throw new BaseException("退款失败");}}
}

5.4、支付宝支付配置信息类

package com.example.mybaties.constants;import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;/*** @description: 支付宝支付配置信息* @author: lst* @date: 2020-12-01 15:50*/
@Component
@ConfigurationProperties(prefix = "alipay")
@Data
public class AlipayProperties {/*** 在支付宝创建的应用的id*/private String appId;/*** 商户私钥,您的PKCS8格式RSA2私钥*/private String merchantPrivateKey;/*** 支付宝公钥,查看地址:https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。*/private String alipayPublicKey;/*** 服务器[异步通知]页面路径  需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问* 支付宝会悄悄的给我们发送一个请求,告诉我们支付成功的信息*/private String notifyUrl;/*** 页面跳转同步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问* 同步通知,支付成功,一般跳转到成功页*/private String returnUrl;/*** 签名方式*/private String signType;/*** 字符编码格式*/private String charset;/*** 支付宝网关; https://openapi.alipaydev.com/gateway.do  正式环境 https://openapi.alipay.com/gateway.do*/private String gatewayUrl;/*** 该笔订单允许的最晚付款时间,逾期将关闭交易*/private String timeoutExpress;/*** 请求的格式:json*/private String format;}

5.5、网页支付代码orderPage.html、下单成功代码success.html

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>网页下单</title><script src="/static/js/jquery.min.js"></script><script type="text/javascript">function placeOrder() {var url = "/pay/alipay-page";$.ajax({url: url,type: 'POST',dataType: 'JSON',success: function (data) {console.log(data);$('#orderPage').html(data)},error: function (msg) {}});}</script></head><body><div><!-- <span onclick="placeOrder()" id="orderPage" style="color: rgba(20,146,255,1);font-size: 50px;margin: auto;">网页下单</span>--><form action="/api/pay/alipay-page" method="post"><input type="submit"></form></div></body>
</html>
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>成功页面</title><script src="/static/js/jquery.min.js"></script><script type="text/javascript"></script></head><body><div><div  style="color: red;font-size: 50px;margin: auto;">恭喜下单成功</div></div></body>
</html>

6、打入服务器进行测试

输入网址点击‘提交’ 按钮,后端已经默认支付数据,我用沙箱APP支付成功后可以跳转到成功页面。

手机端也可以测试

HwVideoEditor

想要源码的小伙伴可以下方留言。

Java对接支付宝的支付、退款、提现相关推荐

  1. java对接支付宝实现支付功能

    ** java对接支付宝实现支付功能 ** Controller /*** 支付功能* @return*/ @RequestMapping("/test") public Mode ...

  2. JAVA对接支付宝支付(超详细,一看就懂)

    Java对接支付宝支付 更多内容 冷文博客: 传送门 引入 为什么要发这篇帖子呢?原因很简单,就是因为在一个稍稍正规一点的应用上都会有支付这个环节,我们日常的在线支付如今包括支付宝,微信钱包,QQ钱包 ...

  3. java SpringBoot 对接支付宝 APP支付 证书模式及非证书模式

    一. 添加maven依赖 sdk <dependency><groupId>com.alipay.sdk</groupId><artifactId>al ...

  4. java对接支付宝支付

    java对接支付宝支付演示 现在有不少的项目都需要对接支付,这里主要是进行讲解对接支付宝H5支付 废话不多说 上代码 引入支付宝官方的sdk <!-- https://mvnrepository ...

  5. 关于JAVA对接支付宝开发文档错误总结

    如果在对接支付宝官方文档时出现该错误,解决的方法是:检查是否与支付宝进行签约,如果签约后出现以下错误: 解决方法是检查支付宝的公钥与私钥是否与商户id对应,对于java对接支付宝,生成的密钥密钥长度为 ...

  6. java 对接易宝支付完成真实网上支付

    java 对接易宝支付完成真实网上支付 目录结构 index.jsp界面 跳转界面 支付界面 确认界面 支付成功界面 回调界面 源码 学习资源推荐 https://blog.csdn.net/qq_4 ...

  7. java对接支付宝微信银联_JavaWEB后端支付银联,支付宝,微信对接

    JavaWEB后端支付银联,支付宝,微信对接 标签(空格分隔): java 项目概述 最近项目需要后端打通支付,所以对接部分做成了一个小模块. 先说下项目要求: 后端要对接银联无跳转Token支付,支 ...

  8. 【超详细,全流程】java对接支付宝支付

    支付流程 一.对接前的准备 1.1创建应用,获取参数:APPID(使用沙箱环境可跳过) 1.1.1添加产品 1.1.2配置密钥,获取第二个参数:商户的私钥 1.1.3支付宝网关 1.1.4生成参数密钥 ...

  9. java 对接支付宝支付

    2019独角兽企业重金招聘Python工程师标准>>> 对接支付宝支付的前提: 1,商户开通支付能力 登录蚂蚁金服 开放平台:https://open.alipay.com/plat ...

  10. java对接支付宝微信银联_经典设计模式之策略模式【如何重构聚合支付平台,对接【支付宝,微信,银联支付】】(示例代码)...

    写在前面:设计模式源于生活,而又高于生活! 为什么要使用设计模式重构代码 使用设计模式可以重构整体架构代码.提高代码复用性.扩展性.减少代码冗余问题. Java高级工程师装逼的技能! 什么是策略模式 ...

最新文章

  1. [ActionScript 3.0] AS向php发送二进制数据方法之——在URLRequest中构造HTTP协议发送数据...
  2. 再谈MySQL JSON数据类型
  3. URAL 1152. False Mirrors(DP)
  4. boost::bad_function_call用法的测试程序
  5. 前端vue框架的跨域处理方法
  6. 2021牛客暑期多校训练营1 H-Hash Function(数学+FFT)
  7. LeetCode 1749. 任意子数组和的绝对值的最大值(前缀和)
  8. 将张量用图像表示出来,取张量的某几维度然后展示为图像
  9. 怎样查看MySQL是否区分大小写
  10. matlab练习程序(图像放大/缩小,放大没有进行插值操作)
  11. 硅谷华人创业公司Trifo获1100万美元融资,将发布智能扫地机器人
  12. 《生物信息学》——李霞;;生信概念
  13. C# Chat曲线图,在发布之后出现错误 Invalid temp directory in chart handler configuration c:\TempImageFiles\...
  14. VsCode 配置java环境(详细教程)
  15. protel99se学习笔记
  16. 笔记本电脑桌面计算机图标不见了怎么办,桌面图标不见了怎么办,教您电脑桌面图标不见了怎么办...
  17. 教你快速填充Excel中不同的数据,别再一个个向下拉动啦
  18. if 条件结构与switch条件选择结构
  19. c语言中switch0,C语言switch0.ppt
  20. oracle library is not loaded解决方法

热门文章

  1. 【数学和算法】加权平均法
  2. (拓扑排序+并查集)HDU - 1811 Rank of Tetris
  3. 各种音视频编解码学习详解之 编解码学习笔记(九):QuickTime系列
  4. Android获取缓存大小和清除缓存功能实现
  5. postman中文汉化版
  6. Spacy 常见词性标注
  7. 信息检索1.3.学术搜索引擎--谷歌学术搜索引擎
  8. PDF转成图片后不清晰怎么办呢?
  9. 饼图出现超过100%的比例——基础积累
  10. 不需要 Root,也能用上强大的 Xposed 框架:VirtualXposed