Commit 57b52486 authored by jiaorz's avatar jiaorz

支付宝转账

parent 749dc5b1
package com.xxfc.platform.universal.vo;
import lombok.Data;
@Data
public class FundPayVo {
//转账单号
private String outBizNo;
//转账账号
private String payeeAccount;
private String amount;
//转账方单号
private String payerShowName;
//转账备注
private String remark;
}
......@@ -21,6 +21,7 @@ import com.github.wxiaoqi.security.common.util.result.JsonResultUtil;
import com.xxfc.platform.universal.entity.Dictionary;
import com.xxfc.platform.universal.entity.OrderPay;
import com.xxfc.platform.universal.mapper.OrderPayMapper;
import com.xxfc.platform.universal.vo.FundPayVo;
import com.xxfc.platform.universal.vo.OrderPayVo;
import com.xxfc.platform.universal.weixin.api.WXPay;
import com.xxfc.platform.universal.weixin.util.HTTPUtils;
......@@ -375,16 +376,15 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
* @param alipayClient
* @throws AlipayApiException
*/
public void fundTrans(AlipayClient alipayClient) throws AlipayApiException{
public void fundTrans(AlipayClient alipayClient, FundPayVo fundPayVo) throws AlipayApiException{
AlipayFundTransToaccountTransferRequest request = new AlipayFundTransToaccountTransferRequest();
request.setBizContent("{" +
"\"out_biz_no\":\"3142321423432\"," +
"\"out_biz_no\":\"" + fundPayVo.getOutBizNo() + "\"," +
"\"payee_type\":\"ALIPAY_LOGONID\"," +
"\"payee_account\":\"abc@sina.com\"," +
"\"amount\":\"12.23\"," +
"\"payer_show_name\":\"上海交通卡退款\"," +
"\"payee_real_name\":\"张三\"," +
"\"remark\":\"转账备注\"" +
"\"payee_account\":\"" + fundPayVo.getPayeeAccount() + "\"," +
"\"amount\":\"" + fundPayVo.getAmount() + "\"," +
"\"payer_show_name\":\"" +fundPayVo.getPayerShowName()+ "\"," +
"\"remark\":\"" + fundPayVo.getRemark() + "\"" +
" }");
AlipayFundTransToaccountTransferResponse response = alipayClient.execute(request);
if(response.isSuccess()){
......@@ -509,6 +509,17 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
public static void main(String[] args) {
OrderPayBiz orderPayBiz = new OrderPayBiz();
orderPayBiz.alipayOrderRefund("20190806134440000001","2019080622001421530542309594", 3, "xxxx", "");
AlipayClient alipayClient = orderPayBiz.getAlipayClient();
FundPayVo fundPayVo = new FundPayVo();
fundPayVo.setAmount("0.50");
fundPayVo.setOutBizNo("201910101554");
fundPayVo.setPayeeAccount("15362885034");
fundPayVo.setPayerShowName("欣欣房车网络科技");
fundPayVo.setRemark("测试转账");
try {
orderPayBiz.fundTrans(alipayClient, fundPayVo);
} catch (AlipayApiException e) {
e.printStackTrace();
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment