Skip to content

Commit

Permalink
网页支付相关,如果有出现'(单引号)则直接剔除
Browse files Browse the repository at this point in the history
  • Loading branch information
egzosn committed Oct 31, 2021
1 parent 2d74c2a commit e10812c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ public String createSign(Map<String, Object> content, String characterEncoding)
*/
@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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void init() {
@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);

Expand Down Expand Up @@ -200,7 +200,7 @@ public Map<String, Object> microPay(BigDecimal price, String authCode) {
//支付结果
Map<String, Object> params = service.microPay(order);
//校验
if (service.verify(params)) {
if (service.verify(new NoticeParams(params))) {

//支付校验通过后的处理
//......业务逻辑处理块........
Expand Down

0 comments on commit e10812c

Please sign in to comment.