| | |
| | | import com.alipay.api.DefaultAlipayClient; |
| | | import com.alipay.api.domain.*; |
| | | import com.alipay.api.request.AlipayTradeOrderSettleRequest; |
| | | import com.alipay.api.request.AlipayTradeRoyaltyRelationBindRequest; |
| | | import com.alipay.api.response.AlipayTradeOrderSettleResponse; |
| | | import com.alipay.api.response.AlipayTradeQueryResponse; |
| | | import com.alipay.api.response.AlipayTradeRoyaltyRelationBindResponse; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | |
| | | |
| | | coursePackageListVo.setApplicantsNumber(integer); |
| | | coursePackageListVo.setPayType(coursePackage.getPayType()); |
| | | coursePackageListVo.setPlayPaiCoin(coursePackagePaymentConfig.getPlayPaiCoin()); |
| | | |
| | | |
| | | coursePackageListVo.setPayType(coursePackage.getPayType()); |
| | | |
| | | |
| | | if (coursePackagePaymentConfig!=null) { |
| | | coursePackageListVo.setPlayPaiCoin(coursePackagePaymentConfig.getPlayPaiCoin()); |
| | | } |
| | | //会员显示原价和会员价(最低)。非会员显示会员价和支付价(最低) |
| | | if(appUser.getIsVip() == 0){//非会员 |
| | | List<TCoursePackageDiscount> list2 = coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()) |
| | |
| | | if(one.getPayStatus() == 2){ |
| | | break; |
| | | } |
| | | ResultUtil<Map<String, String>> resultUtil = payMoneyUtil.queryALIOrder(code); |
| | | if(resultUtil.getCode() == 200 && one.getPayStatus() == 1){ |
| | | AlipayTradeQueryResponse alipayTradeQueryResponse = payMoneyUtil.queryALIOrder(code); |
| | | if( one.getPayStatus() == 1){ |
| | | /** |
| | | * WAIT_BUYER_PAY(交易创建,等待买家付款)、 |
| | | * TRADE_CLOSED(未付款交易超时关闭,或支付完成后全额退款)、 |
| | | * TRADE_SUCCESS(交易支付成功)、 |
| | | * TRADE_FINISHED(交易结束,不可退款) |
| | | */ |
| | | Map<String, String> data1 = resultUtil.getData(); |
| | | String s = data1.get("tradeStatus"); |
| | | String tradeNo = data1.get("tradeNo"); |
| | | String s = alipayTradeQueryResponse.getTradeStatus(); |
| | | |
| | | String tradeNo = alipayTradeQueryResponse.getTradeNo(); |
| | | if("TRADE_CLOSED".equals(s) || "TRADE_FINISHED".equals(s) || num == 10){ |
| | | for (TCoursePackagePayment coursePackagePayment : list) { |
| | | coursePackagePayment.setStatus(3); |
| | |
| | | for (TCoursePackagePayment coursePackagePayment : list) { |
| | | coursePackagePayment.setPayStatus(2); |
| | | coursePackagePayment.setOrderNumber(tradeNo); |
| | | coursePackagePayment.setAppUserId(null); |
| | | } |
| | | coursePackagePaymentService.updateBatchById(list); |
| | | System.out.println("===========到达支付"); |
| | |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private TCoursePackageService coursePackageService; |
| | | public void moneyOut(String outNum,String tradeNo) throws AlipayApiException { |
| | | AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do", aliAppid, appPrivateKey, "json", "UTF-8", alipay_public_key, "RSA2"); |
| | | AlipayTradeOrderSettleRequest request = new AlipayTradeOrderSettleRequest(); |
| | |
| | | model.setOutRequestNo(outNum); |
| | | model.setTradeNo(tradeNo); |
| | | List<RoyaltyDetailInfos> royaltyDetailInfos = new ArrayList<>(); |
| | | // |
| | | |
| | | AlipayTradeRoyaltyRelationBindRequest request1 = new AlipayTradeRoyaltyRelationBindRequest(); |
| | | |
| | | |
| | | RoyaltyDetailInfos royaltyDetailInfos1 = new RoyaltyDetailInfos(); |
| | | royaltyDetailInfos1.setTransOutType("userId"); |
| | | royaltyDetailInfos1.setTransOut("2021004105665036"); |
| | | royaltyDetailInfos1.setTransInType("loginName"); |
| | | royaltyDetailInfos1.setTransIn("18398968484"); |
| | | royaltyDetailInfos1.setAmount("0.1"); |
| | | request1.setBizContent("{" + |
| | | " \"receiver_list\":[" + |
| | | " {" + |
| | | " \"type\":\"loginName\"," + |
| | | " \"account\":\"19522115070\"," + |
| | | " \"name\":\"罗易胜\"," + |
| | | " \"memo\":\"分账给测试商户\"," + |
| | | " }" + |
| | | " ]," + |
| | | " \"out_request_no\":\""+tradeNo+"\"" + |
| | | "}"); |
| | | AlipayTradeRoyaltyRelationBindResponse response = alipayClient.execute(request1); |
| | | if(response.isSuccess()){ |
| | | System.out.println("绑定调用成功"); |
| | | } else { |
| | | System.out.println("调用失败"); |
| | | } |
| | | |
| | | |
| | | royaltyDetailInfos.add(royaltyDetailInfos1); |
| | | |
| | | // RoyaltyDetailInfos royaltyDetailInfos1 = new RoyaltyDetailInfos(); |
| | | // royaltyDetailInfos1.setTransOutType("loginName"); |
| | | // royaltyDetailInfos1.setTransOut("happysports@weparklife.com"); |
| | | // royaltyDetailInfos1.setTransInType("loginName"); |
| | | // royaltyDetailInfos1.setTransIn("19522115070"); |
| | | //// royaltyDetailInfos1.setAmount("0.01"); |
| | | // royaltyDetailInfos1.setAmountPercentage("100"); |
| | | |
| | | // royaltyDetailInfos.add(royaltyDetailInfos1); |
| | | |
| | | TCoursePackagePayment one = coursePackagePaymentService.getOne(new QueryWrapper<TCoursePackagePayment>().eq("code", outNum)); |
| | | TCoursePackage byId = coursePackageService.getById(one.getCoursePackageId()); |
| | | OperatorUser operatorUser = storeClient.queryByStoreId(byId.getStoreId()); |
| | | |
| | | |
| | | |
| | | // Integer paymentCompetitions = competitionsClient.queryByCode(outTradeNo); |
| | | // Integer siteBookings = siteClient.queryByCode(outTradeNo); |
| | | // List<Integer> stores = new ArrayList<>(); |
| | | // stores.add(coursePackagePayments); |
| | | // stores.add(paymentCompetitions); |
| | | // stores.add(siteBookings); |
| | | // OperatorUser operatorUser = siteClient.queryOperator(stores); |
| | | |
| | | |
| | | |
| | | |
| | | OpenApiRoyaltyDetailInfoPojo op = new OpenApiRoyaltyDetailInfoPojo(); |
| | | op.setTransOutType("loginName"); |
| | | op.setTransOut("happysports@weparklife.com"); |
| | | op.setTransInType("userId"); |
| | | op.setTransIn(operatorUser.getAlipayNum()); |
| | | op.setAmountPercentage(Long.valueOf(operatorUser.getAlipayProportion())); |
| | | |
| | | List<OpenApiRoyaltyDetailInfoPojo> ops = new ArrayList<>(); |
| | | ops.add(op); |
| | | model.setRoyaltyParameters(ops); |
| | | |
| | | request.setBizModel(model); |
| | | |
| | | |
| | | AlipayTradeOrderSettleResponse response = alipayClient.execute(request); |
| | | if(response.isSuccess()){ |
| | | AlipayTradeOrderSettleResponse response1 = alipayClient.execute(request); |
| | | if(response1.isSuccess()){ |
| | | System.out.println("调用成功"); |
| | | } else { |
| | | System.out.println("调用失败"); |
| | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 玩湃币支付课程 |
| | | * @param appUser |