@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("vue"),t=require("./vendor-ui-C3Tq-qY_.js"),n=require("./Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),o=require("./PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BxdcIX-Z.js"),a=e.defineComponent({__name:"PaymentMethodForm",props:{customer:{type:Object},paymentMethodOptions:{type:Array},configuration:{type:Object},isLoading:{type:Boolean,default:!1},countryCode:{type:String}},emits:["payment-success","payment-failed"],setup(a,{emit:r}){const i={currency:"EUR",quantity:"0"},u=a,s=r,{$t:m}=t.useIntl(),c=e.ref(),l=e.ref(),d=e.ref(!1);function p(){var e;d.value=!0,null==(e=c.value)||e.submit()}function v(){d.value=!1,s("payment-success")}function y(e){d.value=!1,s("payment-failed",e)}const f=e.computed(()=>{return"AUTHORIZE"===(null==(e=u.configuration)?void 0:e.variant)?e:{...e,variant:"TOKENIZE"};var e}),_=e.computed(()=>{let e="NL";if(u.countryCode)return e=u.countryCode,e;if(u.customer){const n=t.getCustomerCountry(u.customer);if(n)return e=n,e}return"NL"}),g=e.computed(()=>{const e=f.value.variant,n=t.getCustomerName(u.customer),o={amount:f.value.amount??i,paymentMethodOptions:u.paymentMethodOptions,countryCode:_.value,...u.customer.email?{email:u.customer.email}:{},...n?{name:n}:{},validateOnSubmit:f.value.validateOnSubmit,forceStorePaymentMethod:f.value.forceStorePaymentMethod,selectedOption:f.value.selectedOption,invoiceId:f.value.invoiceId};return"AUTHORIZE"===e?{...o,variant:e,context:f.value.context}:{...o,variant:"TOKENIZE",customerId:u.customer.id}});return(r,i)=>a.isLoading?(e.openBlock(),e.createBlock(n._sfc_main,{key:0,variant:"section",class:"sv-payment-method-form sv-root sv-component sv-loading min-h-[180px]","data-testid":"payment-method-form-skeleton"})):(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:1,class:"sv-payment-method-form sv-root sv-component","no-border":"","no-spacing":"","content-background":"none",title:e.unref(m)({defaultMessage:"Available payment methods",description:"Title of the available payment methods form",id:"components.payment_method_form.section_title"})},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass({"pointer-events-none opacity-60":d.value})},[e.createVNode(o._sfc_main,e.mergeProps({ref_key:"paymentIntegrationFormRef",ref:c,class:"sv-payment-method-form__integration"},g.value,{onSelect:i[0]||(i[0]=e=>l.value=e),onPaymentSuccess:v,onPaymentFailed:y}),null,16)],2),e.createVNode(e.unref(t._sfc_main$1),{color:"primary",class:"mt-4 w-full",loading:d.value,onClick:p},{default:e.withCtx(()=>[...i[1]||(i[1]=[e.createTextVNode("Save payment method",-1)])]),_:1},8,["loading"])]),_:1},8,["title"]))}});exports._sfc_main=a;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, openBlock, createBlock, unref, withCtx, createElementVNode, normalizeClass, createVNode, mergeProps, createTextVNode } from "vue";
|
|
2
|
+
import { u as useIntl, g as getCustomerCountry, b as getCustomerName, _ as _sfc_main$2, c as _sfc_main$4 } from "./vendor-ui-B8IlviSs.mjs";
|
|
3
|
+
import { _ as _sfc_main$1 } from "./Skeleton.vue_vue_type_script_setup_true_lang-DGMxHc20.mjs";
|
|
4
|
+
import { _ as _sfc_main$3 } from "./PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-aP-gCq7V.mjs";
|
|
5
|
+
const FALLBACK_COUNTRY_CODE = "NL";
|
|
6
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "PaymentMethodForm",
|
|
8
|
+
props: {
|
|
9
|
+
customer: { type: Object },
|
|
10
|
+
paymentMethodOptions: { type: Array },
|
|
11
|
+
configuration: { type: Object },
|
|
12
|
+
isLoading: { type: Boolean, default: false },
|
|
13
|
+
countryCode: { type: String }
|
|
14
|
+
},
|
|
15
|
+
emits: ["payment-success", "payment-failed"],
|
|
16
|
+
setup(__props, { emit: __emit }) {
|
|
17
|
+
const DEFAULT_AMOUNT = {
|
|
18
|
+
currency: "EUR",
|
|
19
|
+
quantity: "0"
|
|
20
|
+
};
|
|
21
|
+
const props = __props;
|
|
22
|
+
const emit = __emit;
|
|
23
|
+
const { $t } = useIntl();
|
|
24
|
+
const paymentIntegrationFormRef = ref();
|
|
25
|
+
const selectedPaymentMethod = ref();
|
|
26
|
+
const isPaymentPending = ref(false);
|
|
27
|
+
function handleSubmit() {
|
|
28
|
+
var _a;
|
|
29
|
+
isPaymentPending.value = true;
|
|
30
|
+
(_a = paymentIntegrationFormRef.value) == null ? void 0 : _a.submit();
|
|
31
|
+
}
|
|
32
|
+
function handlePaymentSuccess() {
|
|
33
|
+
isPaymentPending.value = false;
|
|
34
|
+
emit("payment-success");
|
|
35
|
+
}
|
|
36
|
+
function handlePaymentFailed(error) {
|
|
37
|
+
isPaymentPending.value = false;
|
|
38
|
+
emit("payment-failed", error);
|
|
39
|
+
}
|
|
40
|
+
const resolveConfiguration = (configuration2) => {
|
|
41
|
+
if ((configuration2 == null ? void 0 : configuration2.variant) === "AUTHORIZE") {
|
|
42
|
+
return configuration2;
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
...configuration2,
|
|
46
|
+
variant: "TOKENIZE"
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
const configuration = computed(
|
|
50
|
+
() => resolveConfiguration(props.configuration)
|
|
51
|
+
);
|
|
52
|
+
const countryCode = computed(() => {
|
|
53
|
+
let result = FALLBACK_COUNTRY_CODE;
|
|
54
|
+
if (props.countryCode) {
|
|
55
|
+
result = props.countryCode;
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
if (props.customer) {
|
|
59
|
+
const country = getCustomerCountry(props.customer);
|
|
60
|
+
if (country) {
|
|
61
|
+
result = country;
|
|
62
|
+
return result;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return FALLBACK_COUNTRY_CODE;
|
|
66
|
+
});
|
|
67
|
+
const paymentIntegrationProps = computed(() => {
|
|
68
|
+
const variant = configuration.value.variant;
|
|
69
|
+
const customerName = getCustomerName(props.customer);
|
|
70
|
+
const commonProps = {
|
|
71
|
+
amount: configuration.value.amount ?? DEFAULT_AMOUNT,
|
|
72
|
+
paymentMethodOptions: props.paymentMethodOptions,
|
|
73
|
+
countryCode: countryCode.value,
|
|
74
|
+
...props.customer.email ? { email: props.customer.email } : {},
|
|
75
|
+
...customerName ? { name: customerName } : {},
|
|
76
|
+
validateOnSubmit: configuration.value.validateOnSubmit,
|
|
77
|
+
forceStorePaymentMethod: configuration.value.forceStorePaymentMethod,
|
|
78
|
+
selectedOption: configuration.value.selectedOption,
|
|
79
|
+
invoiceId: configuration.value.invoiceId
|
|
80
|
+
};
|
|
81
|
+
if (variant === "AUTHORIZE") {
|
|
82
|
+
return {
|
|
83
|
+
...commonProps,
|
|
84
|
+
variant,
|
|
85
|
+
context: configuration.value.context
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
...commonProps,
|
|
90
|
+
variant: "TOKENIZE",
|
|
91
|
+
customerId: props.customer.id
|
|
92
|
+
};
|
|
93
|
+
});
|
|
94
|
+
return (_ctx, _cache) => {
|
|
95
|
+
return __props.isLoading ? (openBlock(), createBlock(_sfc_main$1, {
|
|
96
|
+
key: 0,
|
|
97
|
+
variant: "section",
|
|
98
|
+
class: "sv-payment-method-form sv-root sv-component sv-loading min-h-[180px]",
|
|
99
|
+
"data-testid": "payment-method-form-skeleton"
|
|
100
|
+
})) : (openBlock(), createBlock(unref(_sfc_main$2), {
|
|
101
|
+
key: 1,
|
|
102
|
+
class: "sv-payment-method-form sv-root sv-component",
|
|
103
|
+
"no-border": "",
|
|
104
|
+
"no-spacing": "",
|
|
105
|
+
"content-background": "none",
|
|
106
|
+
title: unref($t)({
|
|
107
|
+
defaultMessage: "Available payment methods",
|
|
108
|
+
description: "Title of the available payment methods form",
|
|
109
|
+
id: "components.payment_method_form.section_title"
|
|
110
|
+
})
|
|
111
|
+
}, {
|
|
112
|
+
default: withCtx(() => [
|
|
113
|
+
createElementVNode("div", {
|
|
114
|
+
class: normalizeClass({ "pointer-events-none opacity-60": isPaymentPending.value })
|
|
115
|
+
}, [
|
|
116
|
+
createVNode(_sfc_main$3, mergeProps({
|
|
117
|
+
ref_key: "paymentIntegrationFormRef",
|
|
118
|
+
ref: paymentIntegrationFormRef,
|
|
119
|
+
class: "sv-payment-method-form__integration"
|
|
120
|
+
}, paymentIntegrationProps.value, {
|
|
121
|
+
onSelect: _cache[0] || (_cache[0] = (payload) => selectedPaymentMethod.value = payload),
|
|
122
|
+
onPaymentSuccess: handlePaymentSuccess,
|
|
123
|
+
onPaymentFailed: handlePaymentFailed
|
|
124
|
+
}), null, 16)
|
|
125
|
+
], 2),
|
|
126
|
+
createVNode(unref(_sfc_main$4), {
|
|
127
|
+
color: "primary",
|
|
128
|
+
class: "mt-4 w-full",
|
|
129
|
+
loading: isPaymentPending.value,
|
|
130
|
+
onClick: handleSubmit
|
|
131
|
+
}, {
|
|
132
|
+
default: withCtx(() => [..._cache[1] || (_cache[1] = [
|
|
133
|
+
createTextVNode("Save payment method", -1)
|
|
134
|
+
])]),
|
|
135
|
+
_: 1
|
|
136
|
+
}, 8, ["loading"])
|
|
137
|
+
]),
|
|
138
|
+
_: 1
|
|
139
|
+
}, 8, ["title"]));
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
export {
|
|
144
|
+
_sfc_main as _
|
|
145
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("vue"),t=require("./vendor-ui-C3Tq-qY_.js"),n=require("./useService-CHrkefKd.js"),o=require("./paymentMethods-u5y9B5ng.js");const a={key:0,class:"sv-payment-methods__list grid grid-cols-1 gap-4"},l=e.defineComponent({__name:"PaymentMethodsList",props:{paymentMethods:{type:Array}},emits:["delete","set-default"],setup(l,{emit:d}){const s=d,{$t:m}=t.useIntl(),i=e.ref(null),{execute:u}=function(){const{setDefaultPaymentMethod:e}=o.createPaymentMethodsService(),{data:t,execute:a,error:l,isPending:d}=n.useService({service:t=>e({paymentMethodId:t})});return{data:t,execute:a,error:l,isPending:d}}(),{getContextMenuItems:r}=function({onSetDefault:e,onDeleteRequest:n}){const{$t:o}=t.useIntl();return{getContextMenuItems:t=>{const a=[];return t.is_default||a.push({label:o({defaultMessage:"Set as default",id:"payment_method.context_menu.set_as_default.label",description:"Context menu option for setting the default payment method"}),onClick:()=>e(t)}),a.push({label:o({defaultMessage:"Delete",id:"payment_method.context_menu.delete.label",description:"Context menu option for deleting the payment method"}),onClick:()=>n(t)}),a}}}({onDeleteRequest:e=>{i.value=e},onSetDefault:async e=>{await u(e.id),s("set-default",e)}});function c(){i.value&&s("delete",i.value),i.value=null}return(n,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[l.paymentMethods.length>0?(e.openBlock(),e.createElementBlock("div",a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.paymentMethods,n=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:n.id,class:"sv-payment-methods__item"},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$6),{class:"sv-payment-methods__item-content","payment-method":n,options:e.unref(r)(n)},null,8,["payment-method","options"])]),_:2},1024))),128))])):e.createCommentVNode("",!0),e.createVNode(e.unref(t._sfc_main$12),{"show-modal":!!i.value,title:e.unref(m)({id:"payment_methods_list.delete_modal.title",defaultMessage:"Delete payment method",description:"Title of the delete payment method confirmation modal"}),"confirm-button-text":e.unref(m)({id:"payment_methods_list.delete_modal.confirm",defaultMessage:"Delete",description:"Confirm button in the delete payment method modal"}),"cancel-button-text":e.unref(m)({id:"payment_methods_list.delete_modal.cancel",defaultMessage:"Cancel",description:"Cancel button in the delete payment method modal"}),onConfirm:c,onClose:o[0]||(o[0]=e=>i.value=null)},e.createSlots({_:2},[i.value?{name:"body",fn:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$3),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(m)({id:"payment_methods_list.delete_modal.body",defaultMessage:"Are you sure you want to delete this payment method?",description:"Confirmation message in the delete payment method modal"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main),null,{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$6),{"payment-method":i.value},null,8,["payment-method"])]),_:1})]),key:"0"}:void 0]),1032,["show-modal","title","confirm-button-text","cancel-button-text"])],64))}});exports._sfc_main=l;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { defineComponent, ref, openBlock, createElementBlock, Fragment, renderList, createBlock, unref, withCtx, createVNode, createCommentVNode, createSlots, createTextVNode, toDisplayString } from "vue";
|
|
2
|
+
import { u as useIntl, _ as _sfc_main$1, m as _sfc_main$2, y as _sfc_main$3, e as _sfc_main$4 } from "./vendor-ui-B8IlviSs.mjs";
|
|
3
|
+
import { u as useService } from "./useService-DF57xuDd.mjs";
|
|
4
|
+
import { c as createPaymentMethodsService } from "./paymentMethods-D-5FNN8W.mjs";
|
|
5
|
+
function usePaymentMethodContextMenuOptions({
|
|
6
|
+
onSetDefault,
|
|
7
|
+
onDeleteRequest
|
|
8
|
+
}) {
|
|
9
|
+
const { $t } = useIntl();
|
|
10
|
+
const getContextMenuItems = (paymentMethod) => {
|
|
11
|
+
const items = [];
|
|
12
|
+
if (!paymentMethod.is_default) {
|
|
13
|
+
items.push({
|
|
14
|
+
label: $t({
|
|
15
|
+
defaultMessage: "Set as default",
|
|
16
|
+
id: "payment_method.context_menu.set_as_default.label",
|
|
17
|
+
description: "Context menu option for setting the default payment method"
|
|
18
|
+
}),
|
|
19
|
+
onClick: () => onSetDefault(paymentMethod)
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
items.push({
|
|
23
|
+
label: $t({
|
|
24
|
+
defaultMessage: "Delete",
|
|
25
|
+
id: "payment_method.context_menu.delete.label",
|
|
26
|
+
description: "Context menu option for deleting the payment method"
|
|
27
|
+
}),
|
|
28
|
+
onClick: () => onDeleteRequest(paymentMethod)
|
|
29
|
+
});
|
|
30
|
+
return items;
|
|
31
|
+
};
|
|
32
|
+
return { getContextMenuItems };
|
|
33
|
+
}
|
|
34
|
+
function useSetDefaultPaymentMethod() {
|
|
35
|
+
const { setDefaultPaymentMethod } = createPaymentMethodsService();
|
|
36
|
+
const { data, execute, error, isPending } = useService({
|
|
37
|
+
service: (paymentMethodId) => setDefaultPaymentMethod({ paymentMethodId })
|
|
38
|
+
});
|
|
39
|
+
return { data, execute, error, isPending };
|
|
40
|
+
}
|
|
41
|
+
const _hoisted_1 = {
|
|
42
|
+
key: 0,
|
|
43
|
+
class: "sv-payment-methods__list grid grid-cols-1 gap-4"
|
|
44
|
+
};
|
|
45
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
46
|
+
__name: "PaymentMethodsList",
|
|
47
|
+
props: {
|
|
48
|
+
paymentMethods: { type: Array }
|
|
49
|
+
},
|
|
50
|
+
emits: ["delete", "set-default"],
|
|
51
|
+
setup(__props, { emit: __emit }) {
|
|
52
|
+
const emit = __emit;
|
|
53
|
+
const { $t } = useIntl();
|
|
54
|
+
const pendingDeletePaymentMethod = ref(null);
|
|
55
|
+
const { execute: setDefault } = useSetDefaultPaymentMethod();
|
|
56
|
+
const { getContextMenuItems } = usePaymentMethodContextMenuOptions({
|
|
57
|
+
onDeleteRequest: (paymentMethod) => {
|
|
58
|
+
pendingDeletePaymentMethod.value = paymentMethod;
|
|
59
|
+
},
|
|
60
|
+
onSetDefault: async (paymentMethod) => {
|
|
61
|
+
await setDefault(paymentMethod.id);
|
|
62
|
+
emit("set-default", paymentMethod);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
function handleConfirmDelete() {
|
|
66
|
+
if (pendingDeletePaymentMethod.value) {
|
|
67
|
+
emit("delete", pendingDeletePaymentMethod.value);
|
|
68
|
+
}
|
|
69
|
+
pendingDeletePaymentMethod.value = null;
|
|
70
|
+
}
|
|
71
|
+
return (_ctx, _cache) => {
|
|
72
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
73
|
+
__props.paymentMethods.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
74
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.paymentMethods, (paymentMethod) => {
|
|
75
|
+
return openBlock(), createBlock(unref(_sfc_main$1), {
|
|
76
|
+
key: paymentMethod.id,
|
|
77
|
+
class: "sv-payment-methods__item"
|
|
78
|
+
}, {
|
|
79
|
+
default: withCtx(() => [
|
|
80
|
+
createVNode(unref(_sfc_main$2), {
|
|
81
|
+
class: "sv-payment-methods__item-content",
|
|
82
|
+
"payment-method": paymentMethod,
|
|
83
|
+
options: unref(getContextMenuItems)(paymentMethod)
|
|
84
|
+
}, null, 8, ["payment-method", "options"])
|
|
85
|
+
]),
|
|
86
|
+
_: 2
|
|
87
|
+
}, 1024);
|
|
88
|
+
}), 128))
|
|
89
|
+
])) : createCommentVNode("", true),
|
|
90
|
+
createVNode(unref(_sfc_main$3), {
|
|
91
|
+
"show-modal": !!pendingDeletePaymentMethod.value,
|
|
92
|
+
title: unref($t)({
|
|
93
|
+
id: "payment_methods_list.delete_modal.title",
|
|
94
|
+
defaultMessage: "Delete payment method",
|
|
95
|
+
description: "Title of the delete payment method confirmation modal"
|
|
96
|
+
}),
|
|
97
|
+
"confirm-button-text": unref($t)({
|
|
98
|
+
id: "payment_methods_list.delete_modal.confirm",
|
|
99
|
+
defaultMessage: "Delete",
|
|
100
|
+
description: "Confirm button in the delete payment method modal"
|
|
101
|
+
}),
|
|
102
|
+
"cancel-button-text": unref($t)({
|
|
103
|
+
id: "payment_methods_list.delete_modal.cancel",
|
|
104
|
+
defaultMessage: "Cancel",
|
|
105
|
+
description: "Cancel button in the delete payment method modal"
|
|
106
|
+
}),
|
|
107
|
+
onConfirm: handleConfirmDelete,
|
|
108
|
+
onClose: _cache[0] || (_cache[0] = ($event) => pendingDeletePaymentMethod.value = null)
|
|
109
|
+
}, createSlots({ _: 2 }, [
|
|
110
|
+
pendingDeletePaymentMethod.value ? {
|
|
111
|
+
name: "body",
|
|
112
|
+
fn: withCtx(() => [
|
|
113
|
+
createVNode(unref(_sfc_main$4), null, {
|
|
114
|
+
default: withCtx(() => [
|
|
115
|
+
createTextVNode(toDisplayString(unref($t)({
|
|
116
|
+
id: "payment_methods_list.delete_modal.body",
|
|
117
|
+
defaultMessage: "Are you sure you want to delete this payment method?",
|
|
118
|
+
description: "Confirmation message in the delete payment method modal"
|
|
119
|
+
})), 1)
|
|
120
|
+
]),
|
|
121
|
+
_: 1
|
|
122
|
+
}),
|
|
123
|
+
createVNode(unref(_sfc_main$1), null, {
|
|
124
|
+
default: withCtx(() => [
|
|
125
|
+
createVNode(unref(_sfc_main$2), { "payment-method": pendingDeletePaymentMethod.value }, null, 8, ["payment-method"])
|
|
126
|
+
]),
|
|
127
|
+
_: 1
|
|
128
|
+
})
|
|
129
|
+
]),
|
|
130
|
+
key: "0"
|
|
131
|
+
} : void 0
|
|
132
|
+
]), 1032, ["show-modal", "title", "confirm-button-text", "cancel-button-text"])
|
|
133
|
+
], 64);
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
export {
|
|
138
|
+
_sfc_main as _
|
|
139
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("vue"),t=require("./vendor-ui-C3Tq-qY_.js"),a={class:"flex items-start"},n={class:"flex flex-col grow"},s={class:"flex items-center gap-1"},l={class:"flex items-center ml-4 self-center"},r=e.defineComponent({__name:"PricingGroupContent",props:{name:{type:String},description:{type:String}},setup:r=>(c,i)=>(e.openBlock(),e.createElementBlock("div",a,[e.createElementVNode("div",n,[e.createElementVNode("div",s,[e.createVNode(e.unref(t._sfc_main$3),{tag:"span",variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.name),1)]),_:1}),e.renderSlot(c.$slots,"badge")]),e.createVNode(e.unref(t._sfc_main$3),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.description),1)]),_:1})]),e.createElementVNode("div",l,[e.renderSlot(c.$slots,"default")])]))}),c={class:"sv-empty-state__body flex flex-col items-center justify-center py-4"},i=e.defineComponent({__name:"EmptyStatePlaceholder",props:{icon:{type:null}},setup:a=>(n,s)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{class:"sv-empty-state"},{default:e.withCtx(()=>[e.createElementVNode("div",c,[e.createVNode(e.unref(t._sfc_main$14),{icon:a.icon,size:"lg",class:"sv-empty-state__icon text-gray-500"},null,8,["icon"]),e.createVNode(e.unref(t._sfc_main$3),{center:"",tag:"span",variant:"body-sm",weight:"semibold",shade:"lighter",class:"sv-empty-state__title mt-2"},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"title")]),_:3}),e.createVNode(e.unref(t._sfc_main$3),{center:"",tag:"span",variant:"body-xs",shade:"lightest",class:"sv-empty-state__message mt-1"},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"message")]),_:3})])]),_:3}))}),o={class:"flex justify-around"},d={class:"flex items-center gap-0.5"},p=["aria-label","innerHTML"],m=e.defineComponent({__name:"SecurePaymentsKPI",props:{paymentMethodOptions:{type:Array}},setup(a){const n=a,{$t:s}=t.useIntl(),l={ADYEN:{svg:'<svg xmlns="http://www.w3.org/2000/svg" width="40" height="15" fill="none" viewBox="0 0 40 15"><path fill="currentColor" d="M.049 2.917h5.845c.646 0 1.17.522 1.17 1.166v5.834H1.217c-.646 0-1.17-.522-1.17-1.167V5.833h2.924v2.334H4.14v-3.5H.049zm32.735 0v7h2.922v-5.25h1.17v5.25h2.922V4.083c0-.644-.523-1.166-1.169-1.166zm-16.367 9.916h5.845c.646 0 1.17-.522 1.17-1.166v-8.75h-2.924v5.25H19.34v-5.25h-2.922V8.75c0 .645.523 1.167 1.169 1.167h2.922v1.166h-4.091zm15.197-2.916H25.77c-.646 0-1.17-.522-1.17-1.167V2.917h5.846c.646 0 1.17.522 1.17 1.166V7h-2.923V4.667h-1.17v3.5h4.092zM15.248 0v9.917H9.402c-.646 0-1.17-.522-1.17-1.167V4.083c0-.644.524-1.166 1.17-1.166h1.754v5.25h1.169V0z"/></svg>',label:"Adyen"},STRIPE:{svg:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="15" viewBox="0 0 36 15"><path d="M35.996 7.746c0-2.559-1.238-4.578-3.61-4.578-2.378 0-3.816 2.02-3.816 4.559 0 3.011 1.7 4.53 4.137 4.53 1.191 0 2.09-.269 2.77-.648v-2c-.68.34-1.457.547-2.45.547-.968 0-1.828-.34-1.937-1.52h4.887c0-.128.02-.648.02-.89m-4.937-.95c0-1.128.691-1.597 1.32-1.597.61 0 1.258.469 1.258 1.598ZM24.707 3.168c-.977 0-1.61.46-1.957.781l-.133-.62h-2.199v11.66l2.5-.532.012-2.828c.36.258.89.629 1.77.629 1.788 0 3.417-1.442 3.417-4.61-.008-2.898-1.66-4.48-3.41-4.48m-.598 6.89c-.59 0-.941-.21-1.18-.472l-.011-3.707c.262-.29.621-.492 1.191-.492.91 0 1.54 1.02 1.54 2.332 0 1.34-.622 2.34-1.54 2.34M16.98 2.578l2.508-.539V.008L16.98.539ZM16.98 3.34h2.508v8.746H16.98ZM14.29 4.078l-.161-.738h-2.16v8.746h2.5v-5.93c.59-.77 1.59-.629 1.898-.52V3.34c-.316-.121-1.488-.34-2.078.738M9.29 1.168l-2.438.52-.012 8.011c0 1.48 1.11 2.57 2.59 2.57.82 0 1.418-.152 1.75-.332v-2.03c-.32.132-1.899.59-1.899-.887V5.469h1.899v-2.13H9.28ZM2.531 5.879c0-.39.32-.54.848-.54a5.56 5.56 0 0 1 2.48.638V3.629a6.55 6.55 0 0 0-2.48-.461C1.352 3.168 0 4.227 0 6c0 2.758 3.8 2.316 3.8 3.508 0 .46-.402.61-.96.61-.828 0-1.89-.34-2.73-.802V11.7c.93.399 1.87.57 2.73.57 2.078 0 3.512-1.03 3.512-2.82-.012-2.98-3.82-2.453-3.82-3.57m0 0" style="stroke:none;fill-rule:evenodd;fill:currentColor;fill-opacity:1"/></svg>',label:"Stripe"}},r=e.computed(()=>{const e=n.paymentMethodOptions.find(({integration:e})=>{var t;return null!=(null==(t=e.payment_gateway)?void 0:t.variant)&&e.payment_gateway.variant in l});return e?l[e.integration.payment_gateway.variant]:null}),c=e.computed(()=>r.value?s({defaultMessage:"Secure and encrypted payments by",description:"Secure encrypted payments KPI for a specific vendor, followed by a vendor logo",id:"secure_payments_kpi.specific_vendor"}):s({defaultMessage:"Secure and encrypted payments",description:"Secure encrypted payments KPI",id:"secure_payments_kpi.generic"}));return(a,n)=>(e.openBlock(),e.createElementBlock("div",o,[e.createElementVNode("div",d,[e.createVNode(e.unref(t._sfc_main$14),{icon:"lock",size:"xs"}),e.createVNode(e.unref(t._sfc_main$3),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(c.value),1),n[0]||(n[0]=e.createTextVNode(e.toDisplayString(" ")+" ",-1)),r.value?(e.openBlock(),e.createElementBlock("span",{key:0,"aria-label":r.value.label,role:"img",class:"inline-block h-[15px] align-middle",innerHTML:r.value.svg},null,8,p)):e.createCommentVNode("",!0)]),_:1})])]))}});exports._sfc_main=r,exports._sfc_main$1=m,exports._sfc_main$2=i;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, createVNode, unref, withCtx, createTextVNode, toDisplayString, renderSlot, createBlock, computed, createCommentVNode } from "vue";
|
|
2
|
+
import { e as _sfc_main$3, _ as _sfc_main$4, A as _sfc_main$5, u as useIntl } from "./vendor-ui-B8IlviSs.mjs";
|
|
3
|
+
const _hoisted_1$2 = { class: "flex items-start" };
|
|
4
|
+
const _hoisted_2$1 = { class: "flex flex-col grow" };
|
|
5
|
+
const _hoisted_3$1 = { class: "flex items-center gap-1" };
|
|
6
|
+
const _hoisted_4 = { class: "flex items-center ml-4 self-center" };
|
|
7
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "PricingGroupContent",
|
|
9
|
+
props: {
|
|
10
|
+
name: { type: String },
|
|
11
|
+
description: { type: String }
|
|
12
|
+
},
|
|
13
|
+
setup(__props) {
|
|
14
|
+
return (_ctx, _cache) => {
|
|
15
|
+
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
16
|
+
createElementVNode("div", _hoisted_2$1, [
|
|
17
|
+
createElementVNode("div", _hoisted_3$1, [
|
|
18
|
+
createVNode(unref(_sfc_main$3), {
|
|
19
|
+
tag: "span",
|
|
20
|
+
variant: "body-sm",
|
|
21
|
+
weight: "semibold"
|
|
22
|
+
}, {
|
|
23
|
+
default: withCtx(() => [
|
|
24
|
+
createTextVNode(toDisplayString(__props.name), 1)
|
|
25
|
+
]),
|
|
26
|
+
_: 1
|
|
27
|
+
}),
|
|
28
|
+
renderSlot(_ctx.$slots, "badge")
|
|
29
|
+
]),
|
|
30
|
+
createVNode(unref(_sfc_main$3), {
|
|
31
|
+
tag: "span",
|
|
32
|
+
variant: "body-xs",
|
|
33
|
+
shade: "lighter"
|
|
34
|
+
}, {
|
|
35
|
+
default: withCtx(() => [
|
|
36
|
+
createTextVNode(toDisplayString(__props.description), 1)
|
|
37
|
+
]),
|
|
38
|
+
_: 1
|
|
39
|
+
})
|
|
40
|
+
]),
|
|
41
|
+
createElementVNode("div", _hoisted_4, [
|
|
42
|
+
renderSlot(_ctx.$slots, "default")
|
|
43
|
+
])
|
|
44
|
+
]);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
const _hoisted_1$1 = { class: "sv-empty-state__body flex flex-col items-center justify-center py-4" };
|
|
49
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
50
|
+
__name: "EmptyStatePlaceholder",
|
|
51
|
+
props: {
|
|
52
|
+
icon: { type: null }
|
|
53
|
+
},
|
|
54
|
+
setup(__props) {
|
|
55
|
+
return (_ctx, _cache) => {
|
|
56
|
+
return openBlock(), createBlock(unref(_sfc_main$4), { class: "sv-empty-state" }, {
|
|
57
|
+
default: withCtx(() => [
|
|
58
|
+
createElementVNode("div", _hoisted_1$1, [
|
|
59
|
+
createVNode(unref(_sfc_main$5), {
|
|
60
|
+
icon: __props.icon,
|
|
61
|
+
size: "lg",
|
|
62
|
+
class: "sv-empty-state__icon text-gray-500"
|
|
63
|
+
}, null, 8, ["icon"]),
|
|
64
|
+
createVNode(unref(_sfc_main$3), {
|
|
65
|
+
center: "",
|
|
66
|
+
tag: "span",
|
|
67
|
+
variant: "body-sm",
|
|
68
|
+
weight: "semibold",
|
|
69
|
+
shade: "lighter",
|
|
70
|
+
class: "sv-empty-state__title mt-2"
|
|
71
|
+
}, {
|
|
72
|
+
default: withCtx(() => [
|
|
73
|
+
renderSlot(_ctx.$slots, "title")
|
|
74
|
+
]),
|
|
75
|
+
_: 3
|
|
76
|
+
}),
|
|
77
|
+
createVNode(unref(_sfc_main$3), {
|
|
78
|
+
center: "",
|
|
79
|
+
tag: "span",
|
|
80
|
+
variant: "body-xs",
|
|
81
|
+
shade: "lightest",
|
|
82
|
+
class: "sv-empty-state__message mt-1"
|
|
83
|
+
}, {
|
|
84
|
+
default: withCtx(() => [
|
|
85
|
+
renderSlot(_ctx.$slots, "message")
|
|
86
|
+
]),
|
|
87
|
+
_: 3
|
|
88
|
+
})
|
|
89
|
+
])
|
|
90
|
+
]),
|
|
91
|
+
_: 3
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
const adyenLogo = '<svg xmlns="http://www.w3.org/2000/svg" width="40" height="15" fill="none" viewBox="0 0 40 15"><path fill="currentColor" d="M.049 2.917h5.845c.646 0 1.17.522 1.17 1.166v5.834H1.217c-.646 0-1.17-.522-1.17-1.167V5.833h2.924v2.334H4.14v-3.5H.049zm32.735 0v7h2.922v-5.25h1.17v5.25h2.922V4.083c0-.644-.523-1.166-1.169-1.166zm-16.367 9.916h5.845c.646 0 1.17-.522 1.17-1.166v-8.75h-2.924v5.25H19.34v-5.25h-2.922V8.75c0 .645.523 1.167 1.169 1.167h2.922v1.166h-4.091zm15.197-2.916H25.77c-.646 0-1.17-.522-1.17-1.167V2.917h5.846c.646 0 1.17.522 1.17 1.166V7h-2.923V4.667h-1.17v3.5h4.092zM15.248 0v9.917H9.402c-.646 0-1.17-.522-1.17-1.167V4.083c0-.644.524-1.166 1.17-1.166h1.754v5.25h1.169V0z"/></svg>';
|
|
97
|
+
const stripeLogo = '<svg xmlns="http://www.w3.org/2000/svg" width="36" height="15" viewBox="0 0 36 15"><path d="M35.996 7.746c0-2.559-1.238-4.578-3.61-4.578-2.378 0-3.816 2.02-3.816 4.559 0 3.011 1.7 4.53 4.137 4.53 1.191 0 2.09-.269 2.77-.648v-2c-.68.34-1.457.547-2.45.547-.968 0-1.828-.34-1.937-1.52h4.887c0-.128.02-.648.02-.89m-4.937-.95c0-1.128.691-1.597 1.32-1.597.61 0 1.258.469 1.258 1.598ZM24.707 3.168c-.977 0-1.61.46-1.957.781l-.133-.62h-2.199v11.66l2.5-.532.012-2.828c.36.258.89.629 1.77.629 1.788 0 3.417-1.442 3.417-4.61-.008-2.898-1.66-4.48-3.41-4.48m-.598 6.89c-.59 0-.941-.21-1.18-.472l-.011-3.707c.262-.29.621-.492 1.191-.492.91 0 1.54 1.02 1.54 2.332 0 1.34-.622 2.34-1.54 2.34M16.98 2.578l2.508-.539V.008L16.98.539ZM16.98 3.34h2.508v8.746H16.98ZM14.29 4.078l-.161-.738h-2.16v8.746h2.5v-5.93c.59-.77 1.59-.629 1.898-.52V3.34c-.316-.121-1.488-.34-2.078.738M9.29 1.168l-2.438.52-.012 8.011c0 1.48 1.11 2.57 2.59 2.57.82 0 1.418-.152 1.75-.332v-2.03c-.32.132-1.899.59-1.899-.887V5.469h1.899v-2.13H9.28ZM2.531 5.879c0-.39.32-.54.848-.54a5.56 5.56 0 0 1 2.48.638V3.629a6.55 6.55 0 0 0-2.48-.461C1.352 3.168 0 4.227 0 6c0 2.758 3.8 2.316 3.8 3.508 0 .46-.402.61-.96.61-.828 0-1.89-.34-2.73-.802V11.7c.93.399 1.87.57 2.73.57 2.078 0 3.512-1.03 3.512-2.82-.012-2.98-3.82-2.453-3.82-3.57m0 0" style="stroke:none;fill-rule:evenodd;fill:currentColor;fill-opacity:1"/></svg>';
|
|
98
|
+
const _hoisted_1 = { class: "flex justify-around" };
|
|
99
|
+
const _hoisted_2 = { class: "flex items-center gap-0.5" };
|
|
100
|
+
const _hoisted_3 = ["aria-label", "innerHTML"];
|
|
101
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
102
|
+
__name: "SecurePaymentsKPI",
|
|
103
|
+
props: {
|
|
104
|
+
paymentMethodOptions: { type: Array }
|
|
105
|
+
},
|
|
106
|
+
setup(__props) {
|
|
107
|
+
const props = __props;
|
|
108
|
+
const { $t } = useIntl();
|
|
109
|
+
const VENDOR_LOGOS = {
|
|
110
|
+
ADYEN: { svg: adyenLogo, label: "Adyen" },
|
|
111
|
+
STRIPE: { svg: stripeLogo, label: "Stripe" }
|
|
112
|
+
};
|
|
113
|
+
const vendorLogo = computed(() => {
|
|
114
|
+
const entry = props.paymentMethodOptions.find(
|
|
115
|
+
({ integration }) => {
|
|
116
|
+
var _a;
|
|
117
|
+
return ((_a = integration.payment_gateway) == null ? void 0 : _a.variant) != null && integration.payment_gateway.variant in VENDOR_LOGOS;
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
return entry ? VENDOR_LOGOS[entry.integration.payment_gateway.variant] : null;
|
|
121
|
+
});
|
|
122
|
+
const securePaymentsText = computed(() => {
|
|
123
|
+
if (vendorLogo.value) {
|
|
124
|
+
return $t({
|
|
125
|
+
defaultMessage: "Secure and encrypted payments by",
|
|
126
|
+
description: "Secure encrypted payments KPI for a specific vendor, followed by a vendor logo",
|
|
127
|
+
id: "secure_payments_kpi.specific_vendor"
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
return $t({
|
|
131
|
+
defaultMessage: "Secure and encrypted payments",
|
|
132
|
+
description: "Secure encrypted payments KPI",
|
|
133
|
+
id: "secure_payments_kpi.generic"
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
return (_ctx, _cache) => {
|
|
137
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
138
|
+
createElementVNode("div", _hoisted_2, [
|
|
139
|
+
createVNode(unref(_sfc_main$5), {
|
|
140
|
+
icon: "lock",
|
|
141
|
+
size: "xs"
|
|
142
|
+
}),
|
|
143
|
+
createVNode(unref(_sfc_main$3), {
|
|
144
|
+
tag: "span",
|
|
145
|
+
variant: "body-xs",
|
|
146
|
+
shade: "lighter"
|
|
147
|
+
}, {
|
|
148
|
+
default: withCtx(() => [
|
|
149
|
+
createElementVNode("span", null, toDisplayString(securePaymentsText.value), 1),
|
|
150
|
+
_cache[0] || (_cache[0] = createTextVNode(toDisplayString(" ") + " ", -1)),
|
|
151
|
+
vendorLogo.value ? (openBlock(), createElementBlock("span", {
|
|
152
|
+
key: 0,
|
|
153
|
+
"aria-label": vendorLogo.value.label,
|
|
154
|
+
role: "img",
|
|
155
|
+
class: "inline-block h-[15px] align-middle",
|
|
156
|
+
innerHTML: vendorLogo.value.svg
|
|
157
|
+
}, null, 8, _hoisted_3)) : createCommentVNode("", true)
|
|
158
|
+
]),
|
|
159
|
+
_: 1
|
|
160
|
+
})
|
|
161
|
+
])
|
|
162
|
+
]);
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
export {
|
|
167
|
+
_sfc_main$2 as _,
|
|
168
|
+
_sfc_main as a,
|
|
169
|
+
_sfc_main$1 as b
|
|
170
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { u as useIncrementalLoading } from "./useIncrementalLoading-
|
|
2
|
-
import { c as createSubscriptionsService } from "./subscriptions-
|
|
1
|
+
import { u as useIncrementalLoading } from "./useIncrementalLoading-DmOT2MXH.mjs";
|
|
2
|
+
import { c as createSubscriptionsService } from "./subscriptions-DHjXDyH1.mjs";
|
|
3
3
|
import { defineComponent, computed, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode, createTextVNode, toDisplayString, createCommentVNode, createElementBlock, createSlots, Fragment, renderList } from "vue";
|
|
4
|
-
import { u as useIntl,
|
|
5
|
-
import { _ as _sfc_main$
|
|
6
|
-
import { u as useActionDispatchProvider } from "./useActionDispatchProvider-
|
|
4
|
+
import { u as useIntl, _ as _sfc_main$3, e as _sfc_main$4, m as _sfc_main$5, c as _sfc_main$6, z as _sfc_main$7 } from "./vendor-ui-B8IlviSs.mjs";
|
|
5
|
+
import { _ as _sfc_main$8 } from "./Skeleton.vue_vue_type_script_setup_true_lang-DGMxHc20.mjs";
|
|
6
|
+
import { u as useActionDispatchProvider } from "./useActionDispatchProvider-DmhD9mYX.mjs";
|
|
7
7
|
function useSubscriptionsList({
|
|
8
8
|
customerId,
|
|
9
9
|
batchSize: pageSize = 15
|
|
@@ -31,9 +31,10 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
31
31
|
customer: { type: Object },
|
|
32
32
|
showViewSubscriptionDetailsButton: { type: Boolean, default: true },
|
|
33
33
|
showCancelSubscriptionButton: { type: Boolean, default: true },
|
|
34
|
-
showRenewSubscriptionButton: { type: Boolean, default: true }
|
|
34
|
+
showRenewSubscriptionButton: { type: Boolean, default: true },
|
|
35
|
+
showUpgradeSubscriptionButton: { type: Boolean, default: true }
|
|
35
36
|
},
|
|
36
|
-
emits: ["view-subscription-details", "cancel-subscription", "renew-subscription"],
|
|
37
|
+
emits: ["view-subscription-details", "cancel-subscription", "renew-subscription", "upgrade-subscription"],
|
|
37
38
|
setup(__props) {
|
|
38
39
|
const props = __props;
|
|
39
40
|
const { $t } = useIntl();
|
|
@@ -163,29 +164,45 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
163
164
|
]),
|
|
164
165
|
_: 1
|
|
165
166
|
})) : createCommentVNode("", true),
|
|
166
|
-
|
|
167
|
+
__props.showUpgradeSubscriptionButton ? (openBlock(), createBlock(unref(_sfc_main$6), {
|
|
167
168
|
key: 1,
|
|
168
169
|
variant: "outline",
|
|
169
170
|
color: "gray",
|
|
170
|
-
class: "sv-action sv-action--secondary sv-subscriptions-list__item-
|
|
171
|
+
class: "sv-action sv-action--secondary sv-subscriptions-list__item-upgrade w-full md:w-auto",
|
|
171
172
|
type: "button",
|
|
172
|
-
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("
|
|
173
|
+
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("upgrade-subscription", { subscriptionId: __props.subscription.id }))
|
|
173
174
|
}, {
|
|
174
175
|
default: withCtx(() => [
|
|
175
176
|
createTextVNode(toDisplayString(unref($t)({
|
|
176
|
-
defaultMessage: "
|
|
177
|
-
description: "The label for the
|
|
178
|
-
id: "customer.subscriptions_block.
|
|
177
|
+
defaultMessage: "Upgrade subscription",
|
|
178
|
+
description: "The label for the upgrade subscription button in the subscriptions block",
|
|
179
|
+
id: "customer.subscriptions_block.upgrade_button_label"
|
|
179
180
|
})), 1)
|
|
180
181
|
]),
|
|
181
182
|
_: 1
|
|
182
|
-
})) :
|
|
183
|
+
})) : createCommentVNode("", true),
|
|
184
|
+
isCancelButtonVisible.value ? (openBlock(), createBlock(unref(_sfc_main$7), {
|
|
183
185
|
key: 2,
|
|
186
|
+
icon: "delete",
|
|
187
|
+
variant: "outline",
|
|
188
|
+
color: "gray",
|
|
189
|
+
size: "md",
|
|
190
|
+
class: "sv-action sv-subscriptions-list__item-cancel",
|
|
191
|
+
type: "button",
|
|
192
|
+
"aria-label": unref($t)({
|
|
193
|
+
defaultMessage: "Cancel subscription",
|
|
194
|
+
description: "Aria label for the cancel subscription icon button",
|
|
195
|
+
id: "customer.subscriptions_block.cancel_button_label"
|
|
196
|
+
}),
|
|
197
|
+
onClick: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("cancel-subscription", { subscriptionId: __props.subscription.id }))
|
|
198
|
+
}, null, 8, ["aria-label"])) : createCommentVNode("", true),
|
|
199
|
+
isRenewButtonVisible.value ? (openBlock(), createBlock(unref(_sfc_main$6), {
|
|
200
|
+
key: 3,
|
|
184
201
|
variant: "outline",
|
|
185
202
|
color: "gray",
|
|
186
203
|
class: "sv-action sv-action--secondary sv-subscriptions-list__item-renew w-full md:w-auto",
|
|
187
204
|
type: "button",
|
|
188
|
-
onClick: _cache[
|
|
205
|
+
onClick: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("renew-subscription", { subscriptionId: __props.subscription.id }))
|
|
189
206
|
}, {
|
|
190
207
|
default: withCtx(() => [
|
|
191
208
|
createTextVNode(toDisplayString(unref($t)({
|
|
@@ -218,9 +235,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
218
235
|
showViewAllButton: { type: Boolean, default: true },
|
|
219
236
|
showViewDetailsButton: { type: Boolean, default: true },
|
|
220
237
|
showCancelButton: { type: Boolean, default: true },
|
|
221
|
-
showRenewButton: { type: Boolean, default: true }
|
|
238
|
+
showRenewButton: { type: Boolean, default: true },
|
|
239
|
+
showUpgradeButton: { type: Boolean, default: true }
|
|
222
240
|
},
|
|
223
|
-
emits: ["view-subscription-details", "view-all-subscriptions", "cancel-subscription", "renew-subscription", "load-more"],
|
|
241
|
+
emits: ["view-subscription-details", "view-all-subscriptions", "cancel-subscription", "renew-subscription", "upgrade-subscription", "load-more"],
|
|
224
242
|
setup(__props) {
|
|
225
243
|
const props = __props;
|
|
226
244
|
const { $t } = useIntl();
|
|
@@ -288,10 +306,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
288
306
|
"show-view-subscription-details-button": __props.showViewDetailsButton,
|
|
289
307
|
"show-cancel-subscription-button": __props.showCancelButton,
|
|
290
308
|
"show-renew-subscription-button": __props.showRenewButton,
|
|
309
|
+
"show-upgrade-subscription-button": __props.showUpgradeButton,
|
|
291
310
|
onViewSubscriptionDetails: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("view-subscription-details", $event)),
|
|
292
311
|
onCancelSubscription: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("cancel-subscription", $event)),
|
|
293
|
-
onRenewSubscription: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("renew-subscription", $event))
|
|
294
|
-
|
|
312
|
+
onRenewSubscription: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("renew-subscription", $event)),
|
|
313
|
+
onUpgradeSubscription: _cache[4] || (_cache[4] = ($event) => _ctx.$emit("upgrade-subscription", $event))
|
|
314
|
+
}, null, 8, ["subscription", "payment-method", "customer", "show-view-subscription-details-button", "show-cancel-subscription-button", "show-renew-subscription-button", "show-upgrade-subscription-button"]);
|
|
295
315
|
}), 128))
|
|
296
316
|
]))
|
|
297
317
|
]),
|
|
@@ -338,8 +358,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
338
358
|
setup(__props) {
|
|
339
359
|
const { dispatchAction } = useActionDispatchProvider();
|
|
340
360
|
return (_ctx, _cache) => {
|
|
341
|
-
var _a, _b, _c, _d;
|
|
342
|
-
return __props.isLoading ? (openBlock(), createBlock(_sfc_main$
|
|
361
|
+
var _a, _b, _c, _d, _e;
|
|
362
|
+
return __props.isLoading ? (openBlock(), createBlock(_sfc_main$8, {
|
|
343
363
|
key: 0,
|
|
344
364
|
variant: "section",
|
|
345
365
|
class: "sv-subscriptions-list sv-root sv-component sv-loading min-h-[100px]",
|
|
@@ -355,6 +375,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
355
375
|
"show-view-details-button": (_b = __props.configuration) == null ? void 0 : _b.showViewDetailsButton,
|
|
356
376
|
"show-cancel-button": (_c = __props.configuration) == null ? void 0 : _c.showCancelButton,
|
|
357
377
|
"show-renew-button": (_d = __props.configuration) == null ? void 0 : _d.showRenewButton,
|
|
378
|
+
"show-upgrade-button": (_e = __props.configuration) == null ? void 0 : _e.showUpgradeButton,
|
|
358
379
|
onViewSubscriptionDetails: _cache[0] || (_cache[0] = ($event) => unref(dispatchAction)({
|
|
359
380
|
action: "view-subscription-details",
|
|
360
381
|
data: { subscriptionId: $event.subscriptionId }
|
|
@@ -368,8 +389,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
368
389
|
action: "renew-subscription",
|
|
369
390
|
data: { subscriptionId: $event.subscriptionId }
|
|
370
391
|
})),
|
|
371
|
-
|
|
372
|
-
|
|
392
|
+
onUpgradeSubscription: _cache[4] || (_cache[4] = ($event) => unref(dispatchAction)({
|
|
393
|
+
action: "upgrade-subscription",
|
|
394
|
+
data: { subscriptionId: $event.subscriptionId }
|
|
395
|
+
})),
|
|
396
|
+
onLoadMore: _cache[5] || (_cache[5] = ($event) => _ctx.$emit("load-more"))
|
|
397
|
+
}, null, 8, ["customer", "subscriptions", "payment-methods", "is-loading", "show-view-all-button", "show-view-details-button", "show-cancel-button", "show-renew-button", "show-upgrade-button"])) : createCommentVNode("", true);
|
|
373
398
|
};
|
|
374
399
|
}
|
|
375
400
|
});
|