mirror of
https://github.com/abcv7/sfbx-cloud.git
synced 2026-08-16 19:49:49 +00:00
first commit
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.itheima.sfbx</groupId>
|
||||
<artifactId>sfbx-trade</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<!--支付接口模块-->
|
||||
<artifactId>trade-interface</artifactId>
|
||||
<name>trade-interface</name>
|
||||
<!-- FIXME change it to the project's website -->
|
||||
<url>http://www.example.com</url>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.itheima.sfbx</groupId>
|
||||
<artifactId>framework-feign</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.itheima.sfbx.trade.config;
|
||||
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @ClassName DictFenginConfig.java
|
||||
* @Description feign的最优化配置
|
||||
*/
|
||||
@EnableFeignClients(basePackages = "com.itheima.sfbx.trade.feign")
|
||||
@Configuration
|
||||
public class TradeFeignConfig {
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.itheima.sfbx.trade.feign;
|
||||
|
||||
import com.itheima.sfbx.framework.commons.dto.trade.TradeVO;
|
||||
import com.itheima.sfbx.trade.hystrix.AppPayHystrix;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* @ClassName AppPayFeign.java
|
||||
* @Description App方式支付feign接口
|
||||
*/
|
||||
@FeignClient(value = "trade-web",fallback = AppPayHystrix.class )
|
||||
public interface AppPayFeign {
|
||||
|
||||
/***
|
||||
* @description 外部商户APP唤起快捷SDK创建订单并支付
|
||||
* @param tradeVO 订单
|
||||
* @return TradeVO对象中的placeOrderJson:阿里云form表单字符串、微信prepay_id标识
|
||||
*/
|
||||
@PostMapping("trade-app-feign/app-trade")
|
||||
TradeVO appTrade(@RequestBody TradeVO tradeVO);
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
package com.itheima.sfbx.trade.feign;
|
||||
|
||||
import com.itheima.sfbx.trade.hystrix.CommonPayHystrix;
|
||||
import com.itheima.sfbx.framework.commons.dto.trade.RefundRecordVO;
|
||||
import com.itheima.sfbx.framework.commons.dto.trade.TradeVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* @ClassName CommonPayFeign.java
|
||||
* @Description 基础支付处理能力feign接口
|
||||
*/
|
||||
@FeignClient(value = "trade-web",fallback = CommonPayHystrix.class )
|
||||
public interface CommonPayFeign {
|
||||
|
||||
/***
|
||||
* @description 查看二维码信息
|
||||
* 收银员通过收银台或商户后台调用此接口,生成二维码后,展示给用户,商户可以多次展示二维码
|
||||
* @param tradeVO 交易单
|
||||
* @return 二维码路径
|
||||
*/
|
||||
@PostMapping("trade-common-feign/query-qr-code")
|
||||
String queryQrCode(@RequestBody TradeVO tradeVO);
|
||||
|
||||
/***
|
||||
* @description 统一收单线下交易查询
|
||||
* 该接口提供所有支付订单的查询,商户可以通过该接口主动查询订单状态,完成下一步的业务逻辑。
|
||||
* @param tradeVO 交易单
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("trade-common-feign/query")
|
||||
TradeVO queryTrade(@RequestBody TradeVO tradeVO);
|
||||
|
||||
/***
|
||||
* @description 统一收单交易退款接口
|
||||
* 当交易发生之后一段时间内,由于买家或者卖家的原因需要退款时,卖家可以通过退款接口将支付款退还给买家,
|
||||
* 将在收到退款请求并且验证成功之后,按照退款规则将支付款按原路退到买家帐号上。
|
||||
* @param tradeVO 交易单
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("trade-common-feign/refund")
|
||||
TradeVO refundTrade(@RequestBody TradeVO tradeVO);
|
||||
|
||||
/***
|
||||
* @description 统一收单交易退款查询接口
|
||||
* 当交易发生之后一段时间内,由于买家或者卖家的原因需要退款时,卖家可以通过退款接口将支付款退还给买家,
|
||||
* 将在收到退款请求并且验证成功之后,按照退款规则将支付款按原路退到买家帐号上。
|
||||
* @param refundRecordVO 退款交易单
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("trade-common-feign/query-refund")
|
||||
void queryRefundTrade(@RequestBody RefundRecordVO refundRecordVO);
|
||||
|
||||
/***
|
||||
* @description 统一关闭订单
|
||||
* 1、商户订单支付失败需要生成新单号重新发起支付,要对原订单号调用关单,避免重复支付;
|
||||
* 2、系统下单后,用户支付超时,系统退出不再受理,避免用户继续,请调用关单接口。
|
||||
* @param tradeVO 退款交易单
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("trade-common-feign/close-refund")
|
||||
TradeVO closeTrade(@RequestBody TradeVO tradeVO);
|
||||
|
||||
/***
|
||||
* @description 计划任务:同步交易单结果
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("trade-common-feign/sync-payment-job")
|
||||
Boolean syncPaymentJob();
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.itheima.sfbx.trade.feign;
|
||||
|
||||
import com.itheima.sfbx.trade.hystrix.FaceToFacePayHystrix;
|
||||
import com.itheima.sfbx.framework.commons.dto.trade.TradeVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* @ClassName FaceToFacePayFeign.java
|
||||
* @Description 面对面支付接口
|
||||
*/
|
||||
@FeignClient(value = "trade-web",fallback = FaceToFacePayHystrix.class )
|
||||
public interface FaceToFacePayFeign {
|
||||
|
||||
/***
|
||||
* @description 扫用户出示的付款码,完成付款
|
||||
* @param tradeVO 订单
|
||||
* @return 支付结果
|
||||
*/
|
||||
@PostMapping("trade-face-to-face-feign/pay")
|
||||
TradeVO pay(@RequestBody TradeVO tradeVO);
|
||||
|
||||
/***
|
||||
* @description 生成交易付款码,待用户扫码付款
|
||||
* @param tradeVO 订单
|
||||
* @return 二维码路径
|
||||
*/
|
||||
@PostMapping("trade-face-to-face-feign/precreate")
|
||||
TradeVO precreate(@RequestBody TradeVO tradeVO);
|
||||
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.itheima.sfbx.trade.feign;
|
||||
|
||||
import com.itheima.sfbx.trade.hystrix.PagePayHystrix;
|
||||
import com.itheima.sfbx.framework.commons.dto.trade.TradeVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* @ClassName PagePayFeign.java
|
||||
* @Description PC网页支付feign接口
|
||||
*/
|
||||
@FeignClient(value = "trade-web",fallback = PagePayHystrix.class )
|
||||
public interface PagePayFeign {
|
||||
|
||||
/***
|
||||
* @description 生成交易表单,渲染后自动跳转支付宝或者微信引导用户完成支付
|
||||
* @param tradeVO 订单单
|
||||
* @return TradeVO对象中的placeOrderJson:阿里云form表单字符串、微信prepay_id标识
|
||||
*/
|
||||
@PostMapping("trade-page-feign/page-trade")
|
||||
TradeVO pageTrade(@RequestBody TradeVO tradeVO);
|
||||
}
|
||||
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
package com.itheima.sfbx.trade.feign;
|
||||
|
||||
import com.itheima.sfbx.framework.commons.dto.trade.TradeVO;
|
||||
import com.itheima.sfbx.trade.hystrix.WapPayHystrix;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* @ClassName WapPayFeign.java
|
||||
* @Description 手机网页支付feign接口
|
||||
*/
|
||||
@FeignClient(value = "trade-web",fallback = WapPayHystrix.class )
|
||||
public interface PeriodicPayFeign {
|
||||
|
||||
/***
|
||||
* @description app签约并支付
|
||||
* @param tradeVO 交易单
|
||||
* @return 交易单
|
||||
*/
|
||||
@PostMapping("trade-periodic-feign/app-pay-sign")
|
||||
TradeVO appPaySign(@RequestBody TradeVO tradeVO);
|
||||
|
||||
/***
|
||||
* @description h5签约
|
||||
* @param tradeVO 交易单
|
||||
* @return 交易单
|
||||
*/
|
||||
@PostMapping("trade-periodic-feign/h5-sign-contract")
|
||||
TradeVO h5SignContract(@RequestBody TradeVO tradeVO);
|
||||
|
||||
/***
|
||||
* @description h5签约代扣
|
||||
* @param tradeVO 交易单
|
||||
* @return 交易单
|
||||
*/
|
||||
@PostMapping("trade-periodic-feign/h5-periodic-pay")
|
||||
TradeVO h5PeriodicPay(@RequestBody TradeVO tradeVO);
|
||||
|
||||
/***
|
||||
* @description 签约同步
|
||||
* @param warrantyNo 合同编号
|
||||
* @param tradingChannel 支付渠道
|
||||
* @param agreementNo 支付签约号
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("trade-periodic-feign/sign-contract-sync/{warrantyNo}/{tradingChannel}/{agreementNo}")
|
||||
Boolean signContractSync(@PathVariable("warrantyNo") String warrantyNo,
|
||||
@PathVariable("tradingChannel")String tradingChannel,
|
||||
@PathVariable("agreementNo")String agreementNo);
|
||||
|
||||
/***
|
||||
* @description 关闭h5签约
|
||||
* @param warrantyNo 合同号
|
||||
* @param tradingChannel 渠道号
|
||||
* @return 交易单
|
||||
*/
|
||||
@PostMapping("trade-periodic-feign/h5-close-sign-contract/{warrantyNo}/{tradingChannel}")
|
||||
Boolean h5CloseSignContract(@PathVariable("warrantyNo") String warrantyNo,
|
||||
@PathVariable("tradingChannel")String tradingChannel);
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.itheima.sfbx.trade.feign;
|
||||
|
||||
import com.itheima.sfbx.trade.hystrix.WapPayHystrix;
|
||||
import com.itheima.sfbx.framework.commons.dto.trade.TradeVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* @ClassName WapPayFeign.java
|
||||
* @Description 手机网页支付feign接口
|
||||
*/
|
||||
@FeignClient(value = "trade-web",fallback = WapPayHystrix.class )
|
||||
public interface WapPayFeign {
|
||||
|
||||
/***
|
||||
* @description 生成交易表单,渲染后自动跳转支付宝或者微信引导用户完成支付
|
||||
* @param tradeVO 订单单
|
||||
* @return TradeVO对象中的placeOrderJson:阿里云form表单字符串、微信prepay_id标识
|
||||
*/
|
||||
@PostMapping("trade-wap-feign/wap-trade")
|
||||
TradeVO wapTrade(@RequestBody TradeVO tradeVO);
|
||||
|
||||
/***
|
||||
* @description 生成交易表单,渲染后自动跳转支付宝或者微信引导用户完成支付
|
||||
* @param tradeVO 订单单
|
||||
* @return TradeVO对象中的placeOrderJson:阿里云form表单字符串、微信prepay_id标识
|
||||
*/
|
||||
@PostMapping("trade-common-feign/close")
|
||||
TradeVO closeTrade(@RequestBody TradeVO tradeVO);
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.itheima.sfbx.trade.hystrix;
|
||||
|
||||
import com.itheima.sfbx.trade.feign.AppPayFeign;
|
||||
import com.itheima.sfbx.framework.commons.dto.trade.TradeVO;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @ClassName AppPayHystrix.java
|
||||
* @Description TODO
|
||||
*/
|
||||
@Component
|
||||
public class AppPayHystrix implements AppPayFeign {
|
||||
|
||||
|
||||
@Override
|
||||
public TradeVO appTrade(TradeVO tradeVO) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package com.itheima.sfbx.trade.hystrix;
|
||||
|
||||
import com.itheima.sfbx.trade.feign.CommonPayFeign;
|
||||
import com.itheima.sfbx.framework.commons.dto.trade.RefundRecordVO;
|
||||
import com.itheima.sfbx.framework.commons.dto.trade.TradeVO;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @ClassName CommonPayHystrix.java
|
||||
* @Description TODO
|
||||
*/
|
||||
@Component
|
||||
public class CommonPayHystrix implements CommonPayFeign {
|
||||
|
||||
|
||||
@Override
|
||||
public String queryQrCode(TradeVO tradeVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TradeVO queryTrade(TradeVO tradeVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TradeVO refundTrade(TradeVO tradeVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void queryRefundTrade(RefundRecordVO refundRecordVO) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public TradeVO closeTrade(TradeVO tradeVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean syncPaymentJob() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.itheima.sfbx.trade.hystrix;
|
||||
|
||||
import com.itheima.sfbx.trade.feign.FaceToFacePayFeign;
|
||||
import com.itheima.sfbx.framework.commons.dto.trade.TradeVO;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @ClassName FaceToFacePayHystrix.java
|
||||
* @Description FaceToFacePayFeign的Hystrix i
|
||||
*/
|
||||
@Component
|
||||
public class FaceToFacePayHystrix implements FaceToFacePayFeign {
|
||||
|
||||
|
||||
@Override
|
||||
public TradeVO pay(TradeVO tradeVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TradeVO precreate(TradeVO tradeVO) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.itheima.sfbx.trade.hystrix;
|
||||
|
||||
import com.itheima.sfbx.trade.feign.PagePayFeign;
|
||||
import com.itheima.sfbx.framework.commons.dto.trade.TradeVO;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @ClassName PagePayHystrix.java
|
||||
* @Description TODO
|
||||
*/
|
||||
@Component
|
||||
public class PagePayHystrix implements PagePayFeign {
|
||||
|
||||
@Override
|
||||
public TradeVO pageTrade(TradeVO tradeVO) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.itheima.sfbx.trade.hystrix;
|
||||
|
||||
import com.itheima.sfbx.trade.feign.WapPayFeign;
|
||||
import com.itheima.sfbx.framework.commons.dto.trade.TradeVO;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @ClassName WapPayHystrix.java
|
||||
* @Description TODO
|
||||
*/
|
||||
@Component
|
||||
public class WapPayHystrix implements WapPayFeign {
|
||||
|
||||
|
||||
@Override
|
||||
public TradeVO wapTrade(TradeVO tradeVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TradeVO closeTrade(TradeVO tradeVO) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user