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;
}
Aggregations