Search in sources :

Example 1 with AlipayTradeRefundResponse

use of com.alipay.api.response.AlipayTradeRefundResponse in project synergic-developing by zeemood.

the class AlipayAssistant method refund.

/**
 * 退款接口
 *
 * @param model
 * @return
 * @throws Exception
 */
public static AlipayTradeRefundResponse refund(AlipayTradeRefundModel model) throws Exception {
    AlipayClient alipayClient = new DefaultAlipayClient(// 支付地址
    AlipayConfigurations.GATE_URL, // 应用id
    AlipayConfigurations.getAppid(), // 私钥
    AlipayConfigurations.getPrivateKey(), // 固定值json,参数类型,
    AlipayConstants.FORMAT_JSON, // 编码方式
    AlipayConstants.CHARSET_UTF8, // 公钥
    AlipayConfigurations.getPublicKey(), AlipayConstants.SIGN_TYPE_RSA2);
    AlipayTradeRefundRequest request = new AlipayTradeRefundRequest();
    request.setBizModel(model);
    AlipayTradeRefundResponse response = alipayClient.execute(request);
    if (!response.isSuccess()) {
        throw new RuntimeException("调用失败");
    }
    return response;
}
Also used : AlipayTradeRefundResponse(com.alipay.api.response.AlipayTradeRefundResponse) DefaultAlipayClient(com.alipay.api.DefaultAlipayClient) AlipayClient(com.alipay.api.AlipayClient) DefaultAlipayClient(com.alipay.api.DefaultAlipayClient)

Aggregations

AlipayClient (com.alipay.api.AlipayClient)1 DefaultAlipayClient (com.alipay.api.DefaultAlipayClient)1 AlipayTradeRefundResponse (com.alipay.api.response.AlipayTradeRefundResponse)1