zova-module-a-pay 5.0.6 → 5.0.7
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;
|
|
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"}
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { BeanBase, BeanControllerBase, BeanInfo, BeanScopeBase, Use, prepareComp
|
|
|
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 {
|
|
5
|
+
import { createVNode, defineComponent } from "vue";
|
|
6
6
|
//#region src/model/paymentSession.ts
|
|
7
7
|
var _dec$5, _dec2$5, _class$5;
|
|
8
8
|
var ModelPaymentSession = (_dec$5 = Model(), _dec2$5 = BeanInfo({ module: "a-pay" }), _dec$5(_class$5 = _dec2$5(_class$5 = class ModelPaymentSession extends BeanModelBase {
|
|
@@ -118,33 +118,29 @@ var ControllerPaymentNextAction = (_dec$1 = Controller(), _dec2$1 = BeanInfo({ m
|
|
|
118
118
|
await this.$$paymentCoordinator.execute(action);
|
|
119
119
|
}
|
|
120
120
|
render() {
|
|
121
|
-
const { action, disabled, onRefresh } = this.$props;
|
|
121
|
+
const { action, disabled, continueToPaymentText, continueToPaymentHelpText, embeddedCheckoutUnavailableText, paymentCompletedText, paymentPreparingText, paymentPreparingRetryText, refreshPaymentStatusText, onRefresh } = this.$props;
|
|
122
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" }, [
|
|
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
124
|
"class": "btn btn-primary",
|
|
125
125
|
"disabled": disabled,
|
|
126
126
|
"onClick": () => this.continueRedirect()
|
|
127
|
-
}, [
|
|
127
|
+
}, [continueToPaymentText])]);
|
|
128
128
|
if (action.kind === "pending") return createVNode("div", {
|
|
129
129
|
"class": "mt-6 space-y-3",
|
|
130
130
|
"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", {
|
|
131
|
+
}, [createVNode("p", { "class": "text-base-content/70" }, [action.retryAfterSeconds ? paymentPreparingRetryText?.(action.retryAfterSeconds) : paymentPreparingText]), onRefresh && createVNode("button", {
|
|
136
132
|
"class": "btn btn-outline",
|
|
137
133
|
"disabled": disabled,
|
|
138
134
|
"onClick": () => onRefresh()
|
|
139
|
-
}, [
|
|
135
|
+
}, [refreshPaymentStatusText])]);
|
|
140
136
|
if (action.kind === "completed") return createVNode("p", {
|
|
141
137
|
"class": "mt-6 text-base-content/70",
|
|
142
138
|
"aria-live": "polite"
|
|
143
|
-
}, [
|
|
139
|
+
}, [paymentCompletedText]);
|
|
144
140
|
return createVNode("div", {
|
|
145
141
|
"class": "mt-6",
|
|
146
142
|
"aria-live": "polite"
|
|
147
|
-
}, [createVNode("p", { "class": "text-base-content/70" }, [
|
|
143
|
+
}, [createVNode("p", { "class": "text-base-content/70" }, [embeddedCheckoutUnavailableText])]);
|
|
148
144
|
}
|
|
149
145
|
}, _ControllerPaymentNextAction.$propsDefault = {}, _ControllerPaymentNextAction), _descriptor = _applyDecoratedDescriptor(_class2.prototype, "$$paymentCoordinator", [_dec3, _dec4], {
|
|
150
146
|
configurable: true,
|
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,GAA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AAiBI,UAAU;EAAC,GAAA,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","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,EACjE,QAAQ,EACN,GACF,EACF,CAAC;GACH;GACA,WAAW,YAAY;IACrB,MAAM,KAAK,mBAAmB,EAC5B,UAA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AAU;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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-module-a-pay",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.7",
|
|
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": "
|
|
34
|
+
"gitHead": "ad6f4a6afb4c6f0ba968b84152fcf888b0450e3e"
|
|
35
35
|
}
|
|
@@ -8,6 +8,13 @@ import { ServicePaymentCoordinator } from '../../service/paymentCoordinator.js';
|
|
|
8
8
|
export interface ControllerPaymentNextActionProps {
|
|
9
9
|
action?: TypePaymentNextAction;
|
|
10
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;
|
|
11
18
|
onRefresh?: () => void | Promise<void>;
|
|
12
19
|
}
|
|
13
20
|
|
|
@@ -25,18 +32,29 @@ export class ControllerPaymentNextAction extends BeanControllerBase {
|
|
|
25
32
|
}
|
|
26
33
|
|
|
27
34
|
protected render() {
|
|
28
|
-
const {
|
|
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;
|
|
29
47
|
if (!action) return null;
|
|
30
48
|
if (action.kind === 'redirect') {
|
|
31
49
|
return (
|
|
32
50
|
<div class="mt-6 space-y-3">
|
|
33
|
-
<p class="text-base-content/70">
|
|
51
|
+
<p class="text-base-content/70">{continueToPaymentHelpText}</p>
|
|
34
52
|
<button
|
|
35
53
|
class="btn btn-primary"
|
|
36
54
|
disabled={disabled}
|
|
37
55
|
onClick={() => this.continueRedirect()}
|
|
38
56
|
>
|
|
39
|
-
|
|
57
|
+
{continueToPaymentText}
|
|
40
58
|
</button>
|
|
41
59
|
</div>
|
|
42
60
|
);
|
|
@@ -45,15 +63,13 @@ export class ControllerPaymentNextAction extends BeanControllerBase {
|
|
|
45
63
|
return (
|
|
46
64
|
<div class="mt-6 space-y-3" aria-live="polite">
|
|
47
65
|
<p class="text-base-content/70">
|
|
48
|
-
Payment is being prepared
|
|
49
66
|
{action.retryAfterSeconds
|
|
50
|
-
?
|
|
51
|
-
:
|
|
52
|
-
.
|
|
67
|
+
? paymentPreparingRetryText?.(action.retryAfterSeconds)
|
|
68
|
+
: paymentPreparingText}
|
|
53
69
|
</p>
|
|
54
70
|
{onRefresh && (
|
|
55
71
|
<button class="btn btn-outline" disabled={disabled} onClick={() => onRefresh()}>
|
|
56
|
-
|
|
72
|
+
{refreshPaymentStatusText}
|
|
57
73
|
</button>
|
|
58
74
|
)}
|
|
59
75
|
</div>
|
|
@@ -62,15 +78,13 @@ export class ControllerPaymentNextAction extends BeanControllerBase {
|
|
|
62
78
|
if (action.kind === 'completed') {
|
|
63
79
|
return (
|
|
64
80
|
<p class="mt-6 text-base-content/70" aria-live="polite">
|
|
65
|
-
|
|
81
|
+
{paymentCompletedText}
|
|
66
82
|
</p>
|
|
67
83
|
);
|
|
68
84
|
}
|
|
69
85
|
return (
|
|
70
86
|
<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>
|
|
87
|
+
<p class="text-base-content/70">{embeddedCheckoutUnavailableText}</p>
|
|
74
88
|
</div>
|
|
75
89
|
);
|
|
76
90
|
}
|