mirror of
https://gitee.com/egzosn/pay-java-parent.git
synced 2026-06-09 02:42:20 +08:00
网页支付相关,如果有出现'(单引号)则直接剔除
This commit is contained in:
@@ -162,6 +162,12 @@ public abstract class BasePayService<PC extends PayConfigStorage> implements Pay
|
||||
*/
|
||||
@Override
|
||||
public <O extends PayOrder> String toPay(O order) {
|
||||
if (StringUtils.isNotEmpty(order.getSubject()) && order.getSubject().contains("'")){
|
||||
order.setSubject(order.getSubject().replace("'",""));
|
||||
}
|
||||
if (StringUtils.isNotEmpty(order.getBody()) && order.getBody().contains("'")){
|
||||
order.setBody(order.getBody().replace("'",""));
|
||||
}
|
||||
Map<String, Object> orderInfo = orderInfo(order);
|
||||
return buildRequest(orderInfo, MethodType.POST);
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ public class AliPayController {
|
||||
@RequestMapping(value = "toPay.html", produces = "text/html;charset=UTF-8")
|
||||
public String toPay(BigDecimal price) {
|
||||
//及时收款
|
||||
PayOrder order = new PayOrder("订单title", "摘要", null == price ? BigDecimal.valueOf(0.01) : price, UUID.randomUUID().toString().replace("-", ""), AliTransactionType.PAGE);
|
||||
PayOrder order = new PayOrder("订单title", "摘'要", null == price ? BigDecimal.valueOf(0.01) : price, UUID.randomUUID().toString().replace("-", ""), AliTransactionType.PAGE);
|
||||
//WAP
|
||||
// PayOrder order = new PayOrder("订单title", "摘要", null == price ? BigDecimal.valueOf(0.01) : price, UUID.randomUUID().toString().replace("-", ""), AliTransactionType.WAP);
|
||||
|
||||
@@ -200,7 +200,7 @@ public class AliPayController {
|
||||
//支付结果
|
||||
Map<String, Object> params = service.microPay(order);
|
||||
//校验
|
||||
if (service.verify(params)) {
|
||||
if (service.verify(new NoticeParams(params))) {
|
||||
|
||||
//支付校验通过后的处理
|
||||
//......业务逻辑处理块........
|
||||
|
||||
Reference in New Issue
Block a user