| | |
| | | return ResultUtil.error("出现问题啦"); |
| | | } |
| | | } |
| | | // 属于平台的运营商 因为无需分账不冻结资金 |
| | | public ResultUtil confirm1(String smid,String code, String outTradeNo, String amount) { |
| | | AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do", |
| | | aliAppid, |
| | | appPrivateKey, |
| | | "json", |
| | | "GBK", |
| | | alipay_public_key, |
| | | "RSA2"); |
| | | AlipayTradeSettleConfirmRequest request = new AlipayTradeSettleConfirmRequest(); |
| | | request.setBizContent("{" + |
| | | " \"out_request_no\":\""+code+"\"," + |
| | | " \"trade_no\":\""+outTradeNo+"\"," + |
| | | " \"settle_info\":{" + |
| | | " \"settle_detail_infos\":[" + |
| | | " {" + |
| | | " \"trans_in_type\":\"defaultSettle\"," + |
| | | " \"settle_entity_id\":\""+smid+"\"," + |
| | | " \"settle_entity_type\":\"SecondMerchant\"," + |
| | | " \"amount\":"+amount+"," + |
| | | " }" + |
| | | " ]" + |
| | | " }," + |
| | | " \"extend_params\":{" + |
| | | " \"royalty_freeze\":\"false\"" + |
| | | " }" + |
| | | "}"); |
| | | AlipayTradeSettleConfirmResponse response = null; |
| | | try { |
| | | response = alipayClient.execute(request); |
| | | } catch (AlipayApiException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if(response.isSuccess()){ |
| | | System.out.println("调用成功"); |
| | | return ResultUtil.success(); |
| | | } else { |
| | | System.out.println("调用失败"); |
| | | return ResultUtil.error("出现问题啦"); |
| | | } |
| | | } |
| | | /** |
| | | * 支付宝支付 |
| | | */ |