tangxiangan 4 ヶ月 前
コミット
28b7a8dbff

+ 1 - 0
pdf-office-common/src/main/java/cn/kdan/cloud/pdf/office/common/enums/EmailCodeTypeEnum.java

@@ -44,6 +44,7 @@ public enum EmailCodeTypeEnum {
     MEMBER_REGISTER_SUCCESS("member_register_success","","",""),
     MEMBER_UPDATE_PASSWORD_SUCCESS("member_update_password_success","","",""),
     MEMBER_UPGRADE_SUCCESS("member_upgrade_success","","",""),
+    MEMBER_BUY_SUCCESS("member_buy_success","","",""),
 
 ;
     private final String value;

+ 1 - 1
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/client/GooglePayClient.java

@@ -177,7 +177,7 @@ public class GooglePayClient {
     private static void testID() {
         String appName = "PDF Reader Pro";
         String packageName = "com.pdftechnologies.pdfreaderpro";
-        String purchaseToken = "dkenmfimplmkghceclooknoo.AO-J1OwGTB4uAhsF9moKUyGGjfqKlSp5A2W0YDg2i99i8wrSpHflzjMxjprpdzYwWcJObH-b9pYxrAOJ27r1NtuRBJOZIG4FeePxxe2brVPxZPoSLe_MupA";
+        String purchaseToken = "bkjackdmmdnlbmijboodamnf.AO-J1Owiy2o66jZ80kOOP0g4ClNMZyRxkZ5ZxXXErAqWEj1Xt8lsXT_IxfxNgdOy0ClYZZdB2En8o9Fx8oAyegOgsExKmbIBh12j5rjPc-6SYxmJ_jp-pPQ";
         InputStream content = new IOUtils().getGoogleKey();
         try {
             GoogleCredentials googleCredentials = GoogleCredentials.fromStream(content)

+ 6 - 3
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/service/impl/GooglePayServiceImpl.java

@@ -168,7 +168,9 @@ public class GooglePayServiceImpl implements GooglePayService {
             // 格式化当前日期
             String formattedDate = sdf.format(date);
             contentMap.put("@date@",formattedDate);
-            contentMap.put("@payPrice@", product.getDisplayPrice().toString());
+            String price = ObjectUtils.isNotEmpty(product.getDisplayPrice())? product.getDisplayPrice().toString() : product.getPrice().toString();
+
+            contentMap.put("@payPrice@", price);
             contentMap.put("@renewPrice@", product.getPrice().toString());
             bo.setSendTitleContent(titleMap);
             //设置内容
@@ -178,7 +180,7 @@ public class GooglePayServiceImpl implements GooglePayService {
             EmailSendBO bo = new EmailSendBO();
             bo.setToEmail(userVO.getEmail());
             //设置事件
-            bo.setUseEvent(EmailCodeTypeEnum.MEMBER_UPGRADE_SUCCESS.value());
+            bo.setUseEvent(EmailCodeTypeEnum.MEMBER_BUY_SUCCESS.value());
             //设置title
             Map<String,String> titleMap = new HashMap<>();
             //设置内容
@@ -190,7 +192,8 @@ public class GooglePayServiceImpl implements GooglePayService {
             // 格式化当前日期
             String formattedDate = sdf.format(date);
             contentMap.put("@date@",formattedDate);
-            contentMap.put("@payPrice@", product.getDisplayPrice().toString());
+            String price = ObjectUtils.isNotEmpty(product.getDisplayPrice())? product.getDisplayPrice().toString() : product.getPrice().toString();
+            contentMap.put("@payPrice@", price);
             bo.setSendTitleContent(titleMap);
             //设置内容
             bo.setSendContent(contentMap);