|
@@ -135,7 +135,7 @@ public class GooglePayServiceImpl implements GooglePayService {
|
|
createSubscription.setPrice(price);
|
|
createSubscription.setPrice(price);
|
|
createSubscription.setPayTime(0);
|
|
createSubscription.setPayTime(0);
|
|
subscriptionsService.createSubscription(createSubscription);
|
|
subscriptionsService.createSubscription(createSubscription);
|
|
- String readeNo = MyDateUtils.getTimeStamp() + "-" + product.getId() + "-" + (int) ((Math.random() * 9 + 1) * 1000);
|
|
|
|
|
|
+ String readeNo = cn.kdan.cloud.pdf.office.payment.utils.CommonUtils.generateRightsId((long) ((Math.random() * 9999 + 1) * 10000));
|
|
CreateOrderManualDTO orderManualDTO = CreateOrderManualDTO.builder()
|
|
CreateOrderManualDTO orderManualDTO = CreateOrderManualDTO.builder()
|
|
.thirdTradeNo(subscriptionPurchaseV2.getExternalAccountIdentifiers().getObfuscatedExternalAccountId())
|
|
.thirdTradeNo(subscriptionPurchaseV2.getExternalAccountIdentifiers().getObfuscatedExternalAccountId())
|
|
.thirdOrderNo(subscriptionPurchaseV2.getLatestOrderId())
|
|
.thirdOrderNo(subscriptionPurchaseV2.getLatestOrderId())
|
|
@@ -190,8 +190,8 @@ public class GooglePayServiceImpl implements GooglePayService {
|
|
price = ObjectUtils.isNotEmpty(product.getCnyDisplayPrice())? product.getCnyDisplayPrice().toString() : product.getCnyPrice().toString();
|
|
price = ObjectUtils.isNotEmpty(product.getCnyDisplayPrice())? product.getCnyDisplayPrice().toString() : product.getCnyPrice().toString();
|
|
renewPrice = product.getCnyPrice();
|
|
renewPrice = product.getCnyPrice();
|
|
}
|
|
}
|
|
- contentMap.put("@payPrice@", orderManualDTO.getCurrency().equals("USD")?"$"+price:"¥"+price);
|
|
|
|
- contentMap.put("@renewPrice@", orderManualDTO.getCurrency().equals("USD")?"$"+renewPrice.toString():"¥"+renewPrice.toString());
|
|
|
|
|
|
+ contentMap.put("@payPrice@", orderManualDTO.getCurrency()+price);
|
|
|
|
+ contentMap.put("@renewPrice@",orderManualDTO.getCurrency()+price);
|
|
|
|
|
|
bo.setSendTitleContent(titleMap);
|
|
bo.setSendTitleContent(titleMap);
|
|
//设置内容
|
|
//设置内容
|
|
@@ -225,7 +225,7 @@ public class GooglePayServiceImpl implements GooglePayService {
|
|
price = ObjectUtils.isNotEmpty(product.getCnyDisplayPrice())? product.getCnyDisplayPrice().toString() : product.getCnyPrice().toString();
|
|
price = ObjectUtils.isNotEmpty(product.getCnyDisplayPrice())? product.getCnyDisplayPrice().toString() : product.getCnyPrice().toString();
|
|
renewPrice = product.getCnyPrice();
|
|
renewPrice = product.getCnyPrice();
|
|
}
|
|
}
|
|
- contentMap.put("@payPrice@", orderManualDTO.getCurrency().equals("USD")?"$"+price:"¥"+price);
|
|
|
|
|
|
+ contentMap.put("@payPrice@", orderManualDTO.getCurrency()+price);
|
|
bo.setSendTitleContent(titleMap);
|
|
bo.setSendTitleContent(titleMap);
|
|
//设置内容
|
|
//设置内容
|
|
bo.setSendContent(contentMap);
|
|
bo.setSendContent(contentMap);
|
|
@@ -261,7 +261,7 @@ public class GooglePayServiceImpl implements GooglePayService {
|
|
// 生成替换内容后的发票
|
|
// 生成替换内容后的发票
|
|
String htmlStr = TemplatesUtil.replaceStringUsingFreeMarker(invoiceHtml, map);
|
|
String htmlStr = TemplatesUtil.replaceStringUsingFreeMarker(invoiceHtml, map);
|
|
if (!currency.equals("USD")) {
|
|
if (!currency.equals("USD")) {
|
|
- htmlStr = htmlStr.replace("USD", "CNY");
|
|
|
|
|
|
+ htmlStr = htmlStr.replace("USD", currency);
|
|
}
|
|
}
|
|
HttpHeaders headers = new HttpHeaders();
|
|
HttpHeaders headers = new HttpHeaders();
|
|
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|
|
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|