Commit 48277ba8 by lijinqi

支付回调接口V0.2完成,支付订单状态待修改

parent 2ac6fcb6
...@@ -39,6 +39,8 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -39,6 +39,8 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
...@@ -548,12 +550,15 @@ public class ResourceOrderServiceImpl implements ResourceOrderService { ...@@ -548,12 +550,15 @@ public class ResourceOrderServiceImpl implements ResourceOrderService {
// 3. 校验支付金额是否匹配 // 3. 校验支付金额是否匹配
String wpgjOrderAmt = notifyDTO.getOrderAmt(); // WPGJ回调金额单位是元 String wpgjOrderAmt = notifyDTO.getOrderAmt(); // WPGJ回调金额单位是元
long resourceOrderAmt = order.getPaymentPrice() / 100; // 转换为元 BigDecimal resourceOrderAmt = BigDecimal.valueOf(order.getPaymentPrice()).
divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP);
if (!wpgjOrderAmt.equals(String.valueOf(resourceOrderAmt))) { if (!wpgjOrderAmt.equals(String.valueOf(resourceOrderAmt))) {
log.error("[updateOrderPaidByWpgj] 支付金额不匹配,订单ID: {}, WPGJ金额: {}, 订单金额: {}", log.error("[updateOrderPaidByWpgj] 支付金额不匹配,订单ID: {}, WPGJ金额: {}, 订单金额: {}",
orderId, wpgjOrderAmt, resourceOrderAmt); orderId, wpgjOrderAmt, resourceOrderAmt);
return; return;
} }
log.error("[updateOrderPaidByWpgj] WPGJ金额: {}, 订单金额: {}",
orderId, wpgjOrderAmt, resourceOrderAmt);
// 4. 更新算力资源订单状态为已支付 // 4. 更新算力资源订单状态为已支付
ResourceOrderDO updateOrder = new ResourceOrderDO(); ResourceOrderDO updateOrder = new ResourceOrderDO();
...@@ -566,6 +571,8 @@ public class ResourceOrderServiceImpl implements ResourceOrderService { ...@@ -566,6 +571,8 @@ public class ResourceOrderServiceImpl implements ResourceOrderService {
log.info("[updateOrderPaidByWpgj] WPGJ支付成功回调处理完成,订单ID: {}, WPGJ订单号: {}", log.info("[updateOrderPaidByWpgj] WPGJ支付成功回调处理完成,订单ID: {}, WPGJ订单号: {}",
orderId, notifyDTO.getOrderId()); orderId, notifyDTO.getOrderId());
} catch (Exception e) { } catch (Exception e) {
log.error("[updateOrderPaidByWpgj] 处理WPGJ支付成功回调异常,订单ID: {}", orderId, e); log.error("[updateOrderPaidByWpgj] 处理WPGJ支付成功回调异常,订单ID: {}", orderId, e);
throw e; throw e;
......
...@@ -134,6 +134,7 @@ public class PayOrderApiImpl implements PayOrderApi { ...@@ -134,6 +134,7 @@ public class PayOrderApiImpl implements PayOrderApi {
businessData.set("cashier_type", "1"); businessData.set("cashier_type", "1");
businessData.set("return_url", ""); // WPGJ订单暂不使用return_url businessData.set("return_url", ""); // WPGJ订单暂不使用return_url
businessData.set("notifyurl", wpgjPayProperties.getNotifyUrl()); businessData.set("notifyurl", wpgjPayProperties.getNotifyUrl());
log.error("[callWpgjApi] 开始调用WPGJ支付NotifyUrl: {}", wpgjPayProperties.getNotifyUrl());
// 2. 构建加密请求数据 // 2. 构建加密请求数据
String encryptedRequest = WpgjCryptoUtils.buildEncryptedRequest( String encryptedRequest = WpgjCryptoUtils.buildEncryptedRequest(
......
...@@ -175,7 +175,7 @@ computility: ...@@ -175,7 +175,7 @@ computility:
mer-code: K20241200111267 mer-code: K20241200111267
term-code: 1011215692596 term-code: 1011215692596
api-url: https://stg5-qr.wpgjcs.com/industrial/payment/dynamic api-url: https://stg5-qr.wpgjcs.com/industrial/payment/dynamic
notify-url: https://phslgld.hnluchuan.com/admin-api/compute/resource-order/pay/wpgj-notify notify-url: https://phslgld.hnluchuan.com/admin-api/compute/wpgj/new-notify
sign-key: 07714583f82b4db8b675b32cd5e0969743 # WPGJ回调签名密钥(测试用,实际需要向WPGJ确认) sign-key: 07714583f82b4db8b675b32cd5e0969743 # WPGJ回调签名密钥(测试用,实际需要向WPGJ确认)
public-key: | public-key: |
-----BEGIN PUBLIC KEY----- -----BEGIN PUBLIC KEY-----
......
...@@ -281,9 +281,11 @@ computility: ...@@ -281,9 +281,11 @@ computility:
- /admin-api/infra/file/preview - /admin-api/infra/file/preview
- /app-api/infra/file/preview - /app-api/infra/file/preview
- /open-api/external/** - /open-api/external/**
- /admin-api/compute/wpgj/new-notify
ignore-visit-urls: ignore-visit-urls:
- /admin-api/system/user/profile/** - /admin-api/system/user/profile/**
- /admin-api/system/auth/** - /admin-api/system/auth/**
- /admin-api/compute/wpgj/new-notify
ignore-tables: ignore-tables:
- biz_banner_info - biz_banner_info
- biz_computility_information - biz_computility_information
......
mvn clean package -Dmaven.test.skip=true
echo "laMOYtX9Fo0qjrfD"
scp /Users/jackey/Documents/code/computing-power-platform/computing-power-platform-server-new/computility-server/target/computility-server.jar root@8.136.9.68:/data/computility
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment