提交 b950f4d7 authored 作者: Whispa's avatar Whispa

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/example/afrishop_v3/controllers/DpoPayController.java
......@@ -140,6 +140,11 @@
<version>1.12.1</version>
</dependency>
<dependency>
<groupId>com.paypal.sdk</groupId>
<artifactId>rest-api-sdk</artifactId>
<version>1.4.2</version>
</dependency>
<!--stripe-->
<dependency>
......@@ -244,6 +249,26 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<!--发邮件 END-->
</dependencies>
......
......@@ -4,7 +4,9 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
@EnableScheduling
@SpringBootApplication
public class AfrishopV3Application {
private static Logger logger = LoggerFactory.getLogger(AfrishopV3Application.class);
......
package com.example.afrishop_v3.config;
import com.paypal.base.rest.APIContext;
import com.paypal.base.rest.OAuthTokenCredential;
import com.paypal.base.rest.PayPalRESTException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.HashMap;
import java.util.Map;
@Configuration
public class PaypalConfig {
@Value("${paypal.client_app}")
private String clientId;
@Value("${paypal.client_secret}")
private String clientSecret;
@Value("${paypal.mode}")
private String mode;
@Bean
public Map<String, String> paypalSdkConfig() {
Map<String, String> sdkConfig = new HashMap<>();
sdkConfig.put("mode", mode);
return sdkConfig;
}
@Bean
public OAuthTokenCredential authTokenCredential() {
return new OAuthTokenCredential(clientId, clientSecret, paypalSdkConfig());
}
@Bean
public APIContext apiContext() throws PayPalRESTException {
APIContext apiContext = new APIContext(authTokenCredential().getAccessToken());
apiContext.setConfigurationMap(paypalSdkConfig());
return apiContext;
}
}
package com.example.afrishop_v3.config;
public enum PaypalPaymentIntent {
sale, authorize, order
}
package com.example.afrishop_v3.config;
public enum PaypalPaymentMethod {
credit_card, paypal
}
......@@ -13,6 +13,8 @@ import com.example.afrishop_v3.util.ValidateUtils;
import com.example.afrishop_v3.util.WordposHelper;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.relational.core.sql.In;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
......@@ -91,9 +93,9 @@ public class CartController extends Controller {
String itemId = itemDetail.getItemId();
boolean hasItemId = itemId != null && !itemId.isEmpty();
if (hasItemId) {
optionalItem = repository.findFirstByUserIdAndItemImgAndItemSku(userId,itemDetail.getItemImg(), itemDetail.getItemSku());
optionalItem = repository.findFirstByUserIdAndItemImgAndItemSku(userId, itemDetail.getItemImg(), itemDetail.getItemSku());
} else {
optionalItem = repository.findFirstByUserIdAndSourceItemIdAndItemSku(userId,itemDetail.getSourceItemId(), itemDetail.getItemSku());
optionalItem = repository.findFirstByUserIdAndSourceItemIdAndItemSku(userId, itemDetail.getSourceItemId(), itemDetail.getItemSku());
}
TbCfCartRecordR detail;
......@@ -122,15 +124,30 @@ public class CartController extends Controller {
}
if( user.hasFcm() ){
if (user.hasFcm()) {
int i = repository.countByUserId(userId);
sendNotification(user.getFcm(),"Cart updates","Item added to cart, "+i+" item(s) are pending, continue with order");
sendNotification(user.getFcm(), "Cart updates", "Item added to cart, " + i + " item(s) are pending, continue with order");
}
return new Result();
}
@GetMapping("/changeCartStatus/{cartId}/{status}")
public Result changeCartStatus(@PathVariable("cartId") String cartId,
@PathVariable("status") Integer status) {
if (StringUtils.isBlank(cartId) || status == null) {
return new Result(ResultCodeEnum.SERVICE_ERROR.getCode(),
"The parameter cannot be null");
}
Optional<TbCfCartRecordR> byId = repository.findById(cartId);
if (byId.isPresent()) {
TbCfCartRecordR cart = byId.get();
cart.setCheckFlag(status);
repository.save(cart);
}
return new Result();
}
@GetMapping
public Result getItemCartList() {
......
......@@ -192,13 +192,15 @@ public class ItemController {
//商品参数
List<TbCfItemParam> itemParamList = itemParamRepository.findAllByItemId(itemId);
//商品详情
Optional<TbCfItemDesc> byId = descRepository.findById(itemId);
map.put("score",item.getTotalScore());
map.put("isCollection",userId != null && !userId.isEmpty() && collectionRepository.existsByUserIdAndItemItemId(userId,itemId));
map.put("optionList",categoryList);
map.put("itemDetail",skusList);
map.put("itemInfo", item);
map.put("itemParam", itemParamList);
map.put("itemDesc",descRepository.findById(itemId));
map.put("itemDesc",byId.orElse(new TbCfItemDesc()));
return new Result<>(map);
}
......
package com.example.afrishop_v3.controllers;
import com.example.afrishop_v3.base.Result;
import com.example.afrishop_v3.config.PaypalPaymentIntent;
import com.example.afrishop_v3.config.PaypalPaymentMethod;
import com.example.afrishop_v3.enums.DeliveryStatusEnum;
import com.example.afrishop_v3.enums.OrderStatusEnum;
import com.example.afrishop_v3.enums.ResultCodeEnum;
import com.example.afrishop_v3.models.TbCfFinance;
import com.example.afrishop_v3.models.TbCfOrder;
import com.example.afrishop_v3.repository.TbCfFinanceRepository;
import com.example.afrishop_v3.repository.TbCfOrderRepository;
import com.example.afrishop_v3.util.IdUtil;
import com.paypal.api.payments.*;
import com.paypal.base.rest.APIContext;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;
/**
* @Auther: wudepeng
* @Date: 2020/11/27
* @Description:paypal支付
*/
@RestController
@RequestMapping(value = "/paypal")
@Transactional
public class PaypalContoller {
private static Logger logger = LoggerFactory.getLogger(PaypalContoller.class);
@Value("${paypal.success_url}")
private String PAYPAL_SUCCESS_URL;
@Value("${paypal.cancel_url}")
private String PAYPAL_CANCEL_URL;
@Value("${paypal.success_page}")
private String PAYPAL_SUCCESS_PAGE;
@Value("${paypal.failed_page}")
private String PAYPAL_FAILED_PAGE;
private final APIContext apiContext;
private final TbCfOrderRepository orderRepository;
private final TbCfFinanceRepository financeRepository;
public PaypalContoller(APIContext apiContext, TbCfOrderRepository orderRepository, TbCfFinanceRepository financeRepository) {
this.apiContext = apiContext;
this.orderRepository = orderRepository;
this.financeRepository = financeRepository;
}
/**
* 发起paypal支付
*
* @param orderId 订单号
* @return Result
*/
@PostMapping("/payment/{orderId}")
public Result payment(@PathVariable("orderId") String orderId) {
Result result = new Result();
//==========================支付信息校验==========================
//订单号
if (StringUtils.isBlank(orderId)) {
logger.error("paypal支付,订单Id不能为空");
return payErrorInfo(result);
}
//订单信息
Optional<TbCfOrder> byId = orderRepository.findById(orderId);
if (byId.isPresent()) {
TbCfOrder order = byId.get();
//订单不存在
if (order == null) {
logger.error("订单不存在");
return payErrorInfo(result);
}
//价格不存在或错误
if (order.getRealityPay() == null || order.getRealityPay().compareTo(BigDecimal.ZERO) <= 0) {
logger.error("paypal支付,订单[" + order.getOrderNo() + "]价格错误");
return payErrorInfo(result);
}
//订单已支付
if (OrderStatusEnum.PAID.getValue().equals(order.getPayStatus().toString())) {
logger.error("paypal支付,订单[" + order.getOrderNo() + "]已支付");
return payErrorInfo(result);
}
//==========================paypal支付业务开始==========================
logger.info("paypal支付开始,时间:" + getTime());
String orderInfo = order.getDeliveryName() + "'s payment information";
logger.info(orderInfo);
try {
Amount amount = new Amount();
amount.setCurrency("USD");
amount.setTotal(String.format("%.2f", order.getRealityPay()));
Transaction transaction = new Transaction();
transaction.setDescription(orderInfo);
transaction.setAmount(amount);
List<Transaction> transactions = new ArrayList<>();
transactions.add(transaction);
Payer payer = new Payer();
payer.setPaymentMethod(PaypalPaymentMethod.paypal.toString());
Payment payment = new Payment();
payment.setIntent(PaypalPaymentIntent.sale.toString());
payment.setPayer(payer);
payment.setTransactions(transactions);
RedirectUrls redirectUrls = new RedirectUrls();
redirectUrls.setCancelUrl(PAYPAL_CANCEL_URL);
redirectUrls.setReturnUrl(PAYPAL_SUCCESS_URL + "/" + orderId);
payment.setRedirectUrls(redirectUrls);
Payment pay = payment.create(apiContext);
logger.info("paypal支付完成,时间:" + getTime());
for (Links links : pay.getLinks()) {
if (links.getRel().equals("approval_url")) {
return result.setData(links.getHref());
}
}
} catch (Exception e) {
logger.info("paypal支付发生异常,时间:" + getTime() + e.getMessage());
return payErrorInfo(result);
}
}
return payErrorInfo(result);
}
/**
* 用户取消支付
*/
@GetMapping("/cancel")
public void paymentCancle(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.sendRedirect(PAYPAL_FAILED_PAGE);
}
/**
* 支付成功的回调方法
* <p>
* https://app.afrieshop.com/afrishop/paypal/success?
* paymentId=PAYID-L6XFFIA6TM43947C4571820W&
* token=EC-82206922L7926962C&
* PayerID=WBS8FAZYEQQXS
*/
@GetMapping("/success/{orderId}")
public void paymentSuccess(@PathVariable("orderId") String orderId, HttpServletRequest request, HttpServletResponse response) throws Exception {
logger.info("paypal支付校验开始,时间:" + getTime());
boolean verify = false;
String payerId = request.getParameter("PayerID");
//订单id
String paymentId = request.getParameter("paymentId");
String token = request.getParameter("token");
System.out.println("payerId" + payerId);
System.out.println("paymentId" + paymentId);
System.out.println("token" + token);
Payment payment = new Payment();
payment.setId(paymentId);
PaymentExecution paymentExecute = new PaymentExecution();
paymentExecute.setPayerId(payerId);
Payment paypal = payment.execute(apiContext, paymentExecute);
logger.info("支付信息:" + paypal);
logger.info("orderId:" + orderId);
Optional<TbCfOrder> byId = orderRepository.findById(orderId);
String payUrl = PAYPAL_SUCCESS_URL + "?paymentId=" + payerId + "&token=" + token + "&PayerID=" + payerId;
if (byId.isPresent()) {
TbCfOrder order = byId.get();
//paypal支付成功
if (paypal.getState().equals("approved")) {
logger.info("paypal支付,订单[" + order.getOrderNo() + "]支付成功");
//1)、修改订单状态
TbCfOrder tbCfOrder = changeOrderState(payerId, order);
//2)、生成支付流水
createFinance(paymentId, payUrl, order);
//数据库校验支付状态##PayStatus 20
if (OrderStatusEnum.PAID.getValue().equals(tbCfOrder.getPayStatus()))
verify = true;
}
}
if (verify) {
response.sendRedirect(PAYPAL_SUCCESS_PAGE);
} else {
response.sendRedirect(PAYPAL_FAILED_PAGE);
}
}
/**
* 支付失败提示
*
* @param result
*/
public Result payErrorInfo(Result result) {
result.setCode(ResultCodeEnum.ORDER_PAY_ERROR.getCode());
result.setMessage(ResultCodeEnum.ORDER_PAY_ERROR.getDesc());
return result;
}
/**
* 修改订单状态
*/
private TbCfOrder changeOrderState(String transToken, TbCfOrder order) {
//更改订单状态
order.setUpdateTime(new Date());
order.setDealTime(new Date());
order.setPayId(transToken);
order.setOrderStatus(OrderStatusEnum.PAID.getValue());
order.setPayStatus(OrderStatusEnum.PAID.getValue());
order.setDeliveryFlag(DeliveryStatusEnum.PROCESSING.getValue());
return orderRepository.save(order);
}
private TbCfFinance createFinance(String paymentId, String url, TbCfOrder tbCfOrderVo) {
TbCfFinance tbCfFinance = new TbCfFinance();
tbCfFinance.setOrderId(tbCfOrderVo.getOrderId());
tbCfFinance.setFinaceId(IdUtil.createIdbyUUID());
tbCfFinance.setPayAccount(tbCfOrderVo.getRealityPay());
tbCfFinance.setPayId(paymentId);
tbCfFinance.setPayTime(new Date());
tbCfFinance.setReceiptUrl(url);
tbCfFinance.setPayWayCode("paypal");
tbCfFinance.setUserId(tbCfOrderVo.getUserId());
financeRepository.save(tbCfFinance);
return tbCfFinance;
}
public String getTime() {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
String now = format.format(new Date());
return now;
}
}
package com.example.afrishop_v3.controllers;
import com.example.afrishop_v3.base.Result;
import com.example.afrishop_v3.enums.ResultCodeEnum;
import com.example.afrishop_v3.models.Term;
import com.example.afrishop_v3.repository.TermRepository;
import org.apache.commons.lang.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
/**
* @Auther: wudepeng
* @Date: 2020/11/26
* @Description:
*/
@RestController
@RequestMapping("/term")
public class TermController {
private final TermRepository termRepository;
public TermController(TermRepository termRepository) {
this.termRepository = termRepository;
}
@GetMapping
public Result getAllTerms() {
//1.查询所有一级条款
List<Term> termList = termRepository.findByParentId("0");
List<Map> list = new ArrayList();
termList.forEach(term -> {
Map<String, Object> map = new HashMap();
//2.根据一级条款Id查询子条款
List<Term> childrenList = termRepository.findByParentId(term.getId());
map.put("parent", term);
map.put("children", childrenList);
list.add(map);
});
return new Result(list);
}
@GetMapping("/getTermInfo/{termId}")
public Result getTermInfo(@PathVariable("termId") String termId) {
if (StringUtils.isBlank(termId)) {
return new Result().setCode(ResultCodeEnum.SERVICE_ERROR.getCode())
.setMessage("The parameter cannot be null");
}
return new Result(termRepository.findById(termId));
}
}
......@@ -15,9 +15,12 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.http.Consts;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.web.bind.annotation.*;
import java.awt.print.Pageable;
import java.net.URLDecoder;
import java.util.Date;
import java.util.List;
......@@ -280,11 +283,11 @@ public class UserController extends Controller {
@GetMapping("/queryCollectionByUserId")
public Result queryCollectionByUserId() {
public Result queryCollectionByUserId(@RequestParam(value = "pageNo",defaultValue = "0") Integer pageNo, @RequestParam(value = "pageSize",defaultValue = "12") Integer pageSize) {
List<TbCfItemCollection> list = itemCollectionRepository.findAllByUserId(user.userId());
Page<TbCfItemCollection> allByUserId = itemCollectionRepository.findAllByUserId(user.userId(), PageRequest.of(pageNo, pageSize));
return new Result<>(list);
return new Result<>(allByUserId);
}
@PutMapping("/itemCollection/{itemId}")
......
......@@ -89,7 +89,7 @@ public class TbCfCartRecordR {
private String itemSkuId;
@Formula(value = "(SELECT st.item_price FROM tb_cf_station_item st WHERE st.item_id=item_id limit 1)")
@Formula(value = "(SELECT st.discount_price FROM tb_cf_station_item st WHERE st.item_id=item_id limit 1)")
private BigDecimal realItemPrice;
@Formula(value = "(SELECT sk.sku_price FROM tb_cf_item_skus sk WHERE sk.id=item_sku_id limit 1)")
......
......@@ -182,7 +182,7 @@ public class TbCfOrder {
this.commentCount = commentCount;
}
@OneToMany(mappedBy = "orderId", cascade = CascadeType.ALL)
@OneToMany(mappedBy = "orderId", cascade = CascadeType.ALL,fetch = FetchType.EAGER)
private List<TbCfItemOrderR> itemOrderList = new ArrayList<>();
......
package com.example.afrishop_v3.models;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Date;
/**
* 实体
* 表名 term
*
* @author lipengjun
* @date 2020-10-27 17:49:26
*/
@Entity
public class Term implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 条款ID
*/
@Id
private String id;
/**
* 父条款ID,一级条款为0
*/
private String parentId;
/**
* 条款名称
*/
private String termName;
/**
* 条款内容
*/
private String termContent;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 状态 0:无效 1:有效
*/
private Integer status;
/**
* 排序
*/
private Integer sort;
/**
* 设置:条款ID
*/
public void setId(String id) {
this.id = id;
}
/**
* 获取:条款ID
*/
public String getId() {
return id;
}
/**
* 设置:父条款ID,一级条款为0
*/
public void setParentId(String parentId) {
this.parentId = parentId;
}
/**
* 获取:父条款ID,一级条款为0
*/
public String getParentId() {
return parentId;
}
/**
* 设置:条款名称
*/
public void setTermName(String termName) {
this.termName = termName;
}
/**
* 获取:条款名称
*/
public String getTermName() {
return termName;
}
/**
* 设置:条款内容
*/
public void setTermContent(String termContent) {
this.termContent = termContent;
}
/**
* 获取:条款内容
*/
public String getTermContent() {
return termContent;
}
/**
* 设置:创建时间
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 获取:创建时间
*/
public Date getCreateTime() {
return createTime;
}
/**
* 设置:更新时间
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* 获取:更新时间
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* 设置:状态 0:无效 1:有效
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* 获取:状态 0:无效 1:有效
*/
public Integer getStatus() {
return status;
}
/**
* 设置:排序
*/
public void setSort(Integer sort) {
this.sort = sort;
}
/**
* 获取:排序
*/
public Integer getSort() {
return sort;
}
}
package com.example.afrishop_v3.repository;
import com.example.afrishop_v3.models.TbCfItemCollection;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collection;
import java.util.List;
public interface TbCfItemCollectionRepository extends PagingAndSortingRepository<TbCfItemCollection,String> {
boolean existsByUserIdAndItemItemId(String userId, String itemId);
List<TbCfItemCollection> findAllByUserId(String userId);
Page<TbCfItemCollection> findAllByUserId(String userId, Pageable pageable);
@Transactional
......
package com.example.afrishop_v3.repository;
import com.example.afrishop_v3.models.TbCfVersion;
import com.example.afrishop_v3.models.Term;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
* @Auther: wudepeng
* @Date: 2020/11/26
* @Description:
*/
public interface TermRepository extends PagingAndSortingRepository<Term, String> {
List<Term> findByParentId(String parentId);
}
......@@ -66,7 +66,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
.authorizeRequests().antMatchers("/api/auth/**", "/search/image/**", "/itemStation/**", "/startPage/**",
"/goodsType/**", "/home/**", "/spider/**", "/store/**", "/shopify/**", "/community/**", "/version/**",
"/flutterwave/notify/**", "/dpo/notify/**", "/advertisement/**", "/website/**").permitAll()
"/flutterwave/notify/**", "/dpo/notify/**", "/advertisement/**", "/website/**","/paypal/**").permitAll()
.antMatchers("/api/test/**").permitAll()
.anyRequest().authenticated();
......
......@@ -73,3 +73,13 @@ flutter:
public_key: FLWPUBK_TEST-e3cc948e7cb24b2128fca3b781f6fce0-X
secret_key: FLWSECK_TEST-f88371ca63a989a4af95625475a0d22d-X
#paypal支付配置
paypal:
success_url: https://app.afrieshop.com/afrishop/paypal/success
cancel_url: https://app.afrieshop.com/afrishop/paypal/cancel
client_app: AXD2kJ8UK9Z-8XnztFF6H4_G3t3fPE9xWrMDV7GoAwuWIw9Z32_7vsrLeDDPFJeAyr7KdZyBYuyqRsYu
client_secret: EOsClSHvNzcL-oO9qflJ1rJuluvGstgU8LZGyFmCBHKbhYqFFP5JREhQS8CNbvgoHKWUiCv_Qh7dlBkQ
success_page: https://www.afrieshop.com/payment_successful
failed_page: https://www.afrieshop.com/payment_failed
mode: live
......@@ -73,3 +73,13 @@ flutter:
public_key: FLWPUBK-ee0f5d653f5f33fc89e6caf9de6a4c34-X
secret_key: FLWSECK-c06cdc19526077f3855b76045ca77de3-X
#paypal支付配置
paypal:
success_url: https://app.afrieshop.com/zion/paypal/success
cancel_url: https://app.afrieshop.com/zion/paypal/cancel
client_app: AXD2kJ8UK9Z-8XnztFF6H4_G3t3fPE9xWrMDV7GoAwuWIw9Z32_7vsrLeDDPFJeAyr7KdZyBYuyqRsYu
client_secret: EOsClSHvNzcL-oO9qflJ1rJuluvGstgU8LZGyFmCBHKbhYqFFP5JREhQS8CNbvgoHKWUiCv_Qh7dlBkQ
success_page: https://www.afrieshop.com/payment_successful
failed_page: https://www.afrieshop.com/payment_failed
mode: live
server:
servlet:
context-path: /afrishop
port: 8099
spring:
datasource:
url: jdbc:mysql://159.138.48.71:3306/chinafrica_ref?useUnicode=true&connectionCollation=utf8mb4_general_ci&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
......@@ -72,3 +76,13 @@ flutter:
public_key: FLWPUBK_TEST-e3cc948e7cb24b2128fca3b781f6fce0-X
secret_key: FLWSECK_TEST-f88371ca63a989a4af95625475a0d22d-X
#paypal支付配置
paypal:
success_url: https://app.afrieshop.com/afrishop/paypal/success
cancel_url: https://app.afrieshop.com/afrishop/paypal/cancel
client_app: Ad2N5bYO08PCve8gys1qaEiNlHV-HbHWqUzz3yNnKUffXW8AQHWz87WwpdCr4blMAvvMDdfAsBd2D2-C
client_secret: EFL1jVn93-ojQOg9H-CujDWfM_MSESgPR0m0qXGO6OvCzhbuwseB_soNvU6yKW7WBxp_URxmN3Fpjzay
success_page: https://www.afrieshop.com/payment_successful
failed_page: https://www.afrieshop.com/payment_failed
mode: sandbox
server.servlet.context-path=/zion
server.servlet.context-path=/afrishop
spring.jpa.hibernate.ddl-auto=update
server.port = 7000
server.port = 8099
#spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/afrishop_test?useUnicode=true&connectionCollation=utf8mb4_general_ci&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
#spring.datasource.username=root
#spring.datasource.password=Diaoyunnuli.8
#spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
spring.profiles.active=test
spring.profiles.active=dev
spring.datasource.connectionInitSql: SET NAMES 'utf8mb4'
#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
security.oauth2.resource.filter-order=3
......
//package com.example.afrishop_v3;
//
//import org.junit.jupiter.api.Test;
//import org.junit.runner.RunWith;
//import org.springframework.boot.test.context.SpringBootTest;
//import org.springframework.test.context.junit4.SpringRunner;
//
//import java.text.SimpleDateFormat;
//import java.time.LocalDateTime;
//import java.util.Date;
//
//@RunWith(SpringRunner.class)
//@SpringBootTest
//class AfrishopV3ApplicationTests {
//public class AfrishopV3ApplicationTests {
//
// @Test
// void contextLoads() {
//
//
// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
// String now = format.format(new Date());
// System.out.println(now);
// }
//
//}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论