@solvimon/solvimon-web 0.1.0-alpha.13 → 0.1.0-alpha.15
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.
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-CX8vlY2Z.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-ugPPvTKf.mjs} +2 -2
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-DGisvmez.js → BillingInformation.vue_vue_type_script_setup_true_lang-xuCWAVgf.js} +1 -1
- package/dist/ContentWithAsideLayout-DHpnJfGA.js +1 -0
- package/dist/{ContentWithAsideLayout-DhfUkZZg.mjs → ContentWithAsideLayout-Dy9xgxuF.mjs} +6 -3
- package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BpN9nSMC.js +1 -0
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Bus-5gC3.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-D_PE2UbX.mjs} +8 -23
- package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DU6X3zxr.js +1 -0
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Bc2hkpTb.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-ryvFEQMV.mjs} +1 -1
- package/dist/InvoiceHeader.vue_vue_type_script_setup_true_lang-DdpPrYxi.js +1 -0
- package/dist/InvoiceHeader.vue_vue_type_script_setup_true_lang-bAiAbtMi.mjs +27 -0
- package/dist/{PaymentHistoryBlock-BiiFJkpT.js → PaymentHistoryBlock-BGbTy4Se.js} +1 -1
- package/dist/{PaymentHistoryBlock-D_B099M7.mjs → PaymentHistoryBlock-BKMttUyk.mjs} +1 -1
- package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CixdxEGm.js +1 -0
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CaMDtHrL.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-tM7f_fQS.mjs} +1 -1
- package/dist/{PaymentIntegrationForm-CkXYj9xs.mjs → PaymentIntegrationForm-BGxjGJGz.mjs} +1 -1
- package/dist/{PaymentIntegrationForm-bfGmfwQT.js → PaymentIntegrationForm-liOVNKEG.js} +1 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BxdcIX-Z.js +1 -0
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BnMmcoAu.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-aP-gCq7V.mjs} +736 -162
- package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-DfdaWRO0.js +1 -0
- package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-h-JUw1DV.mjs +145 -0
- package/dist/PaymentMethodsList.vue_vue_type_script_setup_true_lang-DxndhDxR.js +1 -0
- package/dist/PaymentMethodsList.vue_vue_type_script_setup_true_lang-j5VNsyu7.mjs +139 -0
- package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BVoS3ZXS.js +1 -0
- package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Cqk-vonA.mjs +170 -0
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-BkzLj8n2.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-Cv6lz35J.mjs} +48 -23
- package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-D6hHXndB.js +1 -0
- package/dist/component-B53Df2Rt.js +1 -0
- package/dist/component-BSnccqm1.mjs +933 -0
- package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
- package/dist/components/BillingInformation/BillingInformation.es.js +4 -4
- package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.es.js +3 -3
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +4 -4
- package/dist/components/Invoice/Invoice.cjs.js +1 -1
- package/dist/components/Invoice/Invoice.es.js +14 -13
- package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.es.js +3 -3
- package/dist/components/InvoiceHeader/InvoiceHeader.ce.d.ts +3 -0
- package/dist/components/InvoiceHeader/InvoiceHeader.cjs.js +1 -0
- package/dist/components/InvoiceHeader/InvoiceHeader.es.js +123 -0
- package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
- package/dist/components/InvoicesList/InvoicesList.es.js +3 -3
- package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.es.js +3 -3
- package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +11 -110
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +5 -5
- package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.es.js +5 -5
- package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
- package/dist/components/WalletBalances/WalletBalances.es.js +3 -3
- package/dist/core/action-request.types.d.ts +10 -1
- package/dist/core/index.cjs.js +1 -1
- package/dist/core/index.es.js +1 -1
- package/dist/core/types.d.ts +4 -0
- package/dist/{customer-hDxW1Dbp.js → customer-B5b2tLhw.js} +1 -1
- package/dist/{customer-B31QzznT.mjs → customer-CANPEYH9.mjs} +1 -1
- package/dist/en-US-C0gIE4Q1.js +1 -0
- package/dist/{en-US-N3CUCsVy.mjs → en-US-DAgOSlgv.mjs} +33 -18
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/invoices-BCmE_nnb.js +1 -0
- package/dist/{invoices-DIYPN2j_.mjs → invoices-DBv0qkgm.mjs} +22 -3
- package/dist/nl-NL-Br7muSHK.js +1 -0
- package/dist/{nl-NL-B8U9b85I.mjs → nl-NL-DCsmrA8A.mjs} +33 -14
- package/dist/{paymentMethods-67b3UlTZ.mjs → paymentMethods-D-5FNN8W.mjs} +11 -3
- package/dist/paymentMethods-u5y9B5ng.js +1 -0
- package/dist/{payments-Dq6R37Fz.mjs → payments-BK8yzqJ5.mjs} +1 -1
- package/dist/{payments-DkHhTHto.js → payments-BTTtcfyI.js} +1 -1
- package/dist/{registry-Df_26rJy.mjs → registry-CMo7X2FD.mjs} +9 -3
- package/dist/registry-Cx7p19-6.js +1 -0
- package/dist/screens/Checkout/Checkout.cjs.js +1 -1
- package/dist/screens/Checkout/Checkout.es.js +330 -414
- package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.es.js +13 -13
- package/dist/screens/PayInvoice/PayInvoice.cjs.js +1 -1
- package/dist/screens/PayInvoice/PayInvoice.es.js +45 -34
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.ce.d.ts +3 -0
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.cjs.js +1 -0
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.es.js +231 -0
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -1
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +756 -720
- package/dist/solvimon-web.css +1 -1
- package/dist/{subscriptions-jelITJcX.js → subscriptions-AMC4DirD.js} +1 -1
- package/dist/{subscriptions-ClGIr_aS.mjs → subscriptions-DHjXDyH1.mjs} +2 -2
- package/dist/{adyen-Bwewy3HC.mjs → url-1Lbg5Yni.mjs} +35 -35
- package/dist/url-B6-3PkW2.js +1 -0
- package/dist/{useActionDispatchProvider-rw9kWeE0.js → useActionDispatchProvider-CizNgRwv.js} +1 -1
- package/dist/{useActionDispatchProvider-BC57-Ufn.mjs → useActionDispatchProvider-DmhD9mYX.mjs} +1 -1
- package/dist/{useCustomer-Ba9WRtuT.mjs → useCustomer-DCPq7eHM.mjs} +2 -2
- package/dist/{useCustomer-CUcaeQn_.js → useCustomer-DYc54GVD.js} +1 -1
- package/dist/useIncrementalLoading-CuSndpP2.js +1 -0
- package/dist/{useIncrementalLoading-Cnzh2mAz.mjs → useIncrementalLoading-DmOT2MXH.mjs} +4 -4
- package/dist/{useInvoiceData-lIMEwwMy.js → useInvoiceData-BajCyf-x.js} +1 -1
- package/dist/{useInvoiceData-D7YN2SAd.mjs → useInvoiceData-BgtUKbHY.mjs} +2 -2
- package/dist/{useInvoicesList-CFzAxyae.mjs → useInvoicesList-DRD5yix0.mjs} +4 -4
- package/dist/useInvoicesList-wnvjyB_H.js +1 -0
- package/dist/{useLoadInitialData-DjwRHcAH.js → useLoadInitialData-BObRB7Vo.js} +1 -1
- package/dist/{useLoadInitialData-5sgImpzc.mjs → useLoadInitialData-IlbmC6p0.mjs} +1 -1
- package/dist/{usePaymentMethodOptions-DYO6xr3-.js → usePaymentMethodOptions-CzqsebhN.js} +1 -1
- package/dist/{usePaymentMethodOptions-C2k4npCQ.mjs → usePaymentMethodOptions-DRkWBjv6.mjs} +2 -2
- package/dist/{usePaymentMethods-CRWbH48K.mjs → usePaymentMethods-DFkRNreh.mjs} +2 -2
- package/dist/{usePaymentMethods-ryN_YohI.js → usePaymentMethods-ZPxKg5Y3.js} +1 -1
- package/dist/{usePayments-DWXPGFvp.js → usePayments-DwiGafZj.js} +1 -1
- package/dist/{usePayments-Cw5PPEJa.mjs → usePayments-E_Jsqo98.mjs} +3 -3
- package/dist/{usePortal-CxX4nrE4.js → usePortal-CxTS2TQh.js} +1 -1
- package/dist/{usePortal-cmE08vYs.mjs → usePortal-DcOz9FEL.mjs} +1 -1
- package/dist/{useService-Bb9r_sOQ.js → useService-CHrkefKd.js} +1 -1
- package/dist/{useService-BsSEI8DZ.mjs → useService-DF57xuDd.mjs} +1 -1
- package/dist/{useWalletBalanceItems-CpZ1NWPr.js → useWalletBalanceItems-BQEXDCBg.js} +1 -1
- package/dist/{useWalletBalanceItems-CkDqmk36.mjs → useWalletBalanceItems-MlHgedWR.mjs} +3 -3
- package/dist/{vendor-ui-C0K3osvz.mjs → vendor-ui-B8IlviSs.mjs} +6482 -5866
- package/dist/vendor-ui-C3Tq-qY_.js +1 -0
- package/package.json +5 -4
- package/dist/ContentWithAsideLayout-B5B8Kwaw.js +0 -1
- package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CkRsyMlJ.js +0 -1
- package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D0vVUHuY.js +0 -1
- package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DWTEfLrE.js +0 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CiyyUp4z.js +0 -1
- package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-BChVMzCj.mjs +0 -50
- package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-Br3bEUlP.js +0 -1
- package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-AHw3iTfi.js +0 -1
- package/dist/adyen-R6aSZ0Yf.js +0 -1
- package/dist/component-BOqPDAVk.js +0 -1
- package/dist/component-Djrf1L-Z.mjs +0 -889
- package/dist/en-US-CgPY97Vq.js +0 -1
- package/dist/invoices-DzkA1jDc.js +0 -1
- package/dist/nl-NL-qMRaTRrM.js +0 -1
- package/dist/paymentMethods-C_sdTkSF.js +0 -1
- package/dist/registry-BkViv4tv.js +0 -1
- package/dist/useIncrementalLoading-DoTTXM2Y.js +0 -1
- package/dist/useInvoicesList-CaBCGs4h.js +0 -1
- package/dist/vendor-ui-5pJF5KBP.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../ApiStatus-oqvUEWJx.js"),
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../ApiStatus-oqvUEWJx.js"),o=require("../../ContentWithAsideLayout-DHpnJfGA.js"),r=require("../../useInvoicesList-wnvjyB_H.js"),s=require("../../usePortal-CxTS2TQh.js"),n=require("../../SubscriptionsList.vue_vue_type_script_setup_true_lang-D6hHXndB.js"),a=require("../../useCustomer-DYc54GVD.js"),i=require("../../usePaymentMethods-ZPxKg5Y3.js"),u=require("../../BillingInformation.vue_vue_type_script_setup_true_lang-xuCWAVgf.js"),l=require("../../useLoadInitialData-BObRB7Vo.js"),c=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BpN9nSMC.js"),m=require("../../paymentMethods-u5y9B5ng.js"),d=require("../../useService-CHrkefKd.js"),v=require("../../useWalletBalanceItems-BQEXDCBg.js"),p=require("../../component-B53Df2Rt.js");const y=e.defineComponent({__name:"CustomerOverview",props:{configuration:{type:Object}},setup(p){var y;const f=null==(y=s.usePortal().value)?void 0:y.customer_id,_=a.useCustomer({customerId:f}),g=r.useInvoicesList({customerId:f,batchSize:5}),h=n.useSubscriptionsList({customerId:f,batchSize:2}),b=i.usePaymentMethods({customerId:f}),j=function({customerId:e,amount:t}){const{getPaymentMethodOptions:o}=m.createPaymentMethodsService(),{data:r,execute:s,error:n,apiStatus:a,isPending:i}=d.useService({initialValue:[],service:async()=>(await o({customerId:e,amount:t})).flatMap(e=>e.options??[])});return{error:n,apiStatus:a,items:r,fetch:s,isPending:i}}({customerId:f}),C=v.useCustomerWalletBalances({customerId:f}),S=v.useWalletBalanceItems(C.walletBalances),{isLoading:w}=l.useLoadInitialData(_.get.execute(),g.fetchInitial(),h.fetchInitial(),b.fetchAll(),j.fetch(),C.fetch());return(s,a)=>(e.openBlock(),e.createBlock(e.unref(o.ContentWithAsideLayout),{class:"sv-customer-overview sv-root sv-screen"},{header:e.withCtx(()=>[e.unref(_).customer.value?(e.openBlock(),e.createBlock(n._sfc_main,{key:0,class:"sv-customer-overview__subscriptions",customer:e.unref(_).customer.value,subscriptions:e.unref(h).items.value,"payment-methods":e.unref(b).items.value,"is-loading":e.unref(w),onLoadMore:e.unref(h).fetchMore},null,8,["customer","subscriptions","payment-methods","is-loading","onLoadMore"])):e.createCommentVNode("",!0)]),content:e.withCtx(()=>[e.createVNode(r._sfc_main,{class:"sv-customer-overview__invoices",invoices:e.unref(g).items.value,"has-more-items":e.unref(g).hasNextBatch.value,"is-loading":e.unref(w),onLoadMore:e.unref(g).fetchMore},null,8,["invoices","has-more-items","is-loading","onLoadMore"])]),aside:e.withCtx(()=>[e.createVNode(v._sfc_main,{class:"sv-customer-overview__wallet-balances","has-error":e.unref(C).apiStatus.value===e.unref(t.ApiStatus).Failed,"is-loading":e.unref(w),"wallet-balances":e.unref(S)},null,8,["has-error","is-loading","wallet-balances"]),e.createVNode(c._sfc_main,{class:"sv-customer-overview__payment-methods","is-loading":e.unref(w),"payment-methods":e.unref(b).items.value},null,8,["is-loading","payment-methods"]),e.unref(_).customer.value?(e.openBlock(),e.createBlock(u._sfc_main,{key:0,class:"sv-customer-overview__billing-information","is-loading":e.unref(w),customer:e.unref(_).customer.value},null,8,["is-loading","customer"])):e.createCommentVNode("",!0)]),_:1}))}}),f=e.defineComponent({__name:"CustomerOverview.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object},configuration:{type:Object}},setup:t=>(o,r)=>{var s,n,a,i;return e.openBlock(),e.createBlock(p._sfc_main,{"custom-element-name":e.unref(g),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(n=null==(s=t.branding)?void 0:s.colors)?void 0:n.primary,"secondary-color":null==(i=null==(a=t.branding)?void 0:a.colors)?void 0:i.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,"css-overrides":t.cssOverrides,onError:r[0]||(r[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(y)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log","css-overrides"])}}),_=p.defineCustomElement(f),g=p.getComponentName("customer-overview");exports.COMPONENT_NAME=g,exports.SolvimonCustomerOverview=_,exports.defineSolvimonCustomerOverview=()=>{customElements.get(g)||customElements.define(g,_)};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createBlock, unref, withCtx, createVNode, createCommentVNode } from "vue";
|
|
2
2
|
import { A as ApiStatus } from "../../ApiStatus-CyNDp_op.mjs";
|
|
3
|
-
import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-
|
|
4
|
-
import { u as useInvoicesList, _ as _sfc_main$5 } from "../../useInvoicesList-
|
|
5
|
-
import { u as usePortal } from "../../usePortal-
|
|
6
|
-
import { u as useSubscriptionsList, _ as _sfc_main$6 } from "../../SubscriptionsList.vue_vue_type_script_setup_true_lang-
|
|
7
|
-
import { u as useCustomer } from "../../useCustomer-
|
|
8
|
-
import { u as usePaymentMethods } from "../../usePaymentMethods-
|
|
9
|
-
import { _ as _sfc_main$4 } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-
|
|
10
|
-
import { u as useLoadInitialData } from "../../useLoadInitialData-
|
|
11
|
-
import { _ as _sfc_main$3 } from "../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-
|
|
12
|
-
import { c as createPaymentMethodsService } from "../../paymentMethods-
|
|
13
|
-
import { u as useService } from "../../useService-
|
|
14
|
-
import { u as useCustomerWalletBalances, a as useWalletBalanceItems, _ as _sfc_main$2 } from "../../useWalletBalanceItems-
|
|
15
|
-
import { _ as _sfc_main$7, d as defineCustomElement, g as getComponentName } from "../../component-
|
|
3
|
+
import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-Dy9xgxuF.mjs";
|
|
4
|
+
import { u as useInvoicesList, _ as _sfc_main$5 } from "../../useInvoicesList-DRD5yix0.mjs";
|
|
5
|
+
import { u as usePortal } from "../../usePortal-DcOz9FEL.mjs";
|
|
6
|
+
import { u as useSubscriptionsList, _ as _sfc_main$6 } from "../../SubscriptionsList.vue_vue_type_script_setup_true_lang-Cv6lz35J.mjs";
|
|
7
|
+
import { u as useCustomer } from "../../useCustomer-DCPq7eHM.mjs";
|
|
8
|
+
import { u as usePaymentMethods } from "../../usePaymentMethods-DFkRNreh.mjs";
|
|
9
|
+
import { _ as _sfc_main$4 } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-ugPPvTKf.mjs";
|
|
10
|
+
import { u as useLoadInitialData } from "../../useLoadInitialData-IlbmC6p0.mjs";
|
|
11
|
+
import { _ as _sfc_main$3 } from "../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-D_PE2UbX.mjs";
|
|
12
|
+
import { c as createPaymentMethodsService } from "../../paymentMethods-D-5FNN8W.mjs";
|
|
13
|
+
import { u as useService } from "../../useService-DF57xuDd.mjs";
|
|
14
|
+
import { u as useCustomerWalletBalances, a as useWalletBalanceItems, _ as _sfc_main$2 } from "../../useWalletBalanceItems-MlHgedWR.mjs";
|
|
15
|
+
import { _ as _sfc_main$7, d as defineCustomElement, g as getComponentName } from "../../component-BSnccqm1.mjs";
|
|
16
16
|
function useCustomerPaymentMethodOptions({
|
|
17
17
|
customerId,
|
|
18
18
|
amount
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-BOqPDAVk.js"),n=require("../../vendor-ui-5pJF5KBP.js"),o=require("../../ContentWithAsideLayout-B5B8Kwaw.js"),a=require("../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CiyyUp4z.js"),r=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),i=require("../../adyen-R6aSZ0Yf.js"),c=require("../../useLoadInitialData-DjwRHcAH.js"),l=require("../../usePayments-DWXPGFvp.js"),s=require("../../usePaymentMethodOptions-DYO6xr3-.js"),u=require("../../usePaymentMethods-ryN_YohI.js"),p=e.defineComponent({__name:"PayButton",props:{amount:{type:Object},paymentMethod:{type:Object},type:{type:String},variant:{type:String},color:{type:String},size:{type:String},pill:{type:Boolean},square:{type:Boolean},loading:{type:Boolean},disabled:{type:Boolean},iconPrefix:{type:null},iconSuffix:{type:null},tag:{type:String}},emits:["click"],setup(t){const o=t,{$t:a}=n.useIntl(),r=e.computed(()=>({color:o.color??"primary",disabled:o.disabled,iconPrefix:o.iconPrefix,iconSuffix:o.iconSuffix,loading:o.loading,pill:o.pill,size:o.size??"lg",square:o.square,tag:o.tag,type:o.type,variant:o.variant})),i=e.computed(()=>{var t,n,a;switch(null==(t=o.paymentMethod)?void 0:t.paymentMethodType){case"scheme":return"Credit Card";case"applepay":return"Apple Pay";case"googlepay":return"Google Pay";case"paypal":return"PayPal";case"ideal":return"iDeal";case"klarna":return"Klarna";case"bcmc":return"BCMC";case"sepadirectdebit":return"SEPA";case"twint":return"Twint";case"swish":return"Swish";case"vipps":return"Vipps";case"mbway":return"MBway";case"alipay":return"AliPay";case"wechatpayWeb":return"WeChatPay";case"afterpay_default":return"Afterpay";case"affirm":return"Affirm";case"ach":return"ACH";case"blik":return"Blik";case"cashapp":return"Cash App Pay";case"amazonpay":return"Amazon Pay";case"venmo":return"Venmo";case"clicktopay":return"Click to Pay";case"upi":return"UPI";case"revolutpay":return"Revolut Pay";case"ratepay":return"Ratepay";case"walley":return"Walley";case"alma":return"Alma";case"facilypay_3x":case"facilypay_4x":return"Oney";case"samsungpay":return"Samsung Pay";case"bizum":return"Bizum";case"pix":return"Pix";case"multibanco":return"Multibanco";case"openbanking_UK":return"Open Banking";default:return(null==(n=o.paymentMethod)?void 0:n.paymentMethodType)?e.capitalize(null==(a=o.paymentMethod)?void 0:a.paymentMethodType):""}}),c=e.computed(()=>o.amount&&o.paymentMethod?a({defaultMessage:"Pay {amount} with {type}",id:"pay_button.label.amount_and_payment_method",description:"The label for the pay button when both the amount and the payment method are known"},{amount:n.formatAmount(o.amount),type:i.value}):o.amount?a({defaultMessage:"Pay {amount}",id:"pay_button.label.amount_only",description:"The label for the pay button when only the amount is known"},{amount:n.formatAmount(o.amount),type:i.value}):a({defaultMessage:"Pay",id:"pay_button.label.default",description:"The default label for the pay button when no amount and payment method are known"}));return(t,o)=>(e.openBlock(),e.createBlock(e.unref(n._sfc_main$3),e.mergeProps(r.value,{class:"w-full",onClick:o[0]||(o[0]=e=>t.$emit("click",e))}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1},16))}}),m={key:0},y=e.defineComponent({__name:"PayInvoice",props:{invoice:{type:Object},paymentMethodOptions:{type:Array},paymentAttempts:{default:()=>[],type:Array},countryCode:{type:String},amount:{type:Object},downloadService:{type:Function},configuration:{type:Object},isLoading:{type:Boolean},error:{type:null}},setup(t){const{$t:c}=n.useIntl(),l=t,s=e.ref(),u=e.ref();function y(){if(!u.value)throw new Error("payment integration form not found");u.value.submit()}const d=()=>{l.configuration.onPaymentSuccess&&l.configuration.onPaymentSuccess()};return(l,v)=>(e.openBlock(),e.createBlock(e.unref(o.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.createVNode(r._sfc_main,{class:"min-h-[52px] w-96"},{default:e.withCtx(()=>[t.invoice&&t.downloadService?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$13),{key:0,invoice:t.invoice,"payment-attempts":t.paymentAttempts,"download-service":()=>t.downloadService(t.invoice.id)},null,8,["invoice","payment-attempts","download-service"])):e.createCommentVNode("",!0)]),_:1})]),content:e.withCtx(()=>{var o,l;return[t.isLoading?(e.openBlock(),e.createBlock(r._sfc_main,{key:0,variant:"section",class:"min-h-[300px]"})):e.createCommentVNode("",!0),(null==(o=t.invoice)?void 0:o.paid)?(e.openBlock(),e.createBlock(i._sfc_main,{key:1,status:"success",title:e.unref(c)({id:"pay_invoice.paid.title",defaultMessage:"Thank you for your payment!",description:"Title shown when the invoice has already been paid"}),class:"mt-8"},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main$6),{icon:"check"}),e.createTextVNode(e.toDisplayString(e.unref(n.formatAmount)(t.invoice.tax_summary.total_amount)),1)]),_:1})]),_:1},8,["title"])):t.error?(e.openBlock(),e.createBlock(i._sfc_main,{key:2,status:"error",title:e.unref(c)({id:"pay_invoice.error.title",defaultMessage:"Something went wrong",description:"Title shown when the invoice payment fails to load"})},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({id:"pay_invoice.error.description",defaultMessage:"Please try again or contact support.",description:"Body text shown when the invoice payment fails to load"})),1)]),_:1})]),_:1},8,["title"])):!t.isLoading&&t.countryCode&&t.amount&&t.invoice?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[(null==(l=t.paymentMethodOptions)?void 0:l.length)?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$1),{key:0,title:e.unref(c)({id:"pay_invoice.payment_methods.title",defaultMessage:"Payment methods",description:"Section title for the payment method selector on the pay invoice screen"}),"content-background":"none","no-border":"","no-spacing":""},{default:e.withCtx(()=>[e.createVNode(a._sfc_main,{ref_key:"paymentIntegrationFormRef",ref:u,amount:t.amount,"country-code":t.countryCode,context:{type:"INVOICE",related_resource_ids:[{type:"INVOICE",id:t.invoice.id}]},"customer-id":t.invoice.customer.id,"force-store-payment-method":"","invoice-id":t.invoice.id,"payment-method-options":t.paymentMethodOptions,variant:"AUTHORIZE",onPaymentSuccess:d,onSelect:v[0]||(v[0]=e=>s.value=e)},null,8,["amount","country-code","context","customer-id","invoice-id","payment-method-options"])]),_:1},8,["title"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]}),aside:e.withCtx(()=>[e.createVNode(r._sfc_main,{variant:"section",class:"min-h-[200px]"},{default:e.withCtx(()=>[t.invoice?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$12),{key:0,invoice:t.invoice},null,8,["invoice"])):e.createCommentVNode("",!0)]),_:1}),t.invoice?(e.openBlock(),e.createElementBlock("div",m,[e.createVNode(p,{disabled:!s.value,amount:t.amount,"payment-method":s.value,onClick:y},null,8,["disabled","amount","payment-method"])])):e.createCommentVNode("",!0)]),_:1}))}}),d=e.defineComponent({__name:"PayInvoice.entry.view",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object},configuration:{type:Object}},setup(t){const o=t,{invoice:a,get:r,downloadInvoicePdf:i}=l.useInvoice({invoiceId:o.configuration.invoiceId}),{payments:p,get:m}=l.usePayments(),{fetchInitial:y}=u.usePaymentMethods({customerId:o.portalObject.customer_id}),{paymentMethodOptions:d,get:v}=s.usePaymentMethodOptions(),{isLoading:f}=c.useLoadInitialData((async()=>{const e=await r();await v({customerId:e.customer.id,amount:e.open_invoice_amount})})(),y(),m(o.configuration.invoiceId)),g=e.computed(()=>{var e;return(null==(e=a.value)?void 0:e.customer)?n.getCustomerCountry(a.value.customer):void 0});return(t,n)=>{var o;return e.renderSlot(t.$slots,"default",{invoice:e.unref(a),isLoading:e.unref(f),amount:null==(o=e.unref(a))?void 0:o.open_invoice_amount,countryCode:g.value,paymentMethodOptions:e.unref(d),paymentAttempts:e.unref(p),downloadService:e.unref(i)})}}}),v=e.defineComponent({__name:"PayInvoice.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object},configuration:{type:Object}},setup:n=>(o,a)=>{var r,i,c,l;return e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"custom-element-name":e.unref(g),environment:n.environment,locale:n.locale,"portal-object":n.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(i=null==(r=n.branding)?void 0:r.colors)?void 0:i.primary,"secondary-color":null==(l=null==(c=n.branding)?void 0:c.colors)?void 0:l.secondary,"experimental-features":n.experimentalFeatures,"log-level":n.logLevel,"on-log":n.onLog,onError:a[0]||(a[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(d,e.normalizeProps(e.guardReactiveProps(o.$props)),{default:e.withCtx(({invoice:t,isLoading:o,amount:a,countryCode:r,paymentMethodOptions:i,paymentAttempts:c,downloadService:l})=>[e.createVNode(y,{"is-loading":o,invoice:t,amount:a,"country-code":r,"payment-method-options":i,configuration:n.configuration,"payment-attempts":c??[],"download-service":l},null,8,["is-loading","invoice","amount","country-code","payment-method-options","configuration","payment-attempts","download-service"])]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),f=t.defineCustomElement(v),g=t.getComponentName("pay-invoice");exports.COMPONENT_NAME=g,exports.SolvimonPayInvoice=f,exports.defineSolvimonPayInvoice=()=>{customElements.get(g)||customElements.define(g,f)};
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-B53Df2Rt.js"),n=require("../../vendor-ui-C3Tq-qY_.js"),o=require("../../ContentWithAsideLayout-DHpnJfGA.js"),a=require("../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BxdcIX-Z.js"),r=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),i=require("../../url-B6-3PkW2.js"),c=require("../../useLoadInitialData-BObRB7Vo.js"),l=require("../../usePayments-DwiGafZj.js"),s=require("../../usePaymentMethodOptions-CzqsebhN.js"),u=require("../../usePaymentMethods-ZPxKg5Y3.js"),p=e.defineComponent({__name:"PayButton",props:{amount:{type:Object},paymentMethod:{type:Object},type:{type:String},variant:{type:String},color:{type:String},size:{type:String},pill:{type:Boolean},square:{type:Boolean},loading:{type:Boolean},disabled:{type:Boolean},iconPrefix:{type:null},iconSuffix:{type:null},tag:{type:String}},emits:["click"],setup(t){const o=t,{$t:a}=n.useIntl(),r=e.computed(()=>({color:o.color??"primary",disabled:o.disabled,iconPrefix:o.iconPrefix,iconSuffix:o.iconSuffix,loading:o.loading,pill:o.pill,size:o.size??"lg",square:o.square,tag:o.tag,type:o.type,variant:o.variant})),i=e.computed(()=>{var t,n,a;switch(null==(t=o.paymentMethod)?void 0:t.paymentMethodType){case"scheme":return"Credit Card";case"applepay":return"Apple Pay";case"googlepay":return"Google Pay";case"paypal":return"PayPal";case"ideal":return"iDeal";case"klarna":return"Klarna";case"bcmc":return"BCMC";case"sepadirectdebit":return"SEPA";case"twint":return"Twint";case"swish":return"Swish";case"vipps":return"Vipps";case"mbway":return"MBway";case"alipay":return"AliPay";case"wechatpayWeb":return"WeChatPay";case"afterpay_default":return"Afterpay";case"affirm":return"Affirm";case"ach":return"ACH";case"blik":return"Blik";case"cashapp":return"Cash App Pay";case"amazonpay":return"Amazon Pay";case"venmo":return"Venmo";case"clicktopay":return"Click to Pay";case"upi":return"UPI";case"revolutpay":return"Revolut Pay";case"ratepay":return"Ratepay";case"walley":return"Walley";case"alma":return"Alma";case"facilypay_3x":case"facilypay_4x":return"Oney";case"samsungpay":return"Samsung Pay";case"bizum":return"Bizum";case"pix":return"Pix";case"multibanco":return"Multibanco";case"openbanking_UK":return"Open Banking";default:return(null==(n=o.paymentMethod)?void 0:n.paymentMethodType)?e.capitalize(null==(a=o.paymentMethod)?void 0:a.paymentMethodType):""}}),c=e.computed(()=>o.amount&&o.paymentMethod?a({defaultMessage:"Pay {amount} with {type}",id:"pay_button.label.amount_and_payment_method",description:"The label for the pay button when both the amount and the payment method are known"},{amount:n.formatAmount(o.amount),type:i.value}):o.amount?a({defaultMessage:"Pay {amount}",id:"pay_button.label.amount_only",description:"The label for the pay button when only the amount is known"},{amount:n.formatAmount(o.amount),type:i.value}):a({defaultMessage:"Pay",id:"pay_button.label.default",description:"The default label for the pay button when no amount and payment method are known"}));return(t,o)=>(e.openBlock(),e.createBlock(e.unref(n._sfc_main$1),e.mergeProps(r.value,{class:"w-full",onClick:o[0]||(o[0]=e=>t.$emit("click",e))}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1},16))}}),d={key:0},m=e.defineComponent({__name:"PayInvoice",props:{invoice:{type:Object},paymentMethodOptions:{type:Array},paymentAttempts:{default:()=>[],type:Array},countryCode:{type:String},amount:{type:Object},downloadService:{type:Function},configuration:{type:Object},isLoading:{type:Boolean},error:{type:null}},setup(t){const{$t:c}=n.useIntl(),l=t,s=e.ref(),u=e.ref(),m=e.ref(!1);function y(){if(!u.value)throw new Error("payment integration form not found");m.value=!0,u.value.submit()}const v=()=>{l.configuration.onPaymentSuccess&&l.configuration.onPaymentSuccess()},f=()=>{m.value=!1};return(l,g)=>(e.openBlock(),e.createBlock(e.unref(o.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.createVNode(r._sfc_main,{class:"min-h-[52px] w-96"},{default:e.withCtx(()=>[t.invoice&&t.downloadService?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$2),{key:0,invoice:t.invoice,"payment-attempts":t.paymentAttempts,"download-service":()=>t.downloadService(t.invoice.id)},null,8,["invoice","payment-attempts","download-service"])):e.createCommentVNode("",!0)]),_:1})]),content:e.withCtx(()=>{var o,l;return[t.isLoading?(e.openBlock(),e.createBlock(r._sfc_main,{key:0,variant:"section",class:"min-h-[300px]"})):e.createCommentVNode("",!0),(null==(o=t.invoice)?void 0:o.paid)?(e.openBlock(),e.createBlock(i._sfc_main,{key:1,status:"success",title:e.unref(c)({id:"pay_invoice.paid.title",defaultMessage:"Thank you for your payment!",description:"Title shown when the invoice has already been paid"}),class:"mt-8"},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main$3),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main$14),{icon:"check"}),e.createTextVNode(e.toDisplayString(e.unref(n.formatAmount)(t.invoice.tax_summary.total_amount)),1)]),_:1})]),_:1},8,["title"])):t.error?(e.openBlock(),e.createBlock(i._sfc_main,{key:2,status:"error",title:e.unref(c)({id:"pay_invoice.error.title",defaultMessage:"Something went wrong",description:"Title shown when the invoice payment fails to load"})},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main$3),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({id:"pay_invoice.error.description",defaultMessage:"Please try again or contact support.",description:"Body text shown when the invoice payment fails to load"})),1)]),_:1})]),_:1},8,["title"])):!t.isLoading&&t.countryCode&&t.amount&&t.invoice?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[(null==(l=t.paymentMethodOptions)?void 0:l.length)?(e.openBlock(),e.createBlock(e.unref(n._sfc_main),{key:0,title:e.unref(c)({id:"pay_invoice.payment_methods.title",defaultMessage:"Payment methods",description:"Section title for the payment method selector on the pay invoice screen"}),"content-background":"none","no-border":"","no-spacing":""},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass({"pointer-events-none opacity-60":m.value})},[e.createVNode(a._sfc_main,{ref_key:"paymentIntegrationFormRef",ref:u,amount:t.amount,"country-code":t.countryCode,context:{type:"INVOICE",related_resource_ids:[{type:"INVOICE",id:t.invoice.id}]},"customer-id":t.invoice.customer.id,"force-store-payment-method":"","invoice-id":t.invoice.id,"payment-method-options":t.paymentMethodOptions,variant:"AUTHORIZE",onPaymentSuccess:v,onPaymentFailed:f,onSelect:g[0]||(g[0]=e=>s.value=e)},null,8,["amount","country-code","context","customer-id","invoice-id","payment-method-options"])],2)]),_:1},8,["title"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]}),aside:e.withCtx(()=>[e.createVNode(r._sfc_main,{variant:"section",class:"min-h-[200px]"},{default:e.withCtx(()=>[t.invoice?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$15),{key:0,invoice:t.invoice},null,8,["invoice"])):e.createCommentVNode("",!0)]),_:1}),t.invoice?(e.openBlock(),e.createElementBlock("div",d,[e.createVNode(p,{disabled:!s.value||m.value,loading:m.value,amount:t.amount,"payment-method":s.value,onClick:y},null,8,["disabled","loading","amount","payment-method"])])):e.createCommentVNode("",!0)]),_:1}))}}),y=e.defineComponent({__name:"PayInvoice.entry.view",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object},configuration:{type:Object}},setup(t){const o=t,{invoice:a,get:r,downloadInvoicePdf:i}=l.useInvoice({invoiceId:o.configuration.invoiceId}),{payments:p,get:d}=l.usePayments(),{fetchInitial:m}=u.usePaymentMethods({customerId:o.portalObject.customer_id}),{paymentMethodOptions:y,get:v}=s.usePaymentMethodOptions(),{isLoading:f}=c.useLoadInitialData((async()=>{const e=await r();await v({customerId:e.customer.id,amount:e.open_invoice_amount})})(),m(),d(o.configuration.invoiceId)),g=e.computed(()=>{var e;return(null==(e=a.value)?void 0:e.customer)?n.getCustomerCountry(a.value.customer):void 0});return(t,n)=>{var o;return e.renderSlot(t.$slots,"default",{invoice:e.unref(a),isLoading:e.unref(f),amount:null==(o=e.unref(a))?void 0:o.open_invoice_amount,countryCode:g.value,paymentMethodOptions:e.unref(y),paymentAttempts:e.unref(p),downloadService:e.unref(i)})}}}),v=e.defineComponent({__name:"PayInvoice.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object},configuration:{type:Object}},setup:n=>(o,a)=>{var r,i,c,l;return e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"custom-element-name":e.unref(g),environment:n.environment,locale:n.locale,"portal-object":n.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(i=null==(r=n.branding)?void 0:r.colors)?void 0:i.primary,"secondary-color":null==(l=null==(c=n.branding)?void 0:c.colors)?void 0:l.secondary,"experimental-features":n.experimentalFeatures,"log-level":n.logLevel,"on-log":n.onLog,onError:a[0]||(a[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(y,e.normalizeProps(e.guardReactiveProps(o.$props)),{default:e.withCtx(({invoice:t,isLoading:o,amount:a,countryCode:r,paymentMethodOptions:i,paymentAttempts:c,downloadService:l})=>[e.createVNode(m,{"is-loading":o,invoice:t,amount:a,"country-code":r,"payment-method-options":i,configuration:n.configuration,"payment-attempts":c??[],"download-service":l},null,8,["is-loading","invoice","amount","country-code","payment-method-options","configuration","payment-attempts","download-service"])]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),f=t.defineCustomElement(v),g=t.getComponentName("pay-invoice");exports.COMPONENT_NAME=g,exports.SolvimonPayInvoice=f,exports.defineSolvimonPayInvoice=()=>{customElements.get(g)||customElements.define(g,f)};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent, computed, capitalize, openBlock, createBlock, unref, mergeProps, withCtx, createTextVNode, toDisplayString, ref, createVNode, createCommentVNode, createElementBlock, Fragment, renderSlot, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
-
import { _ as _sfc_main$d, d as defineCustomElement, g as getComponentName } from "../../component-
|
|
3
|
-
import { u as useIntl,
|
|
4
|
-
import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-
|
|
5
|
-
import { _ as _sfc_main$b } from "../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { defineComponent, computed, capitalize, openBlock, createBlock, unref, mergeProps, withCtx, createTextVNode, toDisplayString, ref, createVNode, createCommentVNode, createElementBlock, Fragment, createElementVNode, normalizeClass, renderSlot, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
+
import { _ as _sfc_main$d, d as defineCustomElement, g as getComponentName } from "../../component-BSnccqm1.mjs";
|
|
3
|
+
import { u as useIntl, B as formatAmount, c as _sfc_main$4, C as _sfc_main$6, e as _sfc_main$8, A as _sfc_main$9, _ as _sfc_main$a, d as _sfc_main$c, g as getCustomerCountry } from "../../vendor-ui-B8IlviSs.mjs";
|
|
4
|
+
import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-Dy9xgxuF.mjs";
|
|
5
|
+
import { _ as _sfc_main$b } from "../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-aP-gCq7V.mjs";
|
|
6
6
|
import { _ as _sfc_main$5 } from "../../Skeleton.vue_vue_type_script_setup_true_lang-DGMxHc20.mjs";
|
|
7
|
-
import { _ as _sfc_main$7 } from "../../
|
|
8
|
-
import { u as useLoadInitialData } from "../../useLoadInitialData-
|
|
9
|
-
import { u as useInvoice, a as usePayments } from "../../usePayments-
|
|
10
|
-
import { u as usePaymentMethodOptions } from "../../usePaymentMethodOptions-
|
|
11
|
-
import { u as usePaymentMethods } from "../../usePaymentMethods-
|
|
7
|
+
import { _ as _sfc_main$7 } from "../../url-1Lbg5Yni.mjs";
|
|
8
|
+
import { u as useLoadInitialData } from "../../useLoadInitialData-IlbmC6p0.mjs";
|
|
9
|
+
import { u as useInvoice, a as usePayments } from "../../usePayments-E_Jsqo98.mjs";
|
|
10
|
+
import { u as usePaymentMethodOptions } from "../../usePaymentMethodOptions-DRkWBjv6.mjs";
|
|
11
|
+
import { u as usePaymentMethods } from "../../usePaymentMethods-DFkRNreh.mjs";
|
|
12
12
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
13
13
|
__name: "PayButton",
|
|
14
14
|
props: {
|
|
@@ -182,10 +182,12 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
182
182
|
const props = __props;
|
|
183
183
|
const selectedPaymentMethod = ref();
|
|
184
184
|
const paymentIntegrationFormRef = ref();
|
|
185
|
+
const isPaymentPending = ref(false);
|
|
185
186
|
function handleSubmit() {
|
|
186
187
|
if (!paymentIntegrationFormRef.value) {
|
|
187
188
|
throw new Error("payment integration form not found");
|
|
188
189
|
}
|
|
190
|
+
isPaymentPending.value = true;
|
|
189
191
|
paymentIntegrationFormRef.value.submit();
|
|
190
192
|
}
|
|
191
193
|
const handlePaymentSuccess = () => {
|
|
@@ -193,6 +195,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
193
195
|
props.configuration.onPaymentSuccess();
|
|
194
196
|
}
|
|
195
197
|
};
|
|
198
|
+
const handlePaymentFailed = () => {
|
|
199
|
+
isPaymentPending.value = false;
|
|
200
|
+
};
|
|
196
201
|
return (_ctx, _cache) => {
|
|
197
202
|
return openBlock(), createBlock(unref(ContentWithAsideLayout), null, {
|
|
198
203
|
header: withCtx(() => [
|
|
@@ -261,28 +266,33 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
261
266
|
"no-spacing": ""
|
|
262
267
|
}, {
|
|
263
268
|
default: withCtx(() => [
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
269
|
+
createElementVNode("div", {
|
|
270
|
+
class: normalizeClass({ "pointer-events-none opacity-60": isPaymentPending.value })
|
|
271
|
+
}, [
|
|
272
|
+
createVNode(_sfc_main$b, {
|
|
273
|
+
ref_key: "paymentIntegrationFormRef",
|
|
274
|
+
ref: paymentIntegrationFormRef,
|
|
275
|
+
amount: __props.amount,
|
|
276
|
+
"country-code": __props.countryCode,
|
|
277
|
+
context: {
|
|
278
|
+
type: "INVOICE",
|
|
279
|
+
related_resource_ids: [
|
|
280
|
+
{
|
|
281
|
+
type: "INVOICE",
|
|
282
|
+
id: __props.invoice.id
|
|
283
|
+
}
|
|
284
|
+
]
|
|
285
|
+
},
|
|
286
|
+
"customer-id": __props.invoice.customer.id,
|
|
287
|
+
"force-store-payment-method": "",
|
|
288
|
+
"invoice-id": __props.invoice.id,
|
|
289
|
+
"payment-method-options": __props.paymentMethodOptions,
|
|
290
|
+
variant: "AUTHORIZE",
|
|
291
|
+
onPaymentSuccess: handlePaymentSuccess,
|
|
292
|
+
onPaymentFailed: handlePaymentFailed,
|
|
293
|
+
onSelect: _cache[0] || (_cache[0] = (payload) => selectedPaymentMethod.value = payload)
|
|
294
|
+
}, null, 8, ["amount", "country-code", "context", "customer-id", "invoice-id", "payment-method-options"])
|
|
295
|
+
], 2)
|
|
286
296
|
]),
|
|
287
297
|
_: 1
|
|
288
298
|
}, 8, ["title"])) : createCommentVNode("", true)
|
|
@@ -304,11 +314,12 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
304
314
|
}),
|
|
305
315
|
__props.invoice ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
306
316
|
createVNode(_sfc_main$3, {
|
|
307
|
-
disabled: !selectedPaymentMethod.value,
|
|
317
|
+
disabled: !selectedPaymentMethod.value || isPaymentPending.value,
|
|
318
|
+
loading: isPaymentPending.value,
|
|
308
319
|
amount: __props.amount,
|
|
309
320
|
"payment-method": selectedPaymentMethod.value,
|
|
310
321
|
onClick: handleSubmit
|
|
311
|
-
}, null, 8, ["disabled", "amount", "payment-method"])
|
|
322
|
+
}, null, 8, ["disabled", "loading", "amount", "payment-method"])
|
|
312
323
|
])) : createCommentVNode("", true)
|
|
313
324
|
]),
|
|
314
325
|
_: 1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-B53Df2Rt.js"),o=require("../../vendor-ui-C3Tq-qY_.js"),n=require("../../ContentWithAsideLayout-DHpnJfGA.js"),r=require("../../PaymentMethodsList.vue_vue_type_script_setup_true_lang-DxndhDxR.js"),a=require("../../PaymentMethodForm.vue_vue_type_script_setup_true_lang-DfdaWRO0.js"),s=require("../../useCustomer-DYc54GVD.js"),i=require("../../usePaymentMethods-ZPxKg5Y3.js"),l=require("../../usePaymentMethodOptions-CzqsebhN.js"),m=require("../../useLoadInitialData-BObRB7Vo.js"),p={class:"grid gap-4 sm:grid-cols-1 md:grid-cols-2"},d={key:0},c=e.defineComponent({__name:"ScreenTitle",props:{title:{type:String},description:{type:String}},setup:t=>(n,r)=>(e.openBlock(),e.createElementBlock("div",p,[e.createElementVNode("div",null,[e.createVNode(e.unref(o._sfc_main$3),{variant:"heading-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),t.description?(e.openBlock(),e.createBlock(e.unref(o._sfc_main$3),{key:0,variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.description),1)]),_:1})):e.createCommentVNode("",!0)]),n.$slots.right?(e.openBlock(),e.createElementBlock("div",d,[e.renderSlot(n.$slots,"right")])):e.createCommentVNode("",!0)]))}),u=e.defineComponent({__name:"PaymentMethodsManagement",props:{customer:{type:Object},paymentMethods:{type:Array},paymentMethodOptions:{type:Array},isLoading:{type:Boolean},error:{type:null}},emits:["set-default"],setup(t,{emit:s}){const i=s,{$t:l}=o.useIntl(),m=e.ref(!1);return(s,p)=>(e.openBlock(),e.createBlock(e.unref(n.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.createVNode(c,{title:e.unref(l)({defaultMessage:"Payment methods",id:"screens.payment_method_management.title",description:"The title for the payment method management screen "}),description:e.unref(l)({defaultMessage:"Add a new payment method or set a default payment method for your payments.",id:"screens.payment_method_management.description",description:"The descriptive text for the payment method management screen"})},null,8,["title","description"])]),content:e.withCtx(()=>[e.createVNode(e.unref(o._sfc_main),{"no-border":"","no-spacing":"","content-background":"none",title:"Your payment methods"},{default:e.withCtx(()=>[e.createVNode(r._sfc_main,{"payment-methods":t.paymentMethods,onSetDefault:p[0]||(p[0]=e=>i("set-default"))},null,8,["payment-methods"])]),_:1}),m.value?(e.openBlock(),e.createBlock(a._sfc_main,{key:0,customer:t.customer,"payment-method-options":t.paymentMethodOptions},null,8,["customer","payment-method-options"])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createBlock(e.unref(o._sfc_main$1),{key:1,color:"gray",variant:"outline",onClick:p[1]||(p[1]=e=>m.value=!1)},{default:e.withCtx(()=>[...p[3]||(p[3]=[e.createTextVNode("Cancel",-1)])]),_:1})):(e.openBlock(),e.createBlock(e.unref(o._sfc_main$1),{key:2,color:"gray",variant:"outline",onClick:p[2]||(p[2]=e=>m.value=!0)},{default:e.withCtx(()=>[...p[4]||(p[4]=[e.createTextVNode("Add payment method",-1)])]),_:1}))]),_:1}))}}),y=e.defineComponent({__name:"PaymentMethodsManagement.entry.view",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object}},setup(t){const o=t,n=o.portalObject.customer_id,{customer:r,get:a}=s.useCustomer({customerId:n}),{items:p,fetchInitial:d}=i.usePaymentMethods({customerId:o.portalObject.customer_id}),{paymentMethodOptions:c,get:u}=l.usePaymentMethodOptions(),{isLoading:y}=m.useLoadInitialData(a.execute(),d(),u({customerId:o.portalObject.customer_id}));return(t,o)=>e.renderSlot(t.$slots,"default",{customer:e.unref(r),paymentMethods:e.unref(p),paymentMethodOptions:e.unref(c),isLoading:e.unref(y),refreshPaymentMethods:e.unref(d)})}}),g=e.defineComponent({__name:"PaymentMethodsManagement.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object}},setup:o=>(n,r)=>{var a,s,i,l;return e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"custom-element-name":e.unref(f),environment:o.environment,locale:o.locale,"portal-object":o.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(s=null==(a=o.branding)?void 0:a.colors)?void 0:s.primary,"secondary-color":null==(l=null==(i=o.branding)?void 0:i.colors)?void 0:l.secondary,"experimental-features":o.experimentalFeatures,"log-level":o.logLevel,"on-log":o.onLog,onError:r[0]||(r[0]=e=>n.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(y,e.normalizeProps(e.guardReactiveProps(n.$props)),{default:e.withCtx(({customer:t,paymentMethods:o,paymentMethodOptions:n,isLoading:r,refreshPaymentMethods:a})=>[t?(e.openBlock(),e.createBlock(u,{key:0,"is-loading":r,"payment-methods":o,"payment-method-options":n,customer:t,onSetDefault:a},null,8,["is-loading","payment-methods","payment-method-options","customer","onSetDefault"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),h=t.defineCustomElement(g),f=t.getComponentName("payment-methods-management");exports.COMPONENT_NAME=f,exports.SolvimonPaymentMethodsManagement=h,exports.defineSolvimonPaymentMethodsManagement=()=>{customElements.get(f)||customElements.define(f,h)};
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, createVNode, unref, withCtx, createTextVNode, toDisplayString, createBlock, createCommentVNode, renderSlot, ref, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
+
import { _ as _sfc_main$9, d as defineCustomElement, g as getComponentName } from "../../component-BSnccqm1.mjs";
|
|
3
|
+
import { e as _sfc_main$4, u as useIntl, _ as _sfc_main$5, c as _sfc_main$8 } from "../../vendor-ui-B8IlviSs.mjs";
|
|
4
|
+
import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-Dy9xgxuF.mjs";
|
|
5
|
+
import { _ as _sfc_main$6 } from "../../PaymentMethodsList.vue_vue_type_script_setup_true_lang-j5VNsyu7.mjs";
|
|
6
|
+
import { _ as _sfc_main$7 } from "../../PaymentMethodForm.vue_vue_type_script_setup_true_lang-h-JUw1DV.mjs";
|
|
7
|
+
import { u as useCustomer } from "../../useCustomer-DCPq7eHM.mjs";
|
|
8
|
+
import { u as usePaymentMethods } from "../../usePaymentMethods-DFkRNreh.mjs";
|
|
9
|
+
import { u as usePaymentMethodOptions } from "../../usePaymentMethodOptions-DRkWBjv6.mjs";
|
|
10
|
+
import { u as useLoadInitialData } from "../../useLoadInitialData-IlbmC6p0.mjs";
|
|
11
|
+
const _hoisted_1 = { class: "grid gap-4 sm:grid-cols-1 md:grid-cols-2" };
|
|
12
|
+
const _hoisted_2 = { key: 0 };
|
|
13
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
14
|
+
__name: "ScreenTitle",
|
|
15
|
+
props: {
|
|
16
|
+
title: { type: String },
|
|
17
|
+
description: { type: String }
|
|
18
|
+
},
|
|
19
|
+
setup(__props) {
|
|
20
|
+
return (_ctx, _cache) => {
|
|
21
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
22
|
+
createElementVNode("div", null, [
|
|
23
|
+
createVNode(unref(_sfc_main$4), { variant: "heading-1" }, {
|
|
24
|
+
default: withCtx(() => [
|
|
25
|
+
createTextVNode(toDisplayString(__props.title), 1)
|
|
26
|
+
]),
|
|
27
|
+
_: 1
|
|
28
|
+
}),
|
|
29
|
+
__props.description ? (openBlock(), createBlock(unref(_sfc_main$4), {
|
|
30
|
+
key: 0,
|
|
31
|
+
variant: "body-sm",
|
|
32
|
+
shade: "lighter"
|
|
33
|
+
}, {
|
|
34
|
+
default: withCtx(() => [
|
|
35
|
+
createTextVNode(toDisplayString(__props.description), 1)
|
|
36
|
+
]),
|
|
37
|
+
_: 1
|
|
38
|
+
})) : createCommentVNode("", true)
|
|
39
|
+
]),
|
|
40
|
+
_ctx.$slots.right ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
41
|
+
renderSlot(_ctx.$slots, "right")
|
|
42
|
+
])) : createCommentVNode("", true)
|
|
43
|
+
]);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
48
|
+
__name: "PaymentMethodsManagement",
|
|
49
|
+
props: {
|
|
50
|
+
customer: { type: Object },
|
|
51
|
+
paymentMethods: { type: Array },
|
|
52
|
+
paymentMethodOptions: { type: Array },
|
|
53
|
+
isLoading: { type: Boolean },
|
|
54
|
+
error: { type: null }
|
|
55
|
+
},
|
|
56
|
+
emits: ["set-default"],
|
|
57
|
+
setup(__props, { emit: __emit }) {
|
|
58
|
+
const emit = __emit;
|
|
59
|
+
const { $t } = useIntl();
|
|
60
|
+
const showPaymentMethodForm = ref(false);
|
|
61
|
+
return (_ctx, _cache) => {
|
|
62
|
+
return openBlock(), createBlock(unref(ContentWithAsideLayout), null, {
|
|
63
|
+
header: withCtx(() => [
|
|
64
|
+
createVNode(_sfc_main$3, {
|
|
65
|
+
title: unref($t)({
|
|
66
|
+
defaultMessage: "Payment methods",
|
|
67
|
+
id: "screens.payment_method_management.title",
|
|
68
|
+
description: "The title for the payment method management screen "
|
|
69
|
+
}),
|
|
70
|
+
description: unref($t)({
|
|
71
|
+
defaultMessage: "Add a new payment method or set a default payment method for your payments.",
|
|
72
|
+
id: "screens.payment_method_management.description",
|
|
73
|
+
description: "The descriptive text for the payment method management screen"
|
|
74
|
+
})
|
|
75
|
+
}, null, 8, ["title", "description"])
|
|
76
|
+
]),
|
|
77
|
+
content: withCtx(() => [
|
|
78
|
+
createVNode(unref(_sfc_main$5), {
|
|
79
|
+
"no-border": "",
|
|
80
|
+
"no-spacing": "",
|
|
81
|
+
"content-background": "none",
|
|
82
|
+
title: "Your payment methods"
|
|
83
|
+
}, {
|
|
84
|
+
default: withCtx(() => [
|
|
85
|
+
createVNode(_sfc_main$6, {
|
|
86
|
+
"payment-methods": __props.paymentMethods,
|
|
87
|
+
onSetDefault: _cache[0] || (_cache[0] = ($event) => emit("set-default"))
|
|
88
|
+
}, null, 8, ["payment-methods"])
|
|
89
|
+
]),
|
|
90
|
+
_: 1
|
|
91
|
+
}),
|
|
92
|
+
showPaymentMethodForm.value ? (openBlock(), createBlock(_sfc_main$7, {
|
|
93
|
+
key: 0,
|
|
94
|
+
customer: __props.customer,
|
|
95
|
+
"payment-method-options": __props.paymentMethodOptions
|
|
96
|
+
}, null, 8, ["customer", "payment-method-options"])) : createCommentVNode("", true),
|
|
97
|
+
showPaymentMethodForm.value ? (openBlock(), createBlock(unref(_sfc_main$8), {
|
|
98
|
+
key: 1,
|
|
99
|
+
color: "gray",
|
|
100
|
+
variant: "outline",
|
|
101
|
+
onClick: _cache[1] || (_cache[1] = ($event) => showPaymentMethodForm.value = false)
|
|
102
|
+
}, {
|
|
103
|
+
default: withCtx(() => [..._cache[3] || (_cache[3] = [
|
|
104
|
+
createTextVNode("Cancel", -1)
|
|
105
|
+
])]),
|
|
106
|
+
_: 1
|
|
107
|
+
})) : (openBlock(), createBlock(unref(_sfc_main$8), {
|
|
108
|
+
key: 2,
|
|
109
|
+
color: "gray",
|
|
110
|
+
variant: "outline",
|
|
111
|
+
onClick: _cache[2] || (_cache[2] = ($event) => showPaymentMethodForm.value = true)
|
|
112
|
+
}, {
|
|
113
|
+
default: withCtx(() => [..._cache[4] || (_cache[4] = [
|
|
114
|
+
createTextVNode("Add payment method", -1)
|
|
115
|
+
])]),
|
|
116
|
+
_: 1
|
|
117
|
+
}))
|
|
118
|
+
]),
|
|
119
|
+
_: 1
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
125
|
+
__name: "PaymentMethodsManagement.entry.view",
|
|
126
|
+
props: {
|
|
127
|
+
environment: { type: String },
|
|
128
|
+
locale: { type: String },
|
|
129
|
+
dateLocale: { type: String },
|
|
130
|
+
messages: { type: Object },
|
|
131
|
+
primaryColor: { type: String },
|
|
132
|
+
secondaryColor: { type: String },
|
|
133
|
+
isShadowRoot: { type: Boolean },
|
|
134
|
+
experimentalFeatures: { type: Array },
|
|
135
|
+
logLevel: { type: String },
|
|
136
|
+
onLog: { type: Function },
|
|
137
|
+
allowedPortalTypes: { type: Array },
|
|
138
|
+
portalObject: { type: Object },
|
|
139
|
+
cssOverrides: { type: [String, Array] },
|
|
140
|
+
branding: { type: Object }
|
|
141
|
+
},
|
|
142
|
+
setup(__props) {
|
|
143
|
+
const props = __props;
|
|
144
|
+
const customerId = props.portalObject.customer_id;
|
|
145
|
+
const { customer, get: fetchCustomer } = useCustomer({ customerId });
|
|
146
|
+
const { items: paymentMethods, fetchInitial } = usePaymentMethods({
|
|
147
|
+
customerId: props.portalObject.customer_id
|
|
148
|
+
});
|
|
149
|
+
const { paymentMethodOptions, get: fetchPaymentMethodOptions } = usePaymentMethodOptions();
|
|
150
|
+
const { isLoading } = useLoadInitialData(
|
|
151
|
+
fetchCustomer.execute(),
|
|
152
|
+
fetchInitial(),
|
|
153
|
+
fetchPaymentMethodOptions({ customerId: props.portalObject.customer_id })
|
|
154
|
+
);
|
|
155
|
+
return (_ctx, _cache) => {
|
|
156
|
+
return renderSlot(_ctx.$slots, "default", {
|
|
157
|
+
customer: unref(customer),
|
|
158
|
+
paymentMethods: unref(paymentMethods),
|
|
159
|
+
paymentMethodOptions: unref(paymentMethodOptions),
|
|
160
|
+
isLoading: unref(isLoading),
|
|
161
|
+
refreshPaymentMethods: unref(fetchInitial)
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
167
|
+
__name: "PaymentMethodsManagement.entry",
|
|
168
|
+
props: {
|
|
169
|
+
environment: { type: String },
|
|
170
|
+
locale: { type: String },
|
|
171
|
+
dateLocale: { type: String },
|
|
172
|
+
messages: { type: Object },
|
|
173
|
+
primaryColor: { type: String },
|
|
174
|
+
secondaryColor: { type: String },
|
|
175
|
+
isShadowRoot: { type: Boolean },
|
|
176
|
+
experimentalFeatures: { type: Array },
|
|
177
|
+
logLevel: { type: String },
|
|
178
|
+
onLog: { type: Function },
|
|
179
|
+
allowedPortalTypes: { type: Array },
|
|
180
|
+
portalObject: { type: Object },
|
|
181
|
+
cssOverrides: { type: [String, Array] },
|
|
182
|
+
branding: { type: Object }
|
|
183
|
+
},
|
|
184
|
+
setup(__props) {
|
|
185
|
+
return (_ctx, _cache) => {
|
|
186
|
+
var _a, _b, _c, _d;
|
|
187
|
+
return openBlock(), createBlock(unref(_sfc_main$9), {
|
|
188
|
+
"custom-element-name": unref(COMPONENT_NAME),
|
|
189
|
+
environment: __props.environment,
|
|
190
|
+
locale: __props.locale,
|
|
191
|
+
"portal-object": __props.portalObject,
|
|
192
|
+
"allowed-portal-types": ["CUSTOMER"],
|
|
193
|
+
"primary-color": (_b = (_a = __props.branding) == null ? void 0 : _a.colors) == null ? void 0 : _b.primary,
|
|
194
|
+
"secondary-color": (_d = (_c = __props.branding) == null ? void 0 : _c.colors) == null ? void 0 : _d.secondary,
|
|
195
|
+
"experimental-features": __props.experimentalFeatures,
|
|
196
|
+
"log-level": __props.logLevel,
|
|
197
|
+
"on-log": __props.onLog,
|
|
198
|
+
onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
|
|
199
|
+
}, {
|
|
200
|
+
default: withCtx(() => [
|
|
201
|
+
createVNode(_sfc_main$1, normalizeProps(guardReactiveProps(_ctx.$props)), {
|
|
202
|
+
default: withCtx(({ customer, paymentMethods, paymentMethodOptions, isLoading, refreshPaymentMethods }) => [
|
|
203
|
+
customer ? (openBlock(), createBlock(_sfc_main$2, {
|
|
204
|
+
key: 0,
|
|
205
|
+
"is-loading": isLoading,
|
|
206
|
+
"payment-methods": paymentMethods,
|
|
207
|
+
"payment-method-options": paymentMethodOptions,
|
|
208
|
+
customer,
|
|
209
|
+
onSetDefault: refreshPaymentMethods
|
|
210
|
+
}, null, 8, ["is-loading", "payment-methods", "payment-method-options", "customer", "onSetDefault"])) : createCommentVNode("", true)
|
|
211
|
+
]),
|
|
212
|
+
_: 1
|
|
213
|
+
}, 16)
|
|
214
|
+
]),
|
|
215
|
+
_: 1
|
|
216
|
+
}, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
const SolvimonPaymentMethodsManagement = defineCustomElement(_sfc_main);
|
|
221
|
+
const COMPONENT_NAME = getComponentName("payment-methods-management");
|
|
222
|
+
const defineSolvimonPaymentMethodsManagement = () => {
|
|
223
|
+
if (!customElements.get(COMPONENT_NAME)) {
|
|
224
|
+
customElements.define(COMPONENT_NAME, SolvimonPaymentMethodsManagement);
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
export {
|
|
228
|
+
COMPONENT_NAME,
|
|
229
|
+
SolvimonPaymentMethodsManagement,
|
|
230
|
+
defineSolvimonPaymentMethodsManagement
|
|
231
|
+
};
|