zova-module-a-pay 5.0.7 → 5.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,7 +18,7 @@ declare module 'zova-module-a-pay' {
18
18
  }
19
19
  /** model: end */
20
20
  /** model: begin */
21
- import { ModelPaymentSession } from '../model/paymentSession.js';
21
+ import type { ModelPaymentSession } from '../model/paymentSession.js';
22
22
  import 'zova';
23
23
  declare module 'zova' {
24
24
  interface IBeanRecordGeneral {
@@ -41,7 +41,7 @@ declare module 'zova-module-a-pay' {
41
41
  }
42
42
  /** api: end */
43
43
  /** api: begin */
44
- import { ApiPayPaymentSession } from '../api/payPaymentSession.js';
44
+ import type { ApiPayPaymentSession } from '../api/payPaymentSession.js';
45
45
  export interface IModuleApi {
46
46
  'payPaymentSession': ApiPayPaymentSession;
47
47
  }
@@ -72,7 +72,7 @@ declare module 'zova-module-a-pay' {
72
72
  }
73
73
  /** apiSchema: end */
74
74
  /** apiSchema: begin */
75
- import { ApiSchemaPayPaymentSession } from '../apiSchema/payPaymentSession.js';
75
+ import type { ApiSchemaPayPaymentSession } from '../apiSchema/payPaymentSession.js';
76
76
  export interface IModuleApiSchema {
77
77
  'payPaymentSession': ApiSchemaPayPaymentSession;
78
78
  }
@@ -103,7 +103,7 @@ declare module 'zova-module-a-pay' {
103
103
  }
104
104
  /** service: end */
105
105
  /** service: begin */
106
- import { ServicePaymentCoordinator } from '../service/paymentCoordinator.js';
106
+ import type { ServicePaymentCoordinator } from '../service/paymentCoordinator.js';
107
107
  import 'zova';
108
108
  declare module 'zova' {
109
109
  interface IBeanRecordGeneral {
@@ -111,47 +111,6 @@ declare module 'zova' {
111
111
  }
112
112
  }
113
113
  /** service: end */
114
- /** controller: begin */
115
- export * from '../component/paymentNextAction/controller.jsx';
116
- import 'zova';
117
- declare module 'zova' {
118
- }
119
- declare module 'zova-module-a-pay' {
120
- interface ControllerPaymentNextAction {
121
- }
122
- }
123
- /** controller: end */
124
- /** controller: begin */
125
- import { ControllerPaymentNextAction } from '../component/paymentNextAction/controller.jsx';
126
- import 'zova';
127
- declare module 'zova' {
128
- interface IBeanRecordLocal {
129
- 'a-pay.controller.paymentNextAction': ControllerPaymentNextAction;
130
- }
131
- }
132
- /** controller: end */
133
- /** components: begin */
134
- export * from './component/paymentNextAction.js';
135
- import { ZPaymentNextAction } from './component/paymentNextAction.js';
136
- export declare const components: {
137
- paymentNextAction: import("vue").DefineSetupFnComponent<import("zova-module-a-pay").ZPaymentNextActionProps, import("vue").EmitsOptions, import("vue").SlotsType<Record<string, any>>, {
138
- controllerRef?: (ref: ControllerPaymentNextAction) => void;
139
- } & import("zova-module-a-pay").ControllerPaymentNextActionProps & ({
140
- [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
141
- } | {
142
- [x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
143
- }), import("vue").PublicProps>;
144
- };
145
- import 'zova';
146
- declare module 'zova' {
147
- interface IComponentRecord {
148
- 'a-pay:paymentNextAction': ControllerPaymentNextAction;
149
- }
150
- interface IZovaComponentRecord {
151
- 'a-pay:paymentNextAction': typeof ZPaymentNextAction;
152
- }
153
- }
154
- /** components: end */
155
114
  /** scope: begin */
156
115
  import { BeanScopeBase, type BeanScopeUtil } from 'zova';
157
116
  export declare class ScopeModuleAPay extends BeanScopeBase {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/.metadata/index.ts"],"names":[],"mappings":"AACA,mBAAmB;AACnB,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,qBAAqB,CAAC;AAC7B,OAAO,QAAQ,qBAAqB,CAAC;IAEjC,UAAiB,YAAY;QAC3B,sBAAsB,EAAE,2BAA2B,CAAC;KACrD;CAGJ;AACD,OAAO,QAAQ,mBAAmB,CAAC;IAE3B,UAAiB,mBAAmB;KAGnC;IAED,UAAiB,m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@@ -1,11 +1,12 @@
1
- import { BeanBase, BeanControllerBase, BeanInfo, BeanScopeBase, Use, prepareComponentOptions, useController } from "zova";
1
+ import { BeanBase, BeanInfo, BeanScopeBase } from "zova";
2
2
  import { BeanModelBase, Model } from "zova-module-a-model";
3
3
  import { Api, ApiSchema, BeanApiBase } from "zova-module-a-api";
4
- import { Controller, Scope, Service } from "zova-module-a-bean";
5
- import { createVNode, defineComponent } from "vue";
4
+ import { Scope, Service } from "zova-module-a-bean";
6
5
  //#region src/model/paymentSession.ts
7
- var _dec$5, _dec2$5, _class$5;
8
- var ModelPaymentSession = (_dec$5 = Model(), _dec2$5 = BeanInfo({ module: "a-pay" }), _dec$5(_class$5 = _dec2$5(_class$5 = class ModelPaymentSession extends BeanModelBase {
6
+ var _dec$4;
7
+ var _dec2$4;
8
+ var _class$4;
9
+ var ModelPaymentSession = (_dec$4 = Model(), _dec2$4 = BeanInfo({ module: "a-pay" }), _dec$4(_class$4 = _dec2$4(_class$4 = class ModelPaymentSession extends BeanModelBase {
9
10
  view(id) {
10
11
  if (this.$ssr.cookieDisabledOnServer) return;
11
12
  if (!this.$passport.isAuthenticated) return;
@@ -38,7 +39,7 @@ var ModelPaymentSession = (_dec$5 = Model(), _dec2$5 = BeanInfo({ module: "a-pay
38
39
  }
39
40
  });
40
41
  }
41
- }) || _class$5) || _class$5);
42
+ }) || _class$4) || _class$4);
42
43
  //#endregion
43
44
  //#region src/api/openapi/baseURL.ts
44
45
  var OpenApiBaseURL = (sys) => {
@@ -46,14 +47,16 @@ var OpenApiBaseURL = (sys) => {
46
47
  };
47
48
  //#endregion
48
49
  //#region src/api/payPaymentSession.ts
49
- var _dec$4, _dec2$4, _class$4;
50
+ var _dec$3;
51
+ var _dec2$3;
52
+ var _class$3;
50
53
  /** PayPaymentSession_start */
51
54
  var ApiApiPayPaymentSessionstartPath = "/api/pay/payment-session/{id}/start";
52
55
  /** PayPaymentSession_reconcile */
53
56
  var ApiApiPayPaymentSessionreconcilePath = "/api/pay/payment-session/{id}/reconcile";
54
57
  /** PayPaymentSession_view */
55
58
  var ApiApiPayPaymentSessionviewPath = "/api/pay/payment-session/{id}";
56
- var ApiPayPaymentSession = (_dec$4 = Api(), _dec2$4 = BeanInfo({ module: "a-pay" }), _dec$4(_class$4 = _dec2$4(_class$4 = class ApiPayPaymentSession extends BeanApiBase {
59
+ var ApiPayPaymentSession = (_dec$3 = Api(), _dec2$3 = BeanInfo({ module: "a-pay" }), _dec$3(_class$3 = _dec2$3(_class$3 = class ApiPayPaymentSession extends BeanApiBase {
57
60
  start(body, options) {
58
61
  return this.$fetch.post(this.$pathTranslate("/api/pay/payment-session/{id}/start", options.params), body, this.$configPrepare(OpenApiBaseURL(this.sys), options, true));
59
62
  }
@@ -63,11 +66,13 @@ var ApiPayPaymentSession = (_dec$4 = Api(), _dec2$4 = BeanInfo({ module: "a-pay"
63
66
  view(options) {
64
67
  return this.$fetch.get(this.$pathTranslate("/api/pay/payment-session/{id}", options.params), this.$configPrepare(OpenApiBaseURL(this.sys), options, true));
65
68
  }
66
- }) || _class$4) || _class$4);
69
+ }) || _class$3) || _class$3);
67
70
  //#endregion
68
71
  //#region src/apiSchema/payPaymentSession.ts
69
- var _dec$3, _dec2$3, _class$3;
70
- var ApiSchemaPayPaymentSession = (_dec$3 = ApiSchema(), _dec2$3 = BeanInfo({ module: "a-pay" }), _dec$3(_class$3 = _dec2$3(_class$3 = class ApiSchemaPayPaymentSession extends BeanBase {
72
+ var _dec$2;
73
+ var _dec2$2;
74
+ var _class$2;
75
+ var ApiSchemaPayPaymentSession = (_dec$2 = ApiSchema(), _dec2$2 = BeanInfo({ module: "a-pay" }), _dec$2(_class$2 = _dec2$2(_class$2 = class ApiSchemaPayPaymentSession extends BeanBase {
71
76
  start(options) {
72
77
  return this.$sdk.createApiSchemas("/api/pay/payment-session/{id}/start", "post", options);
73
78
  }
@@ -77,92 +82,29 @@ var ApiSchemaPayPaymentSession = (_dec$3 = ApiSchema(), _dec2$3 = BeanInfo({ mod
77
82
  view(options) {
78
83
  return this.$sdk.createApiSchemas("/api/pay/payment-session/{id}", "get", options);
79
84
  }
80
- }) || _class$3) || _class$3);
85
+ }) || _class$2) || _class$2);
81
86
  //#endregion
82
87
  //#region src/service/paymentCoordinator.ts
83
- var _dec$2, _dec2$2, _class$2;
84
- var ServicePaymentCoordinator = (_dec$2 = Service(), _dec2$2 = BeanInfo({ module: "a-pay" }), _dec$2(_class$2 = _dec2$2(_class$2 = class ServicePaymentCoordinator extends BeanBase {
88
+ var _dec$1;
89
+ var _dec2$1;
90
+ var _class$1;
91
+ var ServicePaymentCoordinator = (_dec$1 = Service(), _dec2$1 = BeanInfo({ module: "a-pay" }), _dec$1(_class$1 = _dec2$1(_class$1 = class ServicePaymentCoordinator extends BeanBase {
85
92
  async execute(action) {
86
93
  if (action.kind !== "redirect") return;
87
94
  if (!process.env.CLIENT) return;
88
95
  window.location.assign(action.url);
89
96
  }
90
- }) || _class$2) || _class$2);
91
- //#endregion
92
- //#region src/component/paymentNextAction/controller.tsx
93
- var _dec$1, _dec2$1, _dec3, _dec4, _class$1, _class2, _descriptor, _ControllerPaymentNextAction;
94
- function _initializerDefineProperty(e, i, r, l) {
95
- r && Object.defineProperty(e, i, {
96
- enumerable: r.enumerable,
97
- configurable: r.configurable,
98
- writable: r.writable,
99
- value: r.initializer ? r.initializer.call(l) : void 0
100
- });
101
- }
102
- function _applyDecoratedDescriptor(i, e, r, n, l) {
103
- var a = {};
104
- return Object.keys(n).forEach(function(i) {
105
- a[i] = n[i];
106
- }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function(r, n) {
107
- return n(i, e, r) || r;
108
- }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a;
109
- }
110
- var ControllerPaymentNextAction = (_dec$1 = Controller(), _dec2$1 = BeanInfo({ module: "a-pay" }), _dec3 = Use(), _dec4 = Reflect.metadata("design:type", typeof ServicePaymentCoordinator === "undefined" ? Object : ServicePaymentCoordinator), _dec$1(_class$1 = _dec2$1(_class$1 = (_class2 = (_ControllerPaymentNextAction = class ControllerPaymentNextAction extends BeanControllerBase {
111
- constructor(...args) {
112
- super(...args);
113
- _initializerDefineProperty(this, "$$paymentCoordinator", _descriptor, this);
114
- }
115
- async continueRedirect() {
116
- const action = this.$props.action;
117
- if (action?.kind !== "redirect" || this.$props.disabled) return;
118
- await this.$$paymentCoordinator.execute(action);
119
- }
120
- render() {
121
- const { action, disabled, continueToPaymentText, continueToPaymentHelpText, embeddedCheckoutUnavailableText, paymentCompletedText, paymentPreparingText, paymentPreparingRetryText, refreshPaymentStatusText, onRefresh } = this.$props;
122
- if (!action) return null;
123
- if (action.kind === "redirect") return createVNode("div", { "class": "mt-6 space-y-3" }, [createVNode("p", { "class": "text-base-content/70" }, [continueToPaymentHelpText]), createVNode("button", {
124
- "class": "btn btn-primary",
125
- "disabled": disabled,
126
- "onClick": () => this.continueRedirect()
127
- }, [continueToPaymentText])]);
128
- if (action.kind === "pending") return createVNode("div", {
129
- "class": "mt-6 space-y-3",
130
- "aria-live": "polite"
131
- }, [createVNode("p", { "class": "text-base-content/70" }, [action.retryAfterSeconds ? paymentPreparingRetryText?.(action.retryAfterSeconds) : paymentPreparingText]), onRefresh && createVNode("button", {
132
- "class": "btn btn-outline",
133
- "disabled": disabled,
134
- "onClick": () => onRefresh()
135
- }, [refreshPaymentStatusText])]);
136
- if (action.kind === "completed") return createVNode("p", {
137
- "class": "mt-6 text-base-content/70",
138
- "aria-live": "polite"
139
- }, [paymentCompletedText]);
140
- return createVNode("div", {
141
- "class": "mt-6",
142
- "aria-live": "polite"
143
- }, [createVNode("p", { "class": "text-base-content/70" }, [embeddedCheckoutUnavailableText])]);
144
- }
145
- }, _ControllerPaymentNextAction.$propsDefault = {}, _ControllerPaymentNextAction), _descriptor = _applyDecoratedDescriptor(_class2.prototype, "$$paymentCoordinator", [_dec3, _dec4], {
146
- configurable: true,
147
- enumerable: true,
148
- writable: true,
149
- initializer: null
150
- }), _class2)) || _class$1) || _class$1);
151
- //#endregion
152
- //#region src/.metadata/component/paymentNextAction.ts
153
- var ZPaymentNextAction = defineComponent((_props) => {
154
- useController(ControllerPaymentNextAction, void 0, void 0);
155
- return () => {};
156
- }, prepareComponentOptions());
97
+ }) || _class$1) || _class$1);
157
98
  //#endregion
158
99
  //#region src/.metadata/index.ts
159
- /** components: end */
100
+ /** service: end */
160
101
  /** scope: begin */
161
- var _dec, _dec2, _class;
162
- var components = { "paymentNextAction": ZPaymentNextAction };
102
+ var _dec;
103
+ var _dec2;
104
+ var _class;
163
105
  var ScopeModuleAPay = (_dec = Scope(), _dec2 = BeanInfo({ module: "a-pay" }), _dec(_class = _dec2(_class = class ScopeModuleAPay extends BeanScopeBase {}) || _class) || _class);
164
106
  /** scope: end */
165
107
  //#endregion
166
- export { ApiApiPayPaymentSessionreconcilePath, ApiApiPayPaymentSessionstartPath, ApiApiPayPaymentSessionviewPath, ApiPayPaymentSession, ApiSchemaPayPaymentSession, ControllerPaymentNextAction, ModelPaymentSession, OpenApiBaseURL, ScopeModuleAPay, ServicePaymentCoordinator, ZPaymentNextAction, components };
108
+ export { ApiApiPayPaymentSessionreconcilePath, ApiApiPayPaymentSessionstartPath, ApiApiPayPaymentSessionviewPath, ApiPayPaymentSession, ApiSchemaPayPaymentSession, ModelPaymentSession, OpenApiBaseURL, ScopeModuleAPay, ServicePaymentCoordinator };
167
109
 
168
110
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["BeanControllerBase","Use","Controller","ServicePaymentCoordinator","ControllerPaymentNextAction","_dec","_dec2","__z_BeanInfo","module","_dec3","_dec4","Reflect","metadata","Object","_class","_class2","_ControllerPaymentNextAction","constructor","args","_initializerDefineProperty","_descriptor","continueRedirect","action","$props","kind","disabled","$$paymentCoordinator","execute","render","continueToPaymentText","continueToPaymentHelpText","embeddedCheckoutUnavailableText","paymentCompletedText","paymentPreparingText","paymentPreparingRetryText","refreshPaymentStatusText","onRefresh","_createVNode","onClick","retryAfterSeconds","$propsDefault","_applyDecoratedDescriptor","prototype","configurable","enumerable","writable","initializer"],"sources":["../src/model/paymentSession.ts","../src/api/openapi/baseURL.ts","../src/api/payPaymentSession.ts","../src/apiSchema/payPaymentSession.ts","../src/service/paymentCoordinator.ts","../src/component/paymentNextAction/controller.tsx","../src/.metadata/component/paymentNextAction.ts","../src/.metadata/index.ts"],"sourcesContent":["var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { BeanModelBase, Model } from 'zova-module-a-model';\nexport let ModelPaymentSession = (_dec = Model(), _dec2 = __z_BeanInfo({\n module: \"a-pay\"\n}), _dec(_class = _dec2(_class = class ModelPaymentSession extends BeanModelBase {\n view(id) {\n if (this.$ssr.cookieDisabledOnServer) return;\n if (!this.$passport.isAuthenticated) return;\n return this.$useStateData({\n queryKey: ['view', id],\n queryFn: async () => {\n return await this.scope.api.payPaymentSession.view({\n params: {\n id\n }\n });\n }\n });\n }\n reconcile(id) {\n return this.$useMutationData({\n mutationKey: ['reconcile', id],\n mutationFn: async () => {\n return await this.scope.api.payPaymentSession.reconcile(undefined, {\n params: {\n id\n }\n });\n },\n onSuccess: async () => {\n await this.$invalidateQueries({\n queryKey: ['view', id]\n });\n }\n });\n }\n start(id) {\n return this.$useMutationData({\n mutationKey: ['start', id],\n mutationFn: async () => {\n return await this.scope.api.payPaymentSession.start(undefined, {\n params: {\n id\n }\n });\n },\n onSuccess: async () => {\n await this.$invalidateQueries({\n queryKey: ['view', id]\n });\n }\n });\n }\n}) || _class) || _class);","export const OpenApiBaseURL = sys => {\n return sys.util.getOpenApiBaseURL('OPENAPI_BASE_URL_A_PAY');\n};","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { Api, BeanApiBase } from 'zova-module-a-api';\nimport { OpenApiBaseURL } from './openapi/index.js';\n\n/** PayPaymentSession_start */\nexport const ApiApiPayPaymentSessionstartPath = '/api/pay/payment-session/{id}/start';\n/** PayPaymentSession_reconcile */\nexport const ApiApiPayPaymentSessionreconcilePath = '/api/pay/payment-session/{id}/reconcile';\n/** PayPaymentSession_view */\nexport const ApiApiPayPaymentSessionviewPath = '/api/pay/payment-session/{id}';\nexport let ApiPayPaymentSession = (_dec = Api(), _dec2 = __z_BeanInfo({\n module: \"a-pay\"\n}), _dec(_class = _dec2(_class = class ApiPayPaymentSession extends BeanApiBase {\n start(body, options) {\n return this.$fetch.post(this.$pathTranslate(ApiApiPayPaymentSessionstartPath, options.params), body, this.$configPrepare(OpenApiBaseURL(this.sys), options, true));\n }\n reconcile(body, options) {\n return this.$fetch.post(this.$pathTranslate(ApiApiPayPaymentSessionreconcilePath, options.params), body, this.$configPrepare(OpenApiBaseURL(this.sys), options, true));\n }\n view(options) {\n return this.$fetch.get(this.$pathTranslate(ApiApiPayPaymentSessionviewPath, options.params), this.$configPrepare(OpenApiBaseURL(this.sys), options, true));\n }\n}) || _class) || _class);","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { BeanBase } from 'zova';\nimport { ApiSchema } from 'zova-module-a-api';\nimport { ApiApiPayPaymentSessionstartPath, ApiApiPayPaymentSessionreconcilePath, ApiApiPayPaymentSessionviewPath } from '../api/payPaymentSession.js';\nexport let ApiSchemaPayPaymentSession = (_dec = ApiSchema(), _dec2 = __z_BeanInfo({\n module: \"a-pay\"\n}), _dec(_class = _dec2(_class = class ApiSchemaPayPaymentSession extends BeanBase {\n start(options) {\n return this.$sdk.createApiSchemas(ApiApiPayPaymentSessionstartPath, 'post', options);\n }\n reconcile(options) {\n return this.$sdk.createApiSchemas(ApiApiPayPaymentSessionreconcilePath, 'post', options);\n }\n view(options) {\n return this.$sdk.createApiSchemas(ApiApiPayPaymentSessionviewPath, 'get', options);\n }\n}) || _class) || _class);","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { BeanBase } from 'zova';\nimport { Service } from 'zova-module-a-bean';\nexport let ServicePaymentCoordinator = (_dec = Service(), _dec2 = __z_BeanInfo({\n module: \"a-pay\"\n}), _dec(_class = _dec2(_class = class ServicePaymentCoordinator extends BeanBase {\n async execute(action) {\n if (action.kind !== 'redirect') return;\n if (!process.env.CLIENT) return;\n window.location.assign(action.url);\n }\n}) || _class) || _class);","import { BeanControllerBase, Use } from 'zova';\nimport { Controller } from 'zova-module-a-bean';\n\nimport type { TypePaymentNextAction } from '../../types/payment.js';\n\nimport { ServicePaymentCoordinator } from '../../service/paymentCoordinator.js';\n\nexport interface ControllerPaymentNextActionProps {\n action?: TypePaymentNextAction;\n disabled?: boolean;\n continueToPaymentText?: string;\n continueToPaymentHelpText?: string;\n embeddedCheckoutUnavailableText?: string;\n paymentCompletedText?: string;\n paymentPreparingText?: string;\n paymentPreparingRetryText?: (retryAfterSeconds: number) => string;\n refreshPaymentStatusText?: string;\n onRefresh?: () => void | Promise<void>;\n}\n\n@Controller()\nexport class ControllerPaymentNextAction extends BeanControllerBase {\n static $propsDefault = {};\n\n @Use()\n $$paymentCoordinator: ServicePaymentCoordinator;\n\n async continueRedirect() {\n const action = this.$props.action;\n if (action?.kind !== 'redirect' || this.$props.disabled) return;\n await this.$$paymentCoordinator.execute(action);\n }\n\n protected render() {\n const {\n action,\n disabled,\n continueToPaymentText,\n continueToPaymentHelpText,\n embeddedCheckoutUnavailableText,\n paymentCompletedText,\n paymentPreparingText,\n paymentPreparingRetryText,\n refreshPaymentStatusText,\n onRefresh,\n } = this.$props as ControllerPaymentNextActionProps;\n if (!action) return null;\n if (action.kind === 'redirect') {\n return (\n <div class=\"mt-6 space-y-3\">\n <p class=\"text-base-content/70\">{continueToPaymentHelpText}</p>\n <button\n class=\"btn btn-primary\"\n disabled={disabled}\n onClick={() => this.continueRedirect()}\n >\n {continueToPaymentText}\n </button>\n </div>\n );\n }\n if (action.kind === 'pending') {\n return (\n <div class=\"mt-6 space-y-3\" aria-live=\"polite\">\n <p class=\"text-base-content/70\">\n {action.retryAfterSeconds\n ? paymentPreparingRetryText?.(action.retryAfterSeconds)\n : paymentPreparingText}\n </p>\n {onRefresh && (\n <button class=\"btn btn-outline\" disabled={disabled} onClick={() => onRefresh()}>\n {refreshPaymentStatusText}\n </button>\n )}\n </div>\n );\n }\n if (action.kind === 'completed') {\n return (\n <p class=\"mt-6 text-base-content/70\" aria-live=\"polite\">\n {paymentCompletedText}\n </p>\n );\n }\n return (\n <div class=\"mt-6\" aria-live=\"polite\">\n <p class=\"text-base-content/70\">{embeddedCheckoutUnavailableText}</p>\n </div>\n );\n }\n}\n","import { defineComponent } from 'vue';\nimport { prepareComponentOptions, useController } from 'zova';\nimport { ControllerPaymentNextAction } from '../../component/paymentNextAction/controller.jsx';\nexport const ZPaymentNextAction = defineComponent(_props => {\n useController(ControllerPaymentNextAction, undefined, undefined);\n return () => {};\n}, prepareComponentOptions());","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\n// eslint-disable\n/** model: begin */\nexport * from '../model/paymentSession.js';\nimport 'zova-module-a-model';\n/** model: end */\n/** model: begin */\nimport { ModelPaymentSession } from '../model/paymentSession.js';\nimport 'zova';\n/** model: end */\n/** api: begin */\nexport * from '../api/payPaymentSession.js';\nimport 'zova';\n/** api: end */\n/** api: begin */\nimport { ApiPayPaymentSession } from '../api/payPaymentSession.js';\n/** api: end */\n/** api: begin */\n\nimport 'zova';\n/** api: end */\n/** openapi: begin */\nexport * from '../api/openapi/index.js';\n/** openapi: end */\n/** apiSchema: begin */\nexport * from '../apiSchema/payPaymentSession.js';\nimport 'zova';\n/** apiSchema: end */\n/** apiSchema: begin */\nimport { ApiSchemaPayPaymentSession } from '../apiSchema/payPaymentSession.js';\n/** apiSchema: end */\n/** apiSchema: begin */\n\nimport 'zova';\n/** apiSchema: end */\n/** service: begin */\nexport * from '../service/paymentCoordinator.js';\nimport 'zova-module-a-bean';\n/** service: end */\n/** service: begin */\nimport { ServicePaymentCoordinator } from '../service/paymentCoordinator.js';\nimport 'zova';\n/** service: end */\n/** controller: begin */\nexport * from '../component/paymentNextAction/controller.jsx';\nimport 'zova';\n/** controller: end */\n/** controller: begin */\nimport { ControllerPaymentNextAction } from '../component/paymentNextAction/controller.jsx';\nimport 'zova';\n/** controller: end */\n\n/** components: begin */\nexport * from './component/paymentNextAction.js';\nimport { ZPaymentNextAction } from './component/paymentNextAction.js';\nexport const components = {\n 'paymentNextAction': ZPaymentNextAction\n};\nimport 'zova';\n/** components: end */\n/** scope: begin */\nimport { BeanScopeBase } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\nexport let ScopeModuleAPay = (_dec = Scope(), _dec2 = __z_BeanInfo({\n module: \"a-pay\"\n}), _dec(_class = _dec2(_class = class ScopeModuleAPay extends BeanScopeBase {}) || _class) || _class);\nimport 'zova';\n\n/** scope: end */"],"mappings":";;;;;;AAAA,IAAI,QAAM,SAAO;AAGjB,IAAW,uBAAuB,SAAO,MAAM,GAAG,UAAQ,SAAa,EACrE,QAAQ,QACV,CAAC,GAAG,OAAK,WAAS,QAAM,WAAS,MAAM,4BAA4B,cAAc;CAC/E,KAAK,IAAI;EACP,IAAI,KAAK,KAAK,wBAAwB;EACtC,IAAI,CAAC,KAAK,UAAU,iBAAiB;EACrC,OAAO,KAAK,cAAc;GACxB,UAAU,CAAC,QAAQ,EAAE;GACrB,SAAS,YAAY;IACnB,OAAO,MAAM,KAAK,MAAM,IAAI,kBAAkB,KAAK,EACjD,QAAQ,EACN,GACF,EACF,CAAC;GACH;EACF,CAAC;CACH;CACA,UAAU,IAAI;EACZ,OAAO,KAAK,iBAAiB;GAC3B,aAAa,CAAC,aAAa,EAAE;GAC7B,YAAY,YAAY;IACtB,OAAO,MAAM,KAAK,MAAM,IAAI,kBAAkB,UAAU,KAAA,GAAW,EACj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,aAAA;AAAA,CAAA,GAAA/B,QAAA,KAAAD,QAAA,KAAAA;;;ACnB3B,IAAa,qBAAqB,iBAAgB,WAAU;CAC1D,cAAc,6BAA6B,KAAA,GAAW,KAAA,CAAS;CAC/D,aAAa,CAAC;AAChB,GAAG,wBAAwB,CAAC;;;;;ACN5B,IAAI,MAAM,OAAO;AAwDjB,IAAa,aAAa,EACxB,qBAAqB,mBACvB;AAMA,IAAW,mBAAmB,OAAO,MAAM,GAAG,QAAQ,SAAa,EACjE,QAAQ,QACV,CAAC,GAAG,KAAK,SAAS,MAAM,SAAS,MAAM,wBAAwB,cAAc,CAAC,CAAC,KAAK,MAAM,KAAK"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/model/paymentSession.ts","../src/api/openapi/baseURL.ts","../src/api/payPaymentSession.ts","../src/apiSchema/payPaymentSession.ts","../src/service/paymentCoordinator.ts","../src/.metadata/index.ts"],"sourcesContent":["var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { BeanModelBase, Model } from 'zova-module-a-model';\nexport let ModelPaymentSession = (_dec = Model(), _dec2 = __z_BeanInfo({\n module: \"a-pay\"\n}), _dec(_class = _dec2(_class = class ModelPaymentSession extends BeanModelBase {\n view(id) {\n if (this.$ssr.cookieDisabledOnServer) return;\n if (!this.$passport.isAuthenticated) return;\n return this.$useStateData({\n queryKey: ['view', id],\n queryFn: async () => {\n return await this.scope.api.payPaymentSession.view({\n params: {\n id\n }\n });\n }\n });\n }\n reconcile(id) {\n return this.$useMutationData({\n mutationKey: ['reconcile', id],\n mutationFn: async () => {\n return await this.scope.api.payPaymentSession.reconcile(undefined, {\n params: {\n id\n }\n });\n },\n onSuccess: async () => {\n await this.$invalidateQueries({\n queryKey: ['view', id]\n });\n }\n });\n }\n start(id) {\n return this.$useMutationData({\n mutationKey: ['start', id],\n mutationFn: async () => {\n return await this.scope.api.payPaymentSession.start(undefined, {\n params: {\n id\n }\n });\n },\n onSuccess: async () => {\n await this.$invalidateQueries({\n queryKey: ['view', id]\n });\n }\n });\n }\n}) || _class) || _class);","export const OpenApiBaseURL = sys => {\n return sys.util.getOpenApiBaseURL('OPENAPI_BASE_URL_A_PAY');\n};","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { Api, BeanApiBase } from 'zova-module-a-api';\nimport { OpenApiBaseURL } from './openapi/index.js';\n\n/** PayPaymentSession_start */\nexport const ApiApiPayPaymentSessionstartPath = '/api/pay/payment-session/{id}/start';\n/** PayPaymentSession_reconcile */\nexport const ApiApiPayPaymentSessionreconcilePath = '/api/pay/payment-session/{id}/reconcile';\n/** PayPaymentSession_view */\nexport const ApiApiPayPaymentSessionviewPath = '/api/pay/payment-session/{id}';\nexport let ApiPayPaymentSession = (_dec = Api(), _dec2 = __z_BeanInfo({\n module: \"a-pay\"\n}), _dec(_class = _dec2(_class = class ApiPayPaymentSession extends BeanApiBase {\n start(body, options) {\n return this.$fetch.post(this.$pathTranslate(ApiApiPayPaymentSessionstartPath, options.params), body, this.$configPrepare(OpenApiBaseURL(this.sys), options, true));\n }\n reconcile(body, options) {\n return this.$fetch.post(this.$pathTranslate(ApiApiPayPaymentSessionreconcilePath, options.params), body, this.$configPrepare(OpenApiBaseURL(this.sys), options, true));\n }\n view(options) {\n return this.$fetch.get(this.$pathTranslate(ApiApiPayPaymentSessionviewPath, options.params), this.$configPrepare(OpenApiBaseURL(this.sys), options, true));\n }\n}) || _class) || _class);","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { BeanBase } from 'zova';\nimport { ApiSchema } from 'zova-module-a-api';\nimport { ApiApiPayPaymentSessionstartPath, ApiApiPayPaymentSessionreconcilePath, ApiApiPayPaymentSessionviewPath } from '../api/payPaymentSession.js';\nexport let ApiSchemaPayPaymentSession = (_dec = ApiSchema(), _dec2 = __z_BeanInfo({\n module: \"a-pay\"\n}), _dec(_class = _dec2(_class = class ApiSchemaPayPaymentSession extends BeanBase {\n start(options) {\n return this.$sdk.createApiSchemas(ApiApiPayPaymentSessionstartPath, 'post', options);\n }\n reconcile(options) {\n return this.$sdk.createApiSchemas(ApiApiPayPaymentSessionreconcilePath, 'post', options);\n }\n view(options) {\n return this.$sdk.createApiSchemas(ApiApiPayPaymentSessionviewPath, 'get', options);\n }\n}) || _class) || _class);","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { BeanBase } from 'zova';\nimport { Service } from 'zova-module-a-bean';\nexport let ServicePaymentCoordinator = (_dec = Service(), _dec2 = __z_BeanInfo({\n module: \"a-pay\"\n}), _dec(_class = _dec2(_class = class ServicePaymentCoordinator extends BeanBase {\n async execute(action) {\n if (action.kind !== 'redirect') return;\n if (!process.env.CLIENT) return;\n window.location.assign(action.url);\n }\n}) || _class) || _class);","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\n// eslint-disable\n/** model: begin */\nexport * from '../model/paymentSession.js';\nimport 'zova-module-a-model';\n/** model: end */\n/** model: begin */\n\nimport 'zova';\n/** model: end */\n/** api: begin */\nexport * from '../api/payPaymentSession.js';\nimport 'zova';\n\n/** api: end */\n/** api: begin */\n\n/** api: end */\n/** api: begin */\n\nimport 'zova';\n/** api: end */\n/** openapi: begin */\nexport * from '../api/openapi/index.js';\n/** openapi: end */\n/** apiSchema: begin */\nexport * from '../apiSchema/payPaymentSession.js';\nimport 'zova';\n\n/** apiSchema: end */\n/** apiSchema: begin */\n\n/** apiSchema: end */\n/** apiSchema: begin */\n\nimport 'zova';\n/** apiSchema: end */\n/** service: begin */\nexport * from '../service/paymentCoordinator.js';\nimport 'zova-module-a-bean';\n/** service: end */\n/** service: begin */\n\nimport 'zova';\n/** service: end */\n/** scope: begin */\nimport { BeanScopeBase } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\nexport let ScopeModuleAPay = (_dec = Scope(), _dec2 = __z_BeanInfo({\n module: \"a-pay\"\n}), _dec(_class = _dec2(_class = class ScopeModuleAPay extends BeanScopeBase {}) || _class) || _class);\nimport 'zova';\n\n/** scope: end */"],"mappings":";;;;;AAAA,IAAI;AAAM,IAAA;AAAO,IAAA;AAGjB,IAAW,uBAAuB,SAAO,MAAM,GAAG,UAAQ,SAAa,EACrE,QAAQ,QACV,CAAC,GAAG,OAAK,WAAS,QAAM,WAAS,MAAM,4BAA4B,cAAc;CAC/E,KAAK,IAAI;EACP,IAAI,KAAK,KAAK,wBAAwB;EACtC,IAAI,CAAC,KAAK,UAAU,iBAAiB;EACrC,OAAO,KAAK,cAAc;GACxB,UAAU,CAAC,QAAQ,EAAE;GACrB,SAAS,YAAY;IACnB,OAAO,MAAM,KAAK,MAAM,IAAI,kBAAkB,KAAK,EACjD,QAAQ,EACN,GACF,EACF,CAAC;GACH;EACF,CAAC;CACH;CACA,UAAU,IAAI;EACZ,OAAO,KAAK,iBAAiB;GAC3B,aAAa,CAAC,aAAa,EAAE;GAC7B,YAAY,YAAY;IACtB,OAAO,MAAM,KAAK,MAAM,IAAI,kBAAkB,UAAU,KAAA,GAAW,EACjE,QAAQ,EACN,GACF,EACF,CAAC;GACH;GACA,WAAW,YAAY;IACrB,MAAM,KAAK,mBAAmB,EAC5B,UAAU,CAAC,QAAQ,EAAE,EACvB,CAAC;GACH;EACF,CAAC;CACH;CACA,MAAM,IAAI;EACR,OAAO,KAAK,iBAAiB;GAC3B,aAAa,CAAC,SAAS,EAAE;GACzB,YAAY,YAAY;IACtB,OAAO,MAAM,KAAK,MAAM,IAAI,kBAAkB,MAAM,KAAA,GAAW,EAC7D,QAAQ,EACN,GACF,EACF,CAAC;GACH;GACA,WAAW,YAAY;IACrB,MAAM,KAAK,mBAAmB,EAC5B,UAAU,CAAC,QAAQ,EAAE,EACvB,CAAC;GACH;EACF,CAAC;CACH;AACF,CAAC,KAAK,QAAM,KAAK;;;ACtDjB,IAAa,kBAAiB,QAAO;CACnC,OAAO,IAAI,KAAK,kBAAkB,wBAAwB;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AAQ,GAAG,UAAQ,SAAa,EAC7E,QAAQ,QACV,CAAC,GAAG,OAAK,WAAS,QAAM,WAAS,MAAM,kCAAkC,SAAS;CAChF,MAAM,QAAQ,QAAQ;EACpB,IAAI,OAAO,SAAS,YAAY;EAChC,IAAI,CAAC,QAAQ,IAAI,QAAQ;EACzB,OAAO,SAAS,OAAO,OAAO,GAAG;CACnC;AACF,CAAC,KAAK,QAAM,KAAK;;;;;ACZjB,IAAI;AAAM,IAAA;AAAO,IAAA;AAiDjB,IAAW,mBAAmB,OAAO,MAAM,GAAG,QAAQ,SAAa,EACjE,QAAQ,QACV,CAAC,GAAG,KAAK,SAAS,MAAM,SAAS,MAAM,wBAAwB,cAAc,CAAC,CAAC,KAAK,MAAM,KAAK"}
@@ -4,525 +4,28 @@ import { BeanModelBase } from 'zova-module-a-model';
4
4
  export interface IModelOptionsPaymentSession extends IDecoratorModelOptions {
5
5
  }
6
6
  export declare class ModelPaymentSession extends BeanModelBase {
7
- view(id: TableIdentity): {
8
- data: {
9
- id: number | string;
10
- state: "created" | "starting" | "requires_action" | "processing" | "succeeded" | "failed" | "cancelled" | "expired";
11
- providerName: string;
12
- nextAction?: {
13
- kind: "redirect";
14
- url: string;
15
- } | {
16
- kind: "embedded";
17
- clientToken: string;
18
- publishableConfig?: {
19
- [key: string]: string;
20
- } | undefined;
21
- } | {
22
- kind: "pending";
23
- retryAfterSeconds?: number | undefined;
24
- } | {
25
- kind: "completed";
26
- } | undefined;
27
- amountMinor: number;
28
- currency: string;
29
- };
30
- error: Error;
31
- isError: true;
32
- isPending: false;
33
- isLoading: false;
34
- isLoadingError: false;
35
- isRefetchError: true;
36
- isSuccess: false;
37
- isPlaceholderData: false;
38
- status: "error";
39
- dataUpdatedAt: number;
40
- errorUpdatedAt: number;
41
- failureCount: number;
42
- failureReason: Error | null;
43
- errorUpdateCount: number;
44
- isFetched: boolean;
45
- isFetchedAfterMount: boolean;
46
- isFetching: boolean;
47
- isInitialLoading: boolean;
48
- isPaused: boolean;
49
- isRefetching: boolean;
50
- isStale: boolean;
51
- isEnabled: boolean;
52
- refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<{
53
- id: number | string;
54
- state: "created" | "starting" | "requires_action" | "processing" | "succeeded" | "failed" | "cancelled" | "expired";
55
- providerName: string;
56
- nextAction?: {
57
- kind: "redirect";
58
- url: string;
59
- } | {
60
- kind: "embedded";
61
- clientToken: string;
62
- publishableConfig?: {
63
- [key: string]: string;
64
- } | undefined;
65
- } | {
66
- kind: "pending";
67
- retryAfterSeconds?: number | undefined;
68
- } | {
69
- kind: "completed";
70
- } | undefined;
71
- amountMinor: number;
72
- currency: string;
73
- }, Error>>;
74
- fetchStatus: import("@tanstack/vue-query").FetchStatus;
75
- promise: Promise<{
76
- id: number | string;
77
- state: "created" | "starting" | "requires_action" | "processing" | "succeeded" | "failed" | "cancelled" | "expired";
78
- providerName: string;
79
- nextAction?: {
80
- kind: "redirect";
81
- url: string;
82
- } | {
83
- kind: "embedded";
84
- clientToken: string;
85
- publishableConfig?: {
86
- [key: string]: string;
87
- } | undefined;
88
- } | {
89
- kind: "pending";
90
- retryAfterSeconds?: number | undefined;
91
- } | {
92
- kind: "completed";
93
- } | undefined;
94
- amountMinor: number;
95
- currency: string;
96
- }>;
97
- suspense: () => Promise<import("@tanstack/vue-query").QueryObserverResult<{
98
- id: number | string;
99
- state: "created" | "starting" | "requires_action" | "processing" | "succeeded" | "failed" | "cancelled" | "expired";
100
- providerName: string;
101
- nextAction?: {
102
- kind: "redirect";
103
- url: string;
104
- } | {
105
- kind: "embedded";
106
- clientToken: string;
107
- publishableConfig?: {
108
- [key: string]: string;
109
- } | undefined;
110
- } | {
111
- kind: "pending";
112
- retryAfterSeconds?: number | undefined;
113
- } | {
114
- kind: "completed";
115
- } | undefined;
116
- amountMinor: number;
117
- currency: string;
118
- }, Error>>;
119
- } | {
120
- data: {
121
- id: number | string;
122
- state: "created" | "starting" | "requires_action" | "processing" | "succeeded" | "failed" | "cancelled" | "expired";
123
- providerName: string;
124
- nextAction?: {
125
- kind: "redirect";
126
- url: string;
127
- } | {
128
- kind: "embedded";
129
- clientToken: string;
130
- publishableConfig?: {
131
- [key: string]: string;
132
- } | undefined;
133
- } | {
134
- kind: "pending";
135
- retryAfterSeconds?: number | undefined;
136
- } | {
137
- kind: "completed";
138
- } | undefined;
139
- amountMinor: number;
140
- currency: string;
141
- };
142
- error: null;
143
- isError: false;
144
- isPending: false;
145
- isLoading: false;
146
- isLoadingError: false;
147
- isRefetchError: false;
148
- isSuccess: true;
149
- isPlaceholderData: false;
150
- status: "success";
151
- dataUpdatedAt: number;
152
- errorUpdatedAt: number;
153
- failureCount: number;
154
- failureReason: Error | null;
155
- errorUpdateCount: number;
156
- isFetched: boolean;
157
- isFetchedAfterMount: boolean;
158
- isFetching: boolean;
159
- isInitialLoading: boolean;
160
- isPaused: boolean;
161
- isRefetching: boolean;
162
- isStale: boolean;
163
- isEnabled: boolean;
164
- refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<{
165
- id: number | string;
166
- state: "created" | "starting" | "requires_action" | "processing" | "succeeded" | "failed" | "cancelled" | "expired";
167
- providerName: string;
168
- nextAction?: {
169
- kind: "redirect";
170
- url: string;
171
- } | {
172
- kind: "embedded";
173
- clientToken: string;
174
- publishableConfig?: {
175
- [key: string]: string;
176
- } | undefined;
177
- } | {
178
- kind: "pending";
179
- retryAfterSeconds?: number | undefined;
180
- } | {
181
- kind: "completed";
182
- } | undefined;
183
- amountMinor: number;
184
- currency: string;
185
- }, Error>>;
186
- fetchStatus: import("@tanstack/vue-query").FetchStatus;
187
- promise: Promise<{
188
- id: number | string;
189
- state: "created" | "starting" | "requires_action" | "processing" | "succeeded" | "failed" | "cancelled" | "expired";
190
- providerName: string;
191
- nextAction?: {
192
- kind: "redirect";
193
- url: string;
194
- } | {
195
- kind: "embedded";
196
- clientToken: string;
197
- publishableConfig?: {
198
- [key: string]: string;
199
- } | undefined;
200
- } | {
201
- kind: "pending";
202
- retryAfterSeconds?: number | undefined;
203
- } | {
204
- kind: "completed";
205
- } | undefined;
206
- amountMinor: number;
207
- currency: string;
208
- }>;
209
- suspense: () => Promise<import("@tanstack/vue-query").QueryObserverResult<{
210
- id: number | string;
211
- state: "created" | "starting" | "requires_action" | "processing" | "succeeded" | "failed" | "cancelled" | "expired";
212
- providerName: string;
213
- nextAction?: {
214
- kind: "redirect";
215
- url: string;
216
- } | {
217
- kind: "embedded";
218
- clientToken: string;
219
- publishableConfig?: {
220
- [key: string]: string;
221
- } | undefined;
222
- } | {
223
- kind: "pending";
224
- retryAfterSeconds?: number | undefined;
225
- } | {
226
- kind: "completed";
227
- } | undefined;
228
- amountMinor: number;
229
- currency: string;
230
- }, Error>>;
231
- } | {
232
- data: undefined;
233
- error: Error;
234
- isError: true;
235
- isPending: false;
236
- isLoading: false;
237
- isLoadingError: true;
238
- isRefetchError: false;
239
- isSuccess: false;
240
- isPlaceholderData: false;
241
- status: "error";
242
- dataUpdatedAt: number;
243
- errorUpdatedAt: number;
244
- failureCount: number;
245
- failureReason: Error | null;
246
- errorUpdateCount: number;
247
- isFetched: boolean;
248
- isFetchedAfterMount: boolean;
249
- isFetching: boolean;
250
- isInitialLoading: boolean;
251
- isPaused: boolean;
252
- isRefetching: boolean;
253
- isStale: boolean;
254
- isEnabled: boolean;
255
- refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<{
256
- id: number | string;
257
- state: "created" | "starting" | "requires_action" | "processing" | "succeeded" | "failed" | "cancelled" | "expired";
258
- providerName: string;
259
- nextAction?: {
260
- kind: "redirect";
261
- url: string;
262
- } | {
263
- kind: "embedded";
264
- clientToken: string;
265
- publishableConfig?: {
266
- [key: string]: string;
267
- } | undefined;
268
- } | {
269
- kind: "pending";
270
- retryAfterSeconds?: number | undefined;
271
- } | {
272
- kind: "completed";
273
- } | undefined;
274
- amountMinor: number;
275
- currency: string;
276
- }, Error>>;
277
- fetchStatus: import("@tanstack/vue-query").FetchStatus;
278
- promise: Promise<{
279
- id: number | string;
280
- state: "created" | "starting" | "requires_action" | "processing" | "succeeded" | "failed" | "cancelled" | "expired";
281
- providerName: string;
282
- nextAction?: {
283
- kind: "redirect";
284
- url: string;
285
- } | {
286
- kind: "embedded";
287
- clientToken: string;
288
- publishableConfig?: {
289
- [key: string]: string;
290
- } | undefined;
291
- } | {
292
- kind: "pending";
293
- retryAfterSeconds?: number | undefined;
294
- } | {
295
- kind: "completed";
296
- } | undefined;
297
- amountMinor: number;
298
- currency: string;
299
- }>;
300
- suspense: () => Promise<import("@tanstack/vue-query").QueryObserverResult<{
301
- id: number | string;
302
- state: "created" | "starting" | "requires_action" | "processing" | "succeeded" | "failed" | "cancelled" | "expired";
303
- providerName: string;
304
- nextAction?: {
305
- kind: "redirect";
306
- url: string;
307
- } | {
308
- kind: "embedded";
309
- clientToken: string;
310
- publishableConfig?: {
311
- [key: string]: string;
312
- } | undefined;
313
- } | {
314
- kind: "pending";
315
- retryAfterSeconds?: number | undefined;
316
- } | {
317
- kind: "completed";
318
- } | undefined;
319
- amountMinor: number;
320
- currency: string;
321
- }, Error>>;
322
- } | {
323
- data: undefined;
324
- error: null;
325
- isError: false;
326
- isPending: true;
327
- isLoadingError: false;
328
- isRefetchError: false;
329
- isSuccess: false;
330
- isPlaceholderData: false;
331
- status: "pending";
332
- dataUpdatedAt: number;
333
- errorUpdatedAt: number;
334
- failureCount: number;
335
- failureReason: Error | null;
336
- errorUpdateCount: number;
337
- isFetched: boolean;
338
- isFetchedAfterMount: boolean;
339
- isFetching: boolean;
340
- isLoading: boolean;
341
- isInitialLoading: boolean;
342
- isPaused: boolean;
343
- isRefetching: boolean;
344
- isStale: boolean;
345
- isEnabled: boolean;
346
- refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<{
347
- id: number | string;
348
- state: "created" | "starting" | "requires_action" | "processing" | "succeeded" | "failed" | "cancelled" | "expired";
349
- providerName: string;
350
- nextAction?: {
351
- kind: "redirect";
352
- url: string;
353
- } | {
354
- kind: "embedded";
355
- clientToken: string;
356
- publishableConfig?: {
357
- [key: string]: string;
358
- } | undefined;
359
- } | {
360
- kind: "pending";
361
- retryAfterSeconds?: number | undefined;
362
- } | {
363
- kind: "completed";
364
- } | undefined;
365
- amountMinor: number;
366
- currency: string;
367
- }, Error>>;
368
- fetchStatus: import("@tanstack/vue-query").FetchStatus;
369
- promise: Promise<{
370
- id: number | string;
371
- state: "created" | "starting" | "requires_action" | "processing" | "succeeded" | "failed" | "cancelled" | "expired";
372
- providerName: string;
373
- nextAction?: {
374
- kind: "redirect";
375
- url: string;
376
- } | {
377
- kind: "embedded";
378
- clientToken: string;
379
- publishableConfig?: {
380
- [key: string]: string;
381
- } | undefined;
382
- } | {
383
- kind: "pending";
384
- retryAfterSeconds?: number | undefined;
385
- } | {
386
- kind: "completed";
387
- } | undefined;
388
- amountMinor: number;
389
- currency: string;
390
- }>;
391
- suspense: () => Promise<import("@tanstack/vue-query").QueryObserverResult<{
392
- id: number | string;
393
- state: "created" | "starting" | "requires_action" | "processing" | "succeeded" | "failed" | "cancelled" | "expired";
394
- providerName: string;
395
- nextAction?: {
396
- kind: "redirect";
397
- url: string;
398
- } | {
399
- kind: "embedded";
400
- clientToken: string;
401
- publishableConfig?: {
402
- [key: string]: string;
403
- } | undefined;
404
- } | {
405
- kind: "pending";
406
- retryAfterSeconds?: number | undefined;
407
- } | {
408
- kind: "completed";
409
- } | undefined;
410
- amountMinor: number;
411
- currency: string;
412
- }, Error>>;
413
- } | {
414
- data: {
415
- id: number | string;
416
- state: "created" | "starting" | "requires_action" | "processing" | "succeeded" | "failed" | "cancelled" | "expired";
417
- providerName: string;
418
- nextAction?: {
419
- kind: "redirect";
420
- url: string;
421
- } | {
422
- kind: "embedded";
423
- clientToken: string;
424
- publishableConfig?: {
425
- [key: string]: string;
426
- } | undefined;
427
- } | {
428
- kind: "pending";
429
- retryAfterSeconds?: number | undefined;
430
- } | {
431
- kind: "completed";
432
- } | undefined;
433
- amountMinor: number;
434
- currency: string;
435
- };
436
- isError: false;
437
- error: null;
438
- isPending: false;
439
- isLoading: false;
440
- isLoadingError: false;
441
- isRefetchError: false;
442
- isSuccess: true;
443
- isPlaceholderData: true;
444
- status: "success";
445
- dataUpdatedAt: number;
446
- errorUpdatedAt: number;
447
- failureCount: number;
448
- failureReason: Error | null;
449
- errorUpdateCount: number;
450
- isFetched: boolean;
451
- isFetchedAfterMount: boolean;
452
- isFetching: boolean;
453
- isInitialLoading: boolean;
454
- isPaused: boolean;
455
- isRefetching: boolean;
456
- isStale: boolean;
457
- isEnabled: boolean;
458
- refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<{
459
- id: number | string;
460
- state: "created" | "starting" | "requires_action" | "processing" | "succeeded" | "failed" | "cancelled" | "expired";
461
- providerName: string;
462
- nextAction?: {
463
- kind: "redirect";
464
- url: string;
465
- } | {
466
- kind: "embedded";
467
- clientToken: string;
468
- publishableConfig?: {
469
- [key: string]: string;
470
- } | undefined;
471
- } | {
472
- kind: "pending";
473
- retryAfterSeconds?: number | undefined;
474
- } | {
475
- kind: "completed";
476
- } | undefined;
477
- amountMinor: number;
478
- currency: string;
479
- }, Error>>;
480
- fetchStatus: import("@tanstack/vue-query").FetchStatus;
481
- promise: Promise<{
482
- id: number | string;
483
- state: "created" | "starting" | "requires_action" | "processing" | "succeeded" | "failed" | "cancelled" | "expired";
484
- providerName: string;
485
- nextAction?: {
486
- kind: "redirect";
487
- url: string;
488
- } | {
489
- kind: "embedded";
490
- clientToken: string;
491
- publishableConfig?: {
492
- [key: string]: string;
493
- } | undefined;
494
- } | {
495
- kind: "pending";
496
- retryAfterSeconds?: number | undefined;
497
- } | {
498
- kind: "completed";
499
- } | undefined;
500
- amountMinor: number;
501
- currency: string;
502
- }>;
503
- suspense: () => Promise<import("@tanstack/vue-query").QueryObserverResult<{
504
- id: number | string;
505
- state: "created" | "starting" | "requires_action" | "processing" | "succeeded" | "failed" | "cancelled" | "expired";
506
- providerName: string;
507
- nextAction?: {
508
- kind: "redirect";
509
- url: string;
510
- } | {
511
- kind: "embedded";
512
- clientToken: string;
513
- publishableConfig?: {
514
- [key: string]: string;
515
- } | undefined;
516
- } | {
517
- kind: "pending";
518
- retryAfterSeconds?: number | undefined;
519
- } | {
520
- kind: "completed";
7
+ view(id: TableIdentity): import("zova-module-a-model").ModelUseQueryReturnType<{
8
+ id: number | string;
9
+ state: "created" | "starting" | "requires_action" | "processing" | "succeeded" | "failed" | "cancelled" | "expired";
10
+ providerName: string;
11
+ nextAction?: {
12
+ kind: "redirect";
13
+ url: string;
14
+ } | {
15
+ kind: "embedded";
16
+ clientToken: string;
17
+ publishableConfig?: {
18
+ [key: string]: string;
521
19
  } | undefined;
522
- amountMinor: number;
523
- currency: string;
524
- }, Error>>;
525
- } | undefined;
20
+ } | {
21
+ kind: "pending";
22
+ retryAfterSeconds?: number | undefined;
23
+ } | {
24
+ kind: "completed";
25
+ } | undefined;
26
+ amountMinor: number;
27
+ currency: string;
28
+ }, Error> | undefined;
526
29
  reconcile(id: TableIdentity): import("vue").UnwrapNestedRefs<import("@tanstack/vue-query").UseMutationReturnType<{
527
30
  id: number | string;
528
31
  state: "created" | "starting" | "requires_action" | "processing" | "succeeded" | "failed" | "cancelled" | "expired";
@@ -1 +1 @@
1
- {"version":3,"file":"paymentSession.d.ts","sourceRoot":"","sources":["../../src/model/paymentSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,aAAa,EAAS,MAAM,qBAAqB,CAAC;AAE3D,MAAM,WAAW,2BAA4B,SAAQ,sBAAsB;CAAG;AAE9E,qBACa,mBAAoB,SAAQ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AAC;;;;;;;IAZhj/C,KAAK,CAAC,EAAE,EAAE,aAAa;;;;;;;;;;6BAYyz+C,CAAC;;;;;6BAA8N,CAAC;;;;;;;CADjj/C"}
1
+ {"version":3,"file":"paymentSession.d.ts","sourceRoot":"","sources":["../../src/model/paymentSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,aAAa,EAAS,MAAM,qBAAqB,CAAC;AAE3D,MAAM,WAAW,2BAA4B,SAAQ,sBAAsB;CAAG;AAE9E,qBACa,mBAAoB,SAAQ,aAAa;IACpD,IAAI,CAAC,EAAE,EAAE,aAAa;;;;;;;;;;6BAmC0z+C,CAAC;;;;;6BAA8N,CAAC;;;;;;;IAxBhj/C,SAAS,CAAC,EAAE,EAAE,aAAa;;;;;;;;;;6BAwBqz+C,CAAC;;;;;6BAA8N,CAAC;;;;;;;IAZhj/C,KAAK,CAAC,EAAE,EAAE,aAAa;;;;;;;;;;6BAYyz+C,CAAC;;;;;6BAA8N,CAAC;;;;;;;CADjj/C"}
@@ -17,6 +17,18 @@ export interface IPaymentSessionView {
17
17
  providerName: string;
18
18
  nextAction?: TypePaymentNextAction;
19
19
  }
20
+ export interface IPaymentNextActionProps {
21
+ action?: TypePaymentNextAction;
22
+ disabled?: boolean;
23
+ continueToPaymentText?: string;
24
+ continueToPaymentHelpText?: string;
25
+ embeddedCheckoutUnavailableText?: string;
26
+ paymentCompletedText?: string;
27
+ paymentPreparingText?: string;
28
+ paymentPreparingRetryText?: (retryAfterSeconds: number) => string;
29
+ refreshPaymentStatusText?: string;
30
+ onRefresh?: () => void | Promise<void>;
31
+ }
20
32
  export interface IPayUiProvider {
21
33
  supports(action: TypePaymentNextAction): boolean;
22
34
  execute(action: TypePaymentNextAction): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../src/types/payment.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAC7B;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GACrF;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/C;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,CAAC;AAE1B,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,KAAK,EACD,SAAS,GACT,UAAU,GACV,iBAAiB,GACjB,YAAY,GACZ,WAAW,GACX,QAAQ,GACR,WAAW,GACX,SAAS,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,qBAAqB,CAAC;CACpC;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC;IACjD,OAAO,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvD"}
1
+ {"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../src/types/payment.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAC7B;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GACrF;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/C;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,CAAC;AAE1B,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,KAAK,EACD,SAAS,GACT,UAAU,GACV,iBAAiB,GACjB,YAAY,GACZ,WAAW,GACX,QAAQ,GACR,WAAW,GACX,SAAS,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,qBAAqB,CAAC;CACpC;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,yBAAyB,CAAC,EAAE,CAAC,iBAAiB,EAAE,MAAM,KAAK,MAAM,CAAC;IAClE,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC;IACjD,OAAO,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zova-module-a-pay",
3
- "version": "5.0.7",
3
+ "version": "5.0.9",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "Zova Module"
@@ -31,5 +31,5 @@
31
31
  },
32
32
  "dependencies": {},
33
33
  "title": "a-pay",
34
- "gitHead": "ad6f4a6afb4c6f0ba968b84152fcf888b0450e3e"
34
+ "gitHead": "27cdde61955152716c2521b04f883bddd425dd89"
35
35
  }
@@ -26,7 +26,7 @@ declare module 'zova-module-a-pay' {
26
26
  }
27
27
  /** model: end */
28
28
  /** model: begin */
29
- import { ModelPaymentSession } from '../model/paymentSession.js';
29
+ import type { ModelPaymentSession } from '../model/paymentSession.js';
30
30
  import 'zova';
31
31
  declare module 'zova' {
32
32
  export interface IBeanRecordGeneral {
@@ -57,7 +57,7 @@ declare module 'zova-module-a-pay' {
57
57
  }
58
58
  /** api: end */
59
59
  /** api: begin */
60
- import { ApiPayPaymentSession } from '../api/payPaymentSession.js';
60
+ import type { ApiPayPaymentSession } from '../api/payPaymentSession.js';
61
61
  export interface IModuleApi {
62
62
  'payPaymentSession': ApiPayPaymentSession;
63
63
  }
@@ -97,7 +97,7 @@ declare module 'zova-module-a-pay' {
97
97
  }
98
98
  /** apiSchema: end */
99
99
  /** apiSchema: begin */
100
- import { ApiSchemaPayPaymentSession } from '../apiSchema/payPaymentSession.js';
100
+ import type { ApiSchemaPayPaymentSession } from '../apiSchema/payPaymentSession.js';
101
101
  export interface IModuleApiSchema {
102
102
  'payPaymentSession': ApiSchemaPayPaymentSession;
103
103
  }
@@ -138,7 +138,7 @@ declare module 'zova-module-a-pay' {
138
138
  }
139
139
  /** service: end */
140
140
  /** service: begin */
141
- import { ServicePaymentCoordinator } from '../service/paymentCoordinator.js';
141
+ import type { ServicePaymentCoordinator } from '../service/paymentCoordinator.js';
142
142
  import 'zova';
143
143
  declare module 'zova' {
144
144
  export interface IBeanRecordGeneral {
@@ -146,48 +146,6 @@ declare module 'zova' {
146
146
  }
147
147
  }
148
148
  /** service: end */
149
- /** controller: begin */
150
- export * from '../component/paymentNextAction/controller.jsx';
151
-
152
- import 'zova';
153
- declare module 'zova' {
154
-
155
-
156
- }
157
- declare module 'zova-module-a-pay' {
158
-
159
- export interface ControllerPaymentNextAction {
160
- /** @internal */
161
- get scope(): ScopeModuleAPay;
162
- }
163
- }
164
- /** controller: end */
165
- /** controller: begin */
166
- import { ControllerPaymentNextAction } from '../component/paymentNextAction/controller.jsx';
167
- import 'zova';
168
- declare module 'zova' {
169
- export interface IBeanRecordLocal {
170
- 'a-pay.controller.paymentNextAction': ControllerPaymentNextAction;
171
- }
172
- }
173
- /** controller: end */
174
-
175
- /** components: begin */
176
- export * from './component/paymentNextAction.js';
177
- import { ZPaymentNextAction } from './component/paymentNextAction.js';
178
- export const components = {
179
- 'paymentNextAction': ZPaymentNextAction,
180
- };
181
- import 'zova';
182
- declare module 'zova' {
183
- export interface IComponentRecord {
184
- 'a-pay:paymentNextAction': ControllerPaymentNextAction;
185
- }
186
- export interface IZovaComponentRecord {
187
- 'a-pay:paymentNextAction': typeof ZPaymentNextAction;
188
- }
189
- }
190
- /** components: end */
191
149
  /** scope: begin */
192
150
  import { BeanScopeBase, type BeanScopeUtil } from 'zova';
193
151
  import { Scope } from 'zova-module-a-bean';
@@ -19,6 +19,19 @@ export interface IPaymentSessionView {
19
19
  nextAction?: TypePaymentNextAction;
20
20
  }
21
21
 
22
+ export interface IPaymentNextActionProps {
23
+ action?: TypePaymentNextAction;
24
+ disabled?: boolean;
25
+ continueToPaymentText?: string;
26
+ continueToPaymentHelpText?: string;
27
+ embeddedCheckoutUnavailableText?: string;
28
+ paymentCompletedText?: string;
29
+ paymentPreparingText?: string;
30
+ paymentPreparingRetryText?: (retryAfterSeconds: number) => string;
31
+ refreshPaymentStatusText?: string;
32
+ onRefresh?: () => void | Promise<void>;
33
+ }
34
+
22
35
  export interface IPayUiProvider {
23
36
  supports(action: TypePaymentNextAction): boolean;
24
37
  execute(action: TypePaymentNextAction): Promise<void>;
@@ -1,26 +0,0 @@
1
- import type { TypeControllerInnerProps } from 'zova';
2
- import type { ControllerPaymentNextActionProps } from '../../component/paymentNextAction/controller.jsx';
3
- import { ControllerPaymentNextAction } from '../../component/paymentNextAction/controller.jsx';
4
- export type ZPaymentNextActionProps = {
5
- controllerRef?: (ref: ControllerPaymentNextAction) => void;
6
- } & ControllerPaymentNextActionProps;
7
- type ControllerInnerProps = TypeControllerInnerProps<ControllerPaymentNextActionProps, keyof typeof ControllerPaymentNextAction.$propsDefault>;
8
- declare module 'zova-module-a-pay' {
9
- interface ControllerPaymentNextAction {
10
- $props: ControllerInnerProps;
11
- }
12
- }
13
- export declare const ZPaymentNextAction: import("vue").DefineSetupFnComponent<ZPaymentNextActionProps, import("vue").EmitsOptions, import("vue").SlotsType<Record<string, any>>, {
14
- controllerRef?: (ref: ControllerPaymentNextAction) => void;
15
- } & ControllerPaymentNextActionProps & ({
16
- [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
17
- } | {
18
- [x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
19
- }), import("vue").PublicProps>;
20
- declare module 'zova-module-a-bean' {
21
- interface IVonaComponentRecord {
22
- 'a-pay:paymentNextAction': ControllerPaymentNextActionProps;
23
- }
24
- }
25
- export {};
26
- //# sourceMappingURL=paymentNextAction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"paymentNextAction.d.ts","sourceRoot":"","sources":["../../../src/.metadata/component/paymentNextAction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,MAAM,CAAC;AAKrD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,kDAAkD,CAAC;AAEzG,OAAO,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAC;AAC/F,MAAM,MAAM,uBAAuB,GAAG;IACpC,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,2BAA2B,KAAK,IAAI,CAAC;CAC5D,GAAG,gCAAgC,CAAC;AAErC,KAAK,oBAAoB,GAAG,wBAAwB,CAClD,gCAAgC,EAChC,MAAM,OAAO,2BAA2B,CAAC,aAAa,CACvD,CAAC;AACF,OAAO,QAAQ,mBAAmB,CAAC;IACjC,UAAiB,2BAA2B;QAC1C,MAAM,EAAE,oBAAoB,CAAC;KAC9B;CACF;AAED,eAAO,MAAM,kBAAkB;oBAbb,CAAC,GAAG,EAAE,2BAA2B,KAAK,IAAI;;;;;8BAgB/B,CAAC;AAC9B,OAAO,QAAQ,oBAAoB,CAAC;IAClC,UAAiB,oBAAoB;QACnC,yBAAyB,EAAE,gCAAgC,CAAC;KAC7D;CACF"}
@@ -1,22 +0,0 @@
1
- import { BeanControllerBase } from 'zova';
2
- import type { TypePaymentNextAction } from '../../types/payment.js';
3
- import { ServicePaymentCoordinator } from '../../service/paymentCoordinator.js';
4
- export interface ControllerPaymentNextActionProps {
5
- action?: TypePaymentNextAction;
6
- disabled?: boolean;
7
- continueToPaymentText?: string;
8
- continueToPaymentHelpText?: string;
9
- embeddedCheckoutUnavailableText?: string;
10
- paymentCompletedText?: string;
11
- paymentPreparingText?: string;
12
- paymentPreparingRetryText?: (retryAfterSeconds: number) => string;
13
- refreshPaymentStatusText?: string;
14
- onRefresh?: () => void | Promise<void>;
15
- }
16
- export declare class ControllerPaymentNextAction extends BeanControllerBase {
17
- static $propsDefault: {};
18
- $$paymentCoordinator: ServicePaymentCoordinator;
19
- continueRedirect(): Promise<void>;
20
- protected render(): import("vue/jsx-runtime").JSX.Element | null;
21
- }
22
- //# sourceMappingURL=controller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../src/component/paymentNextAction/controller.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAO,MAAM,MAAM,CAAC;AAG/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAEhF,MAAM,WAAW,gCAAgC;IAC/C,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,yBAAyB,CAAC,EAAE,CAAC,iBAAiB,EAAE,MAAM,KAAK,MAAM,CAAC;IAClE,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC;AAED,qBACa,2BAA4B,SAAQ,kBAAkB;IACjE,MAAM,CAAC,aAAa,KAAM;IAG1B,oBAAoB,EAAE,yBAAyB,CAAC;IAE1C,gBAAgB;IAMtB,SAAS,CAAC,MAAM;CAyDjB"}
@@ -1,31 +0,0 @@
1
- import type { TypeControllerInnerProps } from 'zova';
2
-
3
- import { defineComponent } from 'vue';
4
- import { prepareComponentOptions, useController } from 'zova';
5
-
6
- import type { ControllerPaymentNextActionProps } from '../../component/paymentNextAction/controller.jsx';
7
-
8
- import { ControllerPaymentNextAction } from '../../component/paymentNextAction/controller.jsx';
9
- export type ZPaymentNextActionProps = {
10
- controllerRef?: (ref: ControllerPaymentNextAction) => void;
11
- } & ControllerPaymentNextActionProps;
12
-
13
- type ControllerInnerProps = TypeControllerInnerProps<
14
- ControllerPaymentNextActionProps,
15
- keyof typeof ControllerPaymentNextAction.$propsDefault
16
- >;
17
- declare module 'zova-module-a-pay' {
18
- export interface ControllerPaymentNextAction {
19
- $props: ControllerInnerProps;
20
- }
21
- }
22
-
23
- export const ZPaymentNextAction = defineComponent((_props: ZPaymentNextActionProps) => {
24
- useController(ControllerPaymentNextAction, undefined, undefined);
25
- return () => {};
26
- }, prepareComponentOptions());
27
- declare module 'zova-module-a-bean' {
28
- export interface IVonaComponentRecord {
29
- 'a-pay:paymentNextAction': ControllerPaymentNextActionProps;
30
- }
31
- }
@@ -1,91 +0,0 @@
1
- import { BeanControllerBase, Use } from 'zova';
2
- import { Controller } from 'zova-module-a-bean';
3
-
4
- import type { TypePaymentNextAction } from '../../types/payment.js';
5
-
6
- import { ServicePaymentCoordinator } from '../../service/paymentCoordinator.js';
7
-
8
- export interface ControllerPaymentNextActionProps {
9
- action?: TypePaymentNextAction;
10
- disabled?: boolean;
11
- continueToPaymentText?: string;
12
- continueToPaymentHelpText?: string;
13
- embeddedCheckoutUnavailableText?: string;
14
- paymentCompletedText?: string;
15
- paymentPreparingText?: string;
16
- paymentPreparingRetryText?: (retryAfterSeconds: number) => string;
17
- refreshPaymentStatusText?: string;
18
- onRefresh?: () => void | Promise<void>;
19
- }
20
-
21
- @Controller()
22
- export class ControllerPaymentNextAction extends BeanControllerBase {
23
- static $propsDefault = {};
24
-
25
- @Use()
26
- $$paymentCoordinator: ServicePaymentCoordinator;
27
-
28
- async continueRedirect() {
29
- const action = this.$props.action;
30
- if (action?.kind !== 'redirect' || this.$props.disabled) return;
31
- await this.$$paymentCoordinator.execute(action);
32
- }
33
-
34
- protected render() {
35
- const {
36
- action,
37
- disabled,
38
- continueToPaymentText,
39
- continueToPaymentHelpText,
40
- embeddedCheckoutUnavailableText,
41
- paymentCompletedText,
42
- paymentPreparingText,
43
- paymentPreparingRetryText,
44
- refreshPaymentStatusText,
45
- onRefresh,
46
- } = this.$props as ControllerPaymentNextActionProps;
47
- if (!action) return null;
48
- if (action.kind === 'redirect') {
49
- return (
50
- <div class="mt-6 space-y-3">
51
- <p class="text-base-content/70">{continueToPaymentHelpText}</p>
52
- <button
53
- class="btn btn-primary"
54
- disabled={disabled}
55
- onClick={() => this.continueRedirect()}
56
- >
57
- {continueToPaymentText}
58
- </button>
59
- </div>
60
- );
61
- }
62
- if (action.kind === 'pending') {
63
- return (
64
- <div class="mt-6 space-y-3" aria-live="polite">
65
- <p class="text-base-content/70">
66
- {action.retryAfterSeconds
67
- ? paymentPreparingRetryText?.(action.retryAfterSeconds)
68
- : paymentPreparingText}
69
- </p>
70
- {onRefresh && (
71
- <button class="btn btn-outline" disabled={disabled} onClick={() => onRefresh()}>
72
- {refreshPaymentStatusText}
73
- </button>
74
- )}
75
- </div>
76
- );
77
- }
78
- if (action.kind === 'completed') {
79
- return (
80
- <p class="mt-6 text-base-content/70" aria-live="polite">
81
- {paymentCompletedText}
82
- </p>
83
- );
84
- }
85
- return (
86
- <div class="mt-6" aria-live="polite">
87
- <p class="text-base-content/70">{embeddedCheckoutUnavailableText}</p>
88
- </div>
89
- );
90
- }
91
- }