提交 eb49473c authored 作者: 梁业锦's avatar 梁业锦 💬

Merge remote-tracking branch 'origin/master'

This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
2019-11-04 09:10:02.609 [restartedMain] WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisKeyExpirationListener' defined in file [E:\JavaProject\zion\target\classes\com\diaoyun\zion\master\listener\RedisKeyExpirationListener.class]: Invocation of init method failed; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to 127.0.0.1:6379
2019-11-04 19:50:43.035 [restartedMain] WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'documentationPluginsBootstrapper' defined in URL [jar:file:/C:/Users/Administrator/.m2/repository/io/springfox/springfox-spring-web/2.9.2/springfox-spring-web-2.9.2.jar!/springfox/documentation/spring/web/plugins/DocumentationPluginsBootstrapper.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webMvcRequestHandlerProvider' defined in URL [jar:file:/C:/Users/Administrator/.m2/repository/io/springfox/springfox-spring-web/2.9.2/springfox-spring-web-2.9.2.jar!/springfox/documentation/spring/web/plugins/WebMvcRequestHandlerProvider.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'paymentController' method
public java.lang.String com.diaoyun.zion.chinafrica.controller.PaymentController.cancelPay()
to {GET /paypal/cancel}: There is already 'payPalController' bean method
public com.diaoyun.zion.master.base.Result com.diaoyun.zion.chinafrica.controller.PayPalController.cancelPay() mapped.
2019-11-04 23:54:37.986 [restartedMain] WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisKeyExpirationListener' defined in file [E:\JavaProject\zion\target\classes\com\diaoyun\zion\master\listener\RedisKeyExpirationListener.class]: Invocation of init method failed; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to 127.0.0.1:6379
2019-11-05 08:56:23.508 [restartedMain] WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisKeyExpirationListener' defined in file [E:\JavaProject\zion\target\classes\com\diaoyun\zion\master\listener\RedisKeyExpirationListener.class]: Invocation of init method failed; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to 127.0.0.1:6379
2019-11-05 10:46:30.515 [restartedMain] WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerAdapter' defined in class path resource [org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Factory method 'requestMappingHandlerAdapter' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gson' defined in class path resource [com/diaoyun/zion/master/config/WebMvcConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.google.gson.Gson]: Factory method 'gson' threw exception; nested exception is java.lang.NoClassDefFoundError: com/diaoyun/zion/master/gson/SpringfoxJsonToGsonAdapter
......@@ -46,7 +46,8 @@ public class TokenVerification {
"&&!execution(* com.diaoyun.zion.chinafrica.controller.GoodsTypeController.*(..))"+
"&&!execution(* com.diaoyun.zion.chinafrica.controller.VersionController.*(..))"+
"&&!execution(* com.diaoyun.zion.chinafrica.controller.TbCfFeeController.*(..))"+
"&&!execution(* com.diaoyun.zion.chinafrica.controller.TbCfOrderController.*(..))"
"&&!execution(* com.diaoyun.zion.chinafrica.controller.TbCfOrderController.*(..))"+
"&&!execution(* com.diaoyun.zion.chinafrica.controller.PayPalController.*(..))"
)
public void controllerAspect() {
......
package com.diaoyun.zion.chinafrica.controller;
import com.diaoyun.zion.chinafrica.service.PayPalService;
import com.diaoyun.zion.chinafrica.vo.PayPalResult;
import com.diaoyun.zion.master.base.Result;
import com.egzosn.pay.common.api.PayService;
import com.egzosn.pay.common.bean.MethodType;
......@@ -28,23 +29,51 @@ public class PayPalController {
@Autowired
private PayPalService payPalService;
@PostMapping ("/pay")
public Result payForOrder(@RequestParam("orderId") String orderId){
/**
* 发起支付
*
* @param orderId
* @return
*/
@PostMapping("/pay")
public Result payForOrder(@RequestParam("orderId") String orderId) {
return payPalService.payForOrder(orderId);
}
/**
* 支付成功的回调
*
* @param request
* @return
*/
@GetMapping("/success")
public Result payForSuccess(HttpServletRequest request,@RequestParam("orderId") String orderId){
public Result payForSuccess(HttpServletRequest request) {
return payPalService.payForSuccess(request,orderId);
return payPalService.payForSuccess(request);
}
/**
* 取消支付
*
* @return
*/
@GetMapping("/cancel")
public Result cancelPay(){
public Result cancelPay() {
return new Result().setMessage("订单支付已取消");
}
/**
* 退款
* @param orderId
* @param payId
* @return
*/
@GetMapping("/refund")
public Result refund(@RequestParam("orderId") String orderId, @RequestParam("payId") String payId) {
return payPalService.refund(orderId, payId);
}
}
......@@ -31,7 +31,6 @@ public class TbCfExpCatRelController {
@ApiOperation("关联运费模板和商品种类")
@PostMapping("/buildRelate")
public Result buildRelate(@ApiParam("包含分类id数组和模板id") @RequestBody Map<String,Object> param) {
List<String> categoryIdArray= (List<String>) param.get("categoryIds");
String tempalteId= (String) param.get("tempalteId");
......
package com.diaoyun.zion.chinafrica.service;
import com.diaoyun.zion.chinafrica.vo.PayPalResult;
import com.diaoyun.zion.master.base.Result;
import org.springframework.web.bind.annotation.RequestParam;
......@@ -7,5 +8,6 @@ import javax.servlet.http.HttpServletRequest;
public interface PayPalService {
public Result payForOrder( String orderId);
public Result payForSuccess(HttpServletRequest request,String orderId);
public Result payForSuccess(HttpServletRequest request);
Result refund(String orderId,String payId);
}
package com.diaoyun.zion.chinafrica.vo;
/**
* 支付返回类
*/
public class PayPalResult {
//订单id
private String orderId;
//支付id
private String payId;
//paypal回调url
private String paypalUrl;
//订单描述
private String orderDesc;
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getPayId() {
return payId;
}
public void setPayId(String payId) {
this.payId = payId;
}
public String getPaypalUrl() {
return paypalUrl;
}
public void setPaypalUrl(String paypalUrl) {
this.paypalUrl = paypalUrl;
}
public String getOrderDesc() {
return orderDesc;
}
public void setOrderDesc(String orderDesc) {
this.orderDesc = orderDesc;
}
}
......@@ -35,24 +35,16 @@ tencent.wordpos.app_url=https://api.ai.qq.com/fcgi-bin/nlp/nlp_wordpos
################腾讯翻译配置 END###################
##################新11.05(stripe公钥(不加密)和私钥(已用 AESUtils 加密))################################
stripe.pk=pk_live_FP6ipnw3lt0e1AmS5IVdpJWd00s5PLdbVa
stripe.sk=YWA9aMOPvCfq0KWda2Wsh567lLl600+QK/X8ZEFDPj6UDNd3icKr6fJ+X3ey8X+T
#stripe.pk=pk_test_y5dXLjyUyBD11Ta9g2DGynxN0048vnmpGz
#stripe.sk=+RFm7p84hym4liN1/MSoshYMiy4rWgUFoZ3S5+ucxRTyzblQL2Pi0y1TDQoSE96z
##################stripe公钥(不加密)和私钥(已用 AESUtils 加密)################################
#stripe.pk=pk_live_5MdXU4N1cvmU1yatYp5v0E0n00C7tAXpGB
#stripe.sk=d87UqTQ6QUjuNkXrjH51Gl/Zqnfy98HRl23xljism2hpaXjSNTwdl6pv6FM7D4tT
#stripe.pk=pk_test_rXUSgU8Kw7DLhDzMbHM0r55O00JAzVBBJR
#stripe.sk=3ff57yz9S5INBexBOnzi/ZaxClXkXlJ+FZ6XLc/f2vpESScG7YOaQaG2YNRic3HF
stripe.pk=pk_test_rXUSgU8Kw7DLhDzMbHM0r55O00JAzVBBJR
stripe.sk=3ff57yz9S5INBexBOnzi/ZaxClXkXlJ+FZ6XLc/f2vpESScG7YOaQaG2YNRic3HF
######################outlook的账户公钥密钥#####################
#stripe.pk=pk_test_uljWJWUuD8fzZXPlGtDZ1fxx00o1ZKr7QL
#stripe.sk=BbLXgo+ohgrAP7p3tB52YTqNwhAiTYzYWAX0W+/1PES6kOupxwc/7xpAR8QsG6gP
######################outlook的账户公钥密钥 END#####################
##################stripe公钥和私钥 END###############################
#############################第三方物流公司接口#################################
express.info.api=http://shd.kjwlxt.com/api/track.php
express.info.user_no=shd806
......@@ -62,7 +54,11 @@ express.info.token=d44426bd5b64dd2
#paypal.client.app=AW7u5JVLhzA7_0EznoZ7uKHFzz1_nACOtt6k9oEpbisGUy3nqjjb3L-MmBFnD3YDuMSapcXpfSiYWtiB
#paypal.client.secret=EIyDryMDyM0BDWp2mtuGFdSU2WOkWtmSuGGaRnUiIom7kxuM7JhuSFfETbC8X4e9E_ZbMX4zg4jHA1lV
paypal.mode=live
paypal.client.app=AWbyqn1AKJeVvzNsYms_9fs_LVr5_w5Xyt8nX5q0Wmqoq0NYCZf2wyz9DDeA5ArsWx0LFBwl5Oz6amD2
paypal.client.secret=EFhRjCBzhtI1lf88Xiy3VF07gVpu1vWk0VheSP3n5J0fhQxA6Pu7j89dbyYTLj3FxqiJBOlxQRKG_58e
paypal.success.url=http://127.0.0.1:8083/paypal/success
paypal.cancel.url=http://127.0.0.1:8083/paypal/cancel
\ No newline at end of file
#################################真实######################################################
#paypal.client.app=AUUFVT30kPIP-a7dcQfPS8KYdl5cCZIwyYNIS79Cp7E_0GNZWfut3ZHQiRIoamqRstHigMoTTy1n8Glj
#paypal.client.secret=EJBVz86f9Mg482bL3lniPtLYe_ULyBkjTS0q-qhZBIVFC3dgae-J7-JJA5iWQAZsQqtAOV_ctVGWNLJS
#################################测试######################################################
paypal.client.app=AW7u5JVLhzA7_0EznoZ7uKHFzz1_nACOtt6k9oEpbisGUy3nqjjb3L-MmBFnD3YDuMSapcXpfSiYWtiB
paypal.client.secret=EIyDryMDyM0BDWp2mtuGFdSU2WOkWtmSuGGaRnUiIom7kxuM7JhuSFfETbC8X4e9E_ZbMX4zg4jHA1lV
paypal.success.url=http://localhost:8083/zion/paypal/success
paypal.cancel.url=http://localhost:8083/zion/paypal/cancel
\ No newline at end of file
package com.diaoyun.zion;
import com.diaoyun.zion.master.util.JsoupUtil;
import com.egzosn.pay.common.api.PayService;
import com.egzosn.pay.common.bean.CurType;
import com.egzosn.pay.common.bean.MethodType;
......@@ -8,13 +9,18 @@ import com.egzosn.pay.common.http.HttpConfigStorage;
import com.egzosn.pay.paypal.api.PayPalConfigStorage;
import com.egzosn.pay.paypal.api.PayPalPayService;
import com.egzosn.pay.paypal.bean.PayPalTransactionType;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.paypal.api.payments.Links;
import net.sf.json.JSONObject;
import javax.servlet.http.HttpServletRequest;
import java.awt.image.BufferedImage;
import java.math.BigDecimal;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
/**
......@@ -30,24 +36,32 @@ public class PayTest {
public static void main(String[] args) {
PayPalConfigStorage storage = new PayPalConfigStorage();
storage.setClientID("AWbyqn1AKJeVvzNsYms_9fs_LVr5_w5Xyt8nX5q0Wmqoq0NYCZf2wyz9DDeA5ArsWx0LFBwl5Oz6amD2");
storage.setClientSecret("EFhRjCBzhtI1lf88Xiy3VF07gVpu1vWk0VheSP3n5J0fhQxA6Pu7j89dbyYTLj3FxqiJBOlxQRKG_58e");
//storage.setTest(true);
storage.setClientID("AW7u5JVLhzA7_0EznoZ7uKHFzz1_nACOtt6k9oEpbisGUy3nqjjb3L-MmBFnD3YDuMSapcXpfSiYWtiB");
storage.setClientSecret("EIyDryMDyM0BDWp2mtuGFdSU2WOkWtmSuGGaRnUiIom7kxuM7JhuSFfETbC8X4e9E_ZbMX4zg4jHA1lV");
storage.setTest(true);
//发起付款后的页面转跳地址
storage.setReturnUrl("http://127.0.0.1:8083/pay/success");
storage.setReturnUrl("http://localhost:8083/zion/paypal/success?orderId=d56afd2ab3134dee87b6ba7dc88c4c8c");
//取消按钮转跳地址,这里用异步通知地址的兼容的做法
storage.setNotifyUrl("http://127.0.0.1:8083/pay/cancel");
storage.setNotifyUrl("http://localhost:8083/zion/paypal/cancel");
HttpConfigStorage httpConfigStorage = new HttpConfigStorage();
PayService service = new PayPalPayService(storage);
BigDecimal price = new BigDecimal("500");
PayOrder order = new PayOrder("Order_payment:", "Order payment", price, UUID.randomUUID().toString().replace("-", ""), PayPalTransactionType.sale);
Map orderInfo = service.orderInfo(order);
String request = service.buildRequest(orderInfo, MethodType.POST);
System.out.println(request);
// String payId =(String) orderInfo.get("id");
// System.out.println("orderInfo====>>>"+orderInfo);
// System.out.println("links====>>>"+orderInfo.get("links"));
// String request = service.buildRequest(orderInfo, MethodType.POST);
// System.out.println(request);
// Set set = orderInfo.entrySet();
// Iterator iterator = set.iterator();
// while (iterator.hasNext()){
// System.out.println(iterator.next());
// }
System.out.println(orderInfo.get("links"));
Map<String, String> orderHref = JsoupUtil.getOrderHref(orderInfo.toString());
System.out.println(orderHref.get("approval_url"));
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论