com.alipay.api.domain.AlipayTradeRefundModel Java Examples

The following examples show how to use com.alipay.api.domain.AlipayTradeRefundModel. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PayController.java    From sdb-mall with Apache License 2.0 6 votes vote down vote up
@RequestMapping("/refund/{no}")
    public void testTradeRefund(@PathVariable String no) throws Exception {
        AlipayClient client = new DefaultAlipayClient(AlipayConfig.URL, AlipayConfig.APPID, AlipayConfig.RSA_PRIVATE_KEY, AlipayConfig.FORMAT, AlipayConfig.CHARSET, AlipayConfig.ALIPAY_PUBLIC_KEY,AlipayConfig.SIGNTYPE);
        AlipayTradeRefundModel model = new AlipayTradeRefundModel();
        model.setOutTradeNo(no); //与预授权转支付商户订单号相同,代表对该笔交易退款
        model.setRefundAmount("0.01");
        model.setRefundReason("预授权退款测试");
        model.setOutRequestNo("refund0000001");//标识一次退款请求,同一笔交易多次退款需要保证唯一,如部分退款则此参数必传。
        AlipayTradeRefundRequest request = new AlipayTradeRefundRequest();
        request.setBizModel(model);
        AlipayTradeRefundResponse response = client.execute(request);
        log.info("response: {}"+response.getBody());



//退款失败的"fund_change":"N"
//        {"alipay_trade_refund_response":{"code":"10000","msg":"Success","buyer_logon_id":"mqv***@sandbox.com","buyer_user_id":"2088102171383132","fund_change":"N","gmt_refund_pay":"2018-08-30 15:39:03","out_trade_no":"13c7b574-5f54-42da-8165-e9fc0602f74e","refund_fee":"0.01","send_back_fee":"0.00","trade_no":"2018083021001004130500297310"},"sign":"LgzBU1K7056OLY0AAvFAZBVcZuXXt7PTbZDms5nB5qieslSKiKbYc22Jw4As/GdCJJuH7NVEtBABRM9UBXtTJBCGGn7By/H+vZfkulv43E4ASHvLC8OjXiPrypUO4SDleBTB4WW5h3Vnwk8q/SJ+UXv0lb5xrib84Zspsbz//3rrhzqGJ2sr/40YZIoIuevq/OAmLAkbNuAyIiC4ZxkJijF+mD3PbITTdYs/5e4cVEwriZcdLWnptblucSUtjKwEZvwaAuXuB+CEbqaMEBnpPgye0yqvY9tNb6PmVxHX7sc8sL9rfgDjK09xIXMhU9tgh0R/cgPZsRXvSs/HjHiqlA=="}

//退款成功的"fund_change":"Y"
//        {"alipay_trade_refund_response":{"code":"10000","msg":"Success","buyer_logon_id":"mqv***@sandbox.com","buyer_user_id":"2088102171383132","fund_change":"Y","gmt_refund_pay":"2018-08-30 15:42:15","out_trade_no":"2936025a-73eb-4273-8b1c-dfa8d637ff70","refund_fee":"0.01","send_back_fee":"0.00","trade_no":"2018083021001004130500297311"},"sign":"Nr6WroDGtVfWVCvqSSY7Z2SPtV68UbN9eII9GSMIZ3D4xlMRd+NoEUPl8EB9h3z2T8rR7fUrjAAjfIfC5qamaW6LW9tGXI4d8GprgU0YGx+53ZqyXJIaz3LeSJ6+U7NsC3h62/jOmgow6qAqca/XHkjHXmDTeERC+D6nqJLY28E5EKbVZK2IvupCo4sJLih8nI6BS0H5IjVIsRztAjgosrqCHic32JUel4/uyouBfRGPp5pp+3fzbxdJ1yMbUeKjuipNFS9Bhdvdt3ngTJoOAF+o7vQn7DIsJZQn5zNNP3BCEeXZIiXEfF/yha2HBlAM/ush5yZBpjMhDLXYRGuJUQ=="}
    }
 
Example #2
Source File: AlipayServiceImpl.java    From fast-family-master with Apache License 2.0 5 votes vote down vote up
@Override
public AlipayTradeRefundResponse refund(AlipayTradeRefundModel model) throws AlipayApiException {
    AlipayTradeRefundRequest request = new AlipayTradeRefundRequest();
    request.setBizModel(model);
    request.setNotifyUrl(aliPayProperties.getNotifyUrl());
    request.setReturnUrl(aliPayProperties.getReturnUrl());
    return alipayClient.execute(request);

}
 
Example #3
Source File: PayRefundChain.java    From alipay with Apache License 2.0 4 votes vote down vote up
public PayRefundChain(AlipayClient alipayClient, AlipayTradeRefundModel alipayTradeRefundModel) {
    this.alipayClient = alipayClient;
    this.alipayTradeRefundModel = alipayTradeRefundModel;
}
 
Example #4
Source File: PayRefundParamChain.java    From alipay with Apache License 2.0 4 votes vote down vote up
public PayRefundParamChain(AlipayClient alipayClient, AlipayTradeRefundModel alipayTradeRefundModel) {
    this.alipayClient = alipayClient;
    this.alipayTradeRefundModel = alipayTradeRefundModel;
}
 
Example #5
Source File: AlipayService.java    From fast-family-master with Apache License 2.0 2 votes vote down vote up
/**
 * 退款
 *
 * @param model
 * @return
 * @throws AlipayApiException
 */
AlipayTradeRefundResponse refund(AlipayTradeRefundModel model) throws AlipayApiException;