use of com.alipay.api.domain.AlipayTradePayModel in project ballcat by ballcat-projects.
the class AliPay method mobileWapPay.
/**
* 手机网站支付-简易支付
* @param sn 平台订单号
* @param amount 用户支付金额(单位: 元)
* @param subject 商品标题
* @return com.alipay.api.response.AlipayTradeWapPayResponse
* @author lingting 2021-01-25 10:14
*/
public AlipayTradeWapPayResponse mobileWapPay(String sn, BigDecimal amount, String subject, String returnUrl, String notifyUrl) throws AlipayApiException {
AlipayTradePayModel model = new AlipayTradePayModel();
model.setOutTradeNo(sn);
// 单位为 元 金额需要转为 分
model.setTotalAmount(amount.toPlainString());
model.setSubject(subject);
return mobileWapPay(model, returnUrl, notifyUrl);
}
use of com.alipay.api.domain.AlipayTradePayModel in project ballcat by ballcat-projects.
the class AliPay method appPay.
/**
* APP支付-简易支付
* @param sn 平台订单号
* @param amount 用户支付金额(单位: 元)
* @param subject 商品标题
* @return com.alipay.api.response.AlipayTradeAppPayResponse
* @author lingting 2021-01-25 10:14
*/
public AlipayTradeAppPayResponse appPay(String sn, BigDecimal amount, String subject, String notifyUrl) throws AlipayApiException {
AlipayTradePayModel model = new AlipayTradePayModel();
model.setOutTradeNo(sn);
// 单位为 元 金额需要转为 分
model.setTotalAmount(amount.toPlainString());
model.setSubject(subject);
return appPay(model, notifyUrl);
}
use of com.alipay.api.domain.AlipayTradePayModel in project leopard by tanhaichao.
the class AlipayClientImpl method micropay.
@Override
public AlipayTradePayResponse micropay(String outTradeNo, String scene, String authCode, String subject, double amount, String spbillCreateIp) throws AlipayApiException {
AlipayTradePayModel model = new AlipayTradePayModel();
model.setOutTradeNo(outTradeNo);
model.setScene(scene);
model.setAuthCode(authCode);
model.setSubject(subject);
model.setTotalAmount(Double.toString(amount));
System.err.println("authCode:" + authCode);
System.err.println("totalAmount:" + amount);
AlipayTradePayRequest request = new AlipayTradePayRequest();
request.setBizModel(model);
return alipayClient.execute(request);
// if (response.isSuccess()) {
// System.out.println("调用成功");
// }
// else {
// System.out.println("调用失败");
// }
// return response.getCode() + ":" + response.getSubCode() + ":" + response.getSubMsg();
// return AliPayApi.tradePay(model, notifyUrl);
}
use of com.alipay.api.domain.AlipayTradePayModel in project ballcat by ballcat-projects.
the class AliPay method codePay.
/**
* 付款码支付-简易支付
* @param sn 平台订单号
* @param amount 用户支付金额(单位: 元)
* @param code 付款码内容(条形码或二维码内容)
* @param subject 商品标题
* @return com.alipay.api.response.AlipayTradeAppPayResponse
* @author lingting 2021-01-25 10:14
*/
public AlipayTradePayResponse codePay(String sn, BigDecimal amount, String code, String subject, String notifyUrl) throws AlipayApiException {
AlipayTradePayModel model = new AlipayTradePayModel();
model.setOutTradeNo(sn);
// 单位为 元 金额需要转为 分
model.setTotalAmount(amount.toPlainString());
// 付款码内容
model.setAuthCode(code);
model.setSubject(subject);
return codePay(model, notifyUrl);
}
use of com.alipay.api.domain.AlipayTradePayModel in project ballcat by ballcat-projects.
the class AliPay method computerWapPay.
/**
* 电脑网站支付-简易支付
* @param sn 平台订单号
* @param amount 用户支付金额(单位: 元)
* @param subject 商品标题
* @return com.alipay.api.response.AlipayTradeWapPayResponse
* @author lingting 2021-01-25 10:14
*/
public AlipayTradePagePayResponse computerWapPay(String sn, BigDecimal amount, String subject, String returnUrl, String notifyUrl) throws AlipayApiException {
AlipayTradePayModel model = new AlipayTradePayModel();
model.setOutTradeNo(sn);
// 单位为 元 金额需要转为 分
model.setTotalAmount(amount.toPlainString());
model.setSubject(subject);
model.setProductCode(AliPayConstant.PRODUCT_CODE);
return computerWapPay(model, returnUrl, notifyUrl);
}
Aggregations