Browse Source

Bug修复

tangxiangan 3 months ago
parent
commit
ec300a07c4

+ 1 - 7
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/service/impl/AppStoreWebhookServiceImpl.java

@@ -41,13 +41,7 @@ public class AppStoreWebhookServiceImpl implements AppStoreWebhookService {
             return;
         }
         OrdersVO ordersVONew = ordersVOS.get(0);
-        ProductVO productVO = ordersService.getProduct(ordersVONew.getProductId());
-        BigDecimal price;
-        if(StringUtils.isNotEmpty(ordersVONew.getCurrency())&&ordersVONew.getCurrency().equals("USD")){
-            price = productVO.getPrice();
-        }else{
-            price = productVO.getCnyPrice();
-        }
+        BigDecimal price = BigDecimal.valueOf(jwsTransactionDecodedPayload.getPrice()/1000);
         webhookService.handleSubsequentAutomaticDeduction(price, thirdTradeNo, thirdOrderId,ordersVONew,payTime, jwsTransactionDecodedPayload.toString());
     }
 

+ 1 - 0
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/service/impl/WebhookServiceImpl.java

@@ -109,6 +109,7 @@ public class WebhookServiceImpl implements WebhookService {
         createOrderManual.setPaymentMethod(PaymentMethodEnum.fromValue(orderByTradeNo.getPayment()));
         // 设置实际扣费价格
         createOrderManual.setPrice(price);
+        createOrderManual.setReducedPrice(price);
         if(!StringUtils.isEmpty(orderByTradeNo.getCurrency())){
             createOrderManual.setCurrency(orderByTradeNo.getCurrency());
         }

+ 2 - 0
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/webhook/appstore/notification/JWSTransactionDecodedPayload.java

@@ -37,4 +37,6 @@ public class JWSTransactionDecodedPayload {
 
   private String webOrderLineItemId;
   private String environment;
+  private String currency;
+  private Integer price;
 }