Browse Source

增加退款异步通知

test 6 months ago
parent
commit
04bfcaf5b8
4 changed files with 39 additions and 2 deletions
  1. 16 0
      build/cool/temp/eps.d.ts
  2. 0 0
      build/cool/temp/eps.json
  3. 23 2
      src/modules/dj/views/refund.vue
  4. 0 0
      stats.html

+ 16 - 0
build/cool/temp/eps.d.ts

@@ -1126,6 +1126,10 @@ declare namespace Eps {
 		 * 订单状态 0-退款中 1 退款成功 2 退款失败
 		 */
 		status?: boolean;
+		/**
+		 * 通知地址
+		 */
+		notifyUrl?: string;
 		/**
 		 * 备注
 		 */
@@ -3180,6 +3184,10 @@ declare namespace Eps {
 		 * 交易订单回调通知
 		 */
 		notifyOrder(data?: any): Promise<any>;
+		/**
+		 * gppay订单回调通知
+		 */
+		notifyOrder(data?: any): Promise<any>;
 		/**
 		 * ACH订单回调通知
 		 */
@@ -3298,6 +3306,7 @@ declare namespace Eps {
 			notifyOrder: string;
 			notifyOrder: string;
 			notifyOrder: string;
+			notifyOrder: string;
 			getCustomer: string;
 			toAdvanced: string;
 			countries: string;
@@ -3334,6 +3343,7 @@ declare namespace Eps {
 			notifyOrder: boolean;
 			notifyOrder: boolean;
 			notifyOrder: boolean;
+			notifyOrder: boolean;
 			getCustomer: boolean;
 			toAdvanced: boolean;
 			countries: boolean;
@@ -3631,6 +3641,10 @@ declare namespace Eps {
 	}
 
 	interface DjRefund {
+		/**
+		 * 通知
+		 */
+		notify(data?: any): Promise<any>;
 		/**
 		 * 修改
 		 */
@@ -3667,6 +3681,7 @@ declare namespace Eps {
 		 * 权限标识
 		 */
 		permission: {
+			notify: string;
 			update: string;
 			query: string;
 			info: string;
@@ -3679,6 +3694,7 @@ declare namespace Eps {
 		 * 权限状态
 		 */
 		_permission: {
+			notify: boolean;
 			update: boolean;
 			query: boolean;
 			info: boolean;

File diff suppressed because it is too large
+ 0 - 0
build/cool/temp/eps.json


+ 23 - 2
src/modules/dj/views/refund.vue

@@ -194,11 +194,12 @@ const Table = useTable({
 		{ prop: "outOrderNo", label: "商户订单号", showOverflowTooltip: true, width: 120 },
 		{ prop: "traceNo", label: "交易号", showOverflowTooltip: true, width: 120 },
 		{ prop: "remark", label: "备注", showOverflowTooltip: true, width: 120 },
+		{ prop: "notifyUrl", label: "异步回调", showOverflowTooltip: true, width: 120 },
 		{
 			type: "op",
 			width: 120,
 			buttons({ scope }) {
-				return [
+				const btns = [
 					{
 						label: "API查单",
 						type: "primary",
@@ -219,7 +220,27 @@ const Table = useTable({
 							}
 						}
 					}
-				];
+				]
+				if ((+scope.row.status === 1 || +scope.row.status === 2) && scope.row.notifyUrl) {
+					if (checkPerm(service.dj.order.permission.notify)) {
+						btns.push({
+							label: "补发通知",
+							type: "success",
+							async onClick({ scope }: any) {
+								const { status, msg = "" } = await service.dj.refund.notify({
+									id: scope.row.id
+								});
+								if (+status === 1) {
+									ElMessage.success("补发通知成功!");
+									Crud.value?.refresh();
+								} else {
+									ElMessage.error("通知失败,失败原因:" + JSON.stringify(msg));
+								}
+							}
+						});
+					}
+				}
+				return btns;
 			}
 		}
 	]

File diff suppressed because it is too large
+ 0 - 0
stats.html


Some files were not shown because too many files changed in this diff