java 阿里 app支付

本文详细介绍了使用Java进行阿里App支付的流程,包括引入支付jar包,通过App调用后台生成支付订单,阿里支付回调接口进行订单核对,以及App回调后台确认支付状态的步骤。核心在于确保支付订单的正确性和状态查询。
摘要由CSDN通过智能技术生成

首先 引用 阿里 支付 jar 包

<dependency>
			<groupId>alipay</groupId>
			<artifactId>alipay-sdk</artifactId>
			<version>java20170615110434</version>
		</dependency>

阿里支付逻辑是 先通过app 调用后台接口 生成支付订单 ,然后 阿里会回调 后台接口 核对支付订单
最后 app回调后台接口 确认有没有支付成功

首先 调用支付接口

 @RequestMapping(value = "/payApply", method = RequestMethod.POST)
	@ResponseBody
	public R payApply(@RequestParam() Map<String, String> allParams) {

		if (allParams.get("userId") == null) {
				return R.error(ResultStatusCode.MISSING_PARAMS);
			}
			if (allParams.get("userId").equalsIgnoreCase("")) {
				return R.error(ResultStatusCode.INVALID_PARAMS);
			}
			// 查询用户
			AppUser user = appLogin1Service.selectAppUserByPrimaryKey(Integer.parseInt(allParams.get("userId")));
			AppPayRecord record = new AppPayRecord();
			record.setPayUser(user.getId(
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值