zova-module-a-pay 5.0.6 → 5.0.8

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.
@@ -4,6 +4,13 @@ import { ServicePaymentCoordinator } from '../../service/paymentCoordinator.js';
4
4
  export interface ControllerPaymentNextActionProps {
5
5
  action?: TypePaymentNextAction;
6
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;
7
14
  onRefresh?: () => void | Promise<void>;
8
15
  }
9
16
  export declare class ControllerPaymentNextAction extends BeanControllerBase {
@@ -1 +1 @@
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,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;CAkDjB"}
1
+ {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../src/component/paymentNextAction/controller.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAO,MAAM,MAAM,CAAC;AAI/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"}
package/dist/index.js CHANGED
@@ -1,10 +1,12 @@
1
- import { BeanBase, BeanControllerBase, BeanInfo, BeanScopeBase, Use, prepareComponentOptions, useController } from "zova";
1
+ import { BeanBase, BeanControllerBase, BeanInfo, BeanScopeBase, Use, createZovaComponentAsync, prepareComponentOptions, useController } from "zova";
2
2
  import { BeanModelBase, Model } from "zova-module-a-model";
3
3
  import { Api, ApiSchema, BeanApiBase } from "zova-module-a-api";
4
4
  import { Controller, Scope, Service } from "zova-module-a-bean";
5
- import { createTextVNode, createVNode, defineComponent } from "vue";
5
+ import { createVNode, defineComponent, isVNode } from "vue";
6
6
  //#region src/model/paymentSession.ts
7
- var _dec$5, _dec2$5, _class$5;
7
+ var _dec$5;
8
+ var _dec2$5;
9
+ var _class$5;
8
10
  var ModelPaymentSession = (_dec$5 = Model(), _dec2$5 = BeanInfo({ module: "a-pay" }), _dec$5(_class$5 = _dec2$5(_class$5 = class ModelPaymentSession extends BeanModelBase {
9
11
  view(id) {
10
12
  if (this.$ssr.cookieDisabledOnServer) return;
@@ -46,7 +48,9 @@ var OpenApiBaseURL = (sys) => {
46
48
  };
47
49
  //#endregion
48
50
  //#region src/api/payPaymentSession.ts
49
- var _dec$4, _dec2$4, _class$4;
51
+ var _dec$4;
52
+ var _dec2$4;
53
+ var _class$4;
50
54
  /** PayPaymentSession_start */
51
55
  var ApiApiPayPaymentSessionstartPath = "/api/pay/payment-session/{id}/start";
52
56
  /** PayPaymentSession_reconcile */
@@ -66,7 +70,9 @@ var ApiPayPaymentSession = (_dec$4 = Api(), _dec2$4 = BeanInfo({ module: "a-pay"
66
70
  }) || _class$4) || _class$4);
67
71
  //#endregion
68
72
  //#region src/apiSchema/payPaymentSession.ts
69
- var _dec$3, _dec2$3, _class$3;
73
+ var _dec$3;
74
+ var _dec2$3;
75
+ var _class$3;
70
76
  var ApiSchemaPayPaymentSession = (_dec$3 = ApiSchema(), _dec2$3 = BeanInfo({ module: "a-pay" }), _dec$3(_class$3 = _dec2$3(_class$3 = class ApiSchemaPayPaymentSession extends BeanBase {
71
77
  start(options) {
72
78
  return this.$sdk.createApiSchemas("/api/pay/payment-session/{id}/start", "post", options);
@@ -80,7 +86,9 @@ var ApiSchemaPayPaymentSession = (_dec$3 = ApiSchema(), _dec2$3 = BeanInfo({ mod
80
86
  }) || _class$3) || _class$3);
81
87
  //#endregion
82
88
  //#region src/service/paymentCoordinator.ts
83
- var _dec$2, _dec2$2, _class$2;
89
+ var _dec$2;
90
+ var _dec2$2;
91
+ var _class$2;
84
92
  var ServicePaymentCoordinator = (_dec$2 = Service(), _dec2$2 = BeanInfo({ module: "a-pay" }), _dec$2(_class$2 = _dec2$2(_class$2 = class ServicePaymentCoordinator extends BeanBase {
85
93
  async execute(action) {
86
94
  if (action.kind !== "redirect") return;
@@ -90,7 +98,14 @@ var ServicePaymentCoordinator = (_dec$2 = Service(), _dec2$2 = BeanInfo({ module
90
98
  }) || _class$2) || _class$2);
91
99
  //#endregion
92
100
  //#region src/component/paymentNextAction/controller.tsx
93
- var _dec$1, _dec2$1, _dec3, _dec4, _class$1, _class2, _descriptor, _ControllerPaymentNextAction;
101
+ var _dec$1;
102
+ var _dec2$1;
103
+ var _dec3;
104
+ var _dec4;
105
+ var _class$1;
106
+ var _class2;
107
+ var _descriptor;
108
+ var _ControllerPaymentNextAction;
94
109
  function _initializerDefineProperty(e, i, r, l) {
95
110
  r && Object.defineProperty(e, i, {
96
111
  enumerable: r.enumerable,
@@ -107,6 +122,10 @@ function _applyDecoratedDescriptor(i, e, r, n, l) {
107
122
  return n(i, e, r) || r;
108
123
  }, 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
124
  }
125
+ var ZButton = createZovaComponentAsync("basic-button", "button");
126
+ function _isSlot(s) {
127
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
128
+ }
110
129
  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
130
  constructor(...args) {
112
131
  super(...args);
@@ -118,33 +137,29 @@ var ControllerPaymentNextAction = (_dec$1 = Controller(), _dec2$1 = BeanInfo({ m
118
137
  await this.$$paymentCoordinator.execute(action);
119
138
  }
120
139
  render() {
121
- const { action, disabled, onRefresh } = this.$props;
140
+ const { action, disabled, continueToPaymentText, continueToPaymentHelpText, embeddedCheckoutUnavailableText, paymentCompletedText, paymentPreparingText, paymentPreparingRetryText, refreshPaymentStatusText, onRefresh } = this.$props;
122
141
  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" }, [createTextVNode("Continue to the payment provider to complete payment.")]), createVNode("button", {
142
+ if (action.kind === "redirect") return createVNode("div", { "class": "mt-6 space-y-3" }, [createVNode("p", { "class": "text-base-content/70" }, [continueToPaymentHelpText]), createVNode(ZButton, {
124
143
  "class": "btn btn-primary",
125
144
  "disabled": disabled,
126
- "onClick": () => this.continueRedirect()
127
- }, [createTextVNode("Continue to payment")])]);
145
+ "onPerform": () => this.continueRedirect()
146
+ }, _isSlot(continueToPaymentText) ? continueToPaymentText : { default: () => [continueToPaymentText] })]);
128
147
  if (action.kind === "pending") return createVNode("div", {
129
148
  "class": "mt-6 space-y-3",
130
149
  "aria-live": "polite"
131
- }, [createVNode("p", { "class": "text-base-content/70" }, [
132
- createTextVNode("Payment is being prepared"),
133
- action.retryAfterSeconds ? `; retrying in about ${action.retryAfterSeconds} seconds` : "",
134
- createTextVNode(".")
135
- ]), onRefresh && createVNode("button", {
150
+ }, [createVNode("p", { "class": "text-base-content/70" }, [action.retryAfterSeconds ? paymentPreparingRetryText?.(action.retryAfterSeconds) : paymentPreparingText]), onRefresh && createVNode(ZButton, {
136
151
  "class": "btn btn-outline",
137
152
  "disabled": disabled,
138
- "onClick": () => onRefresh()
139
- }, [createTextVNode("Refresh payment status")])]);
153
+ "onPerform": () => onRefresh()
154
+ }, _isSlot(refreshPaymentStatusText) ? refreshPaymentStatusText : { default: () => [refreshPaymentStatusText] })]);
140
155
  if (action.kind === "completed") return createVNode("p", {
141
156
  "class": "mt-6 text-base-content/70",
142
157
  "aria-live": "polite"
143
- }, [createTextVNode("Payment is complete. Confirming the order…")]);
158
+ }, [paymentCompletedText]);
144
159
  return createVNode("div", {
145
160
  "class": "mt-6",
146
161
  "aria-live": "polite"
147
- }, [createVNode("p", { "class": "text-base-content/70" }, [createTextVNode("Embedded checkout will be available when this payment provider is configured.")])]);
162
+ }, [createVNode("p", { "class": "text-base-content/70" }, [embeddedCheckoutUnavailableText])]);
148
163
  }
149
164
  }, _ControllerPaymentNextAction.$propsDefault = {}, _ControllerPaymentNextAction), _descriptor = _applyDecoratedDescriptor(_class2.prototype, "$$paymentCoordinator", [_dec3, _dec4], {
150
165
  configurable: true,
@@ -162,7 +177,9 @@ var ZPaymentNextAction = defineComponent((_props) => {
162
177
  //#region src/.metadata/index.ts
163
178
  /** components: end */
164
179
  /** scope: begin */
165
- var _dec, _dec2, _class;
180
+ var _dec;
181
+ var _dec2;
182
+ var _class;
166
183
  var components = { "paymentNextAction": ZPaymentNextAction };
167
184
  var ScopeModuleAPay = (_dec = Scope(), _dec2 = BeanInfo({ module: "a-pay" }), _dec(_class = _dec2(_class = class ScopeModuleAPay extends BeanScopeBase {}) || _class) || _class);
168
185
  /** scope: end */
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","onRefresh","_createVNode","_createTextVNode","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 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 { action, disabled, onRefresh } = 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\">Continue to the payment provider to complete payment.</p>\n <button\n class=\"btn btn-primary\"\n disabled={disabled}\n onClick={() => this.continueRedirect()}\n >\n Continue to payment\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 Payment is being prepared\n {action.retryAfterSeconds\n ? `; retrying in about ${action.retryAfterSeconds} seconds`\n : ''}\n .\n </p>\n {onRefresh && (\n <button class=\"btn btn-outline\" disabled={disabled} onClick={() => onRefresh()}>\n Refresh payment status\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 Payment is complete. Confirming the order…\n </p>\n );\n }\n return (\n <div class=\"mt-6\" aria-live=\"polite\">\n <p class=\"text-base-content/70\">\n Embedded checkout will be available when this payment provider is configured.\n </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,WA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A,CAAAE,gBAAA,wBAAA,CAAA,CAAA,CAG/E,CAAA;EAIP,IAAIT,OAAOE,SAAS,aAClB,OAAAM,YAAA,KAAA;GAAA,SAAA;GAAA,aAAA;EAAA,GAAA,CAAAC,gBAAA,4CAAA,CAAA,CAAA;EAMF,OAAAD,YAAA,OAAA;GAAA,SAAA;GAAA,aAAA;EAAA,GAAA,CAAAA,YAAA,KAAA,EAAA,SAAA,uBAAA,GAAA,CAAAC,gBAAA,+EAAA,CAAA,CAAA,CAAA,CAAA;CAOF;AACF,GAACf,6BA7DQkB,gBAAgB,CAAC,GAAClB,+BAAAI,cAAAe,0BAAApB,QAAAqB,WAAA,wBAAA,CAAA3B,OAAAC,KAAA,GAAA;CAAA2B,cAAA;CAAAC,YAAA;CAAAC,UAAA;CAAAC,aAAA;AAAA,CAAA,GAAAzB,QAAA,KAAAD,QAAA,KAAAA;;;ACZ3B,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":["BeanControllerBase","Use","Controller","ServicePaymentCoordinator","_isSlot","s","Object","prototype","toString","call","_isVNode","ControllerPaymentNextAction","_dec","_dec2","__z_BeanInfo","module","_dec3","_dec4","Reflect","metadata","_class","_class2","_ControllerPaymentNextAction","constructor","args","_initializerDefineProperty","_descriptor","continueRedirect","action","$props","kind","disabled","$$paymentCoordinator","execute","render","continueToPaymentText","continueToPaymentHelpText","embeddedCheckoutUnavailableText","paymentCompletedText","paymentPreparingText","paymentPreparingRetryText","refreshPaymentStatusText","onRefresh","_createVNode","ZButton","onPerform","default","retryAfterSeconds","$propsDefault","_applyDecoratedDescriptor","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';\nimport { ZButton } from 'zova-module-basic-button';\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 <ZButton\n class=\"btn btn-primary\"\n disabled={disabled}\n onPerform={() => this.continueRedirect()}\n >\n {continueToPaymentText}\n </ZButton>\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 <ZButton class=\"btn btn-outline\" disabled={disabled} onPerform={() => onRefresh()}>\n {refreshPaymentStatusText}\n </ZButton>\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;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;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AAA,GAAA,CAAAA,YAAA,KAAA,EAAA,SAAA,uBAAA,GAAA,CAEqCN,+BAA+B,CAAA,CAAA,CAAA;CAGtE;AACF,GAACf,6BApEQ0B,gBAAgB,CAAC,GAAC1B,+BAAAI,cAAAuB,0BAAA5B,QAAAd,WAAA,wBAAA,CAAAS,OAAAC,KAAA,GAAA;CAAAiC,cAAA;CAAAC,YAAA;CAAAC,UAAA;CAAAC,aAAA;AAAA,CAAA,GAAAhC,QAAA,KAAAD,QAAA,KAAAA;;;ACpB3B,IAAa,qBAAqB,iBAAgB,WAAU;CAC1D,cAAc,6BAA6B,KAAA,GAAW,KAAA,CAAS;CAC/D,aAAa,CAAC;AAChB,GAAG,wBAAwB,CAAC;;;;;ACN5B,IAAI;AAAM,IAAA;AAAO,IAAA;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"}
@@ -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,EAA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;;;;;iCAA8N,CAAC;;;;;;;;;;;;;;;;;;iCAAhO,CAAC;;;;;iCAA8N,CAAC;;;;;;;;;;;;;;;;;iCAAhO,CAAC;;;;;iCAA8N,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"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zova-module-a-pay",
3
- "version": "5.0.6",
3
+ "version": "5.0.8",
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": "277a0c97020b27f5640d268f0c3516f8c3b81ae2"
34
+ "gitHead": "e7537a01ee6754f79ce5e790e76521a283cadcb0"
35
35
  }
@@ -1,5 +1,6 @@
1
1
  import { BeanControllerBase, Use } from 'zova';
2
2
  import { Controller } from 'zova-module-a-bean';
3
+ import { ZButton } from 'zova-module-basic-button';
3
4
 
4
5
  import type { TypePaymentNextAction } from '../../types/payment.js';
5
6
 
@@ -8,6 +9,13 @@ import { ServicePaymentCoordinator } from '../../service/paymentCoordinator.js';
8
9
  export interface ControllerPaymentNextActionProps {
9
10
  action?: TypePaymentNextAction;
10
11
  disabled?: boolean;
12
+ continueToPaymentText?: string;
13
+ continueToPaymentHelpText?: string;
14
+ embeddedCheckoutUnavailableText?: string;
15
+ paymentCompletedText?: string;
16
+ paymentPreparingText?: string;
17
+ paymentPreparingRetryText?: (retryAfterSeconds: number) => string;
18
+ refreshPaymentStatusText?: string;
11
19
  onRefresh?: () => void | Promise<void>;
12
20
  }
13
21
 
@@ -25,19 +33,30 @@ export class ControllerPaymentNextAction extends BeanControllerBase {
25
33
  }
26
34
 
27
35
  protected render() {
28
- const { action, disabled, onRefresh } = this.$props as ControllerPaymentNextActionProps;
36
+ const {
37
+ action,
38
+ disabled,
39
+ continueToPaymentText,
40
+ continueToPaymentHelpText,
41
+ embeddedCheckoutUnavailableText,
42
+ paymentCompletedText,
43
+ paymentPreparingText,
44
+ paymentPreparingRetryText,
45
+ refreshPaymentStatusText,
46
+ onRefresh,
47
+ } = this.$props as ControllerPaymentNextActionProps;
29
48
  if (!action) return null;
30
49
  if (action.kind === 'redirect') {
31
50
  return (
32
51
  <div class="mt-6 space-y-3">
33
- <p class="text-base-content/70">Continue to the payment provider to complete payment.</p>
34
- <button
52
+ <p class="text-base-content/70">{continueToPaymentHelpText}</p>
53
+ <ZButton
35
54
  class="btn btn-primary"
36
55
  disabled={disabled}
37
- onClick={() => this.continueRedirect()}
56
+ onPerform={() => this.continueRedirect()}
38
57
  >
39
- Continue to payment
40
- </button>
58
+ {continueToPaymentText}
59
+ </ZButton>
41
60
  </div>
42
61
  );
43
62
  }
@@ -45,16 +64,14 @@ export class ControllerPaymentNextAction extends BeanControllerBase {
45
64
  return (
46
65
  <div class="mt-6 space-y-3" aria-live="polite">
47
66
  <p class="text-base-content/70">
48
- Payment is being prepared
49
67
  {action.retryAfterSeconds
50
- ? `; retrying in about ${action.retryAfterSeconds} seconds`
51
- : ''}
52
- .
68
+ ? paymentPreparingRetryText?.(action.retryAfterSeconds)
69
+ : paymentPreparingText}
53
70
  </p>
54
71
  {onRefresh && (
55
- <button class="btn btn-outline" disabled={disabled} onClick={() => onRefresh()}>
56
- Refresh payment status
57
- </button>
72
+ <ZButton class="btn btn-outline" disabled={disabled} onPerform={() => onRefresh()}>
73
+ {refreshPaymentStatusText}
74
+ </ZButton>
58
75
  )}
59
76
  </div>
60
77
  );
@@ -62,15 +79,13 @@ export class ControllerPaymentNextAction extends BeanControllerBase {
62
79
  if (action.kind === 'completed') {
63
80
  return (
64
81
  <p class="mt-6 text-base-content/70" aria-live="polite">
65
- Payment is complete. Confirming the order…
82
+ {paymentCompletedText}
66
83
  </p>
67
84
  );
68
85
  }
69
86
  return (
70
87
  <div class="mt-6" aria-live="polite">
71
- <p class="text-base-content/70">
72
- Embedded checkout will be available when this payment provider is configured.
73
- </p>
88
+ <p class="text-base-content/70">{embeddedCheckoutUnavailableText}</p>
74
89
  </div>
75
90
  );
76
91
  }