@solvimon/solvimon-web 0.1.0-alpha.7 → 0.1.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +124 -0
- package/dist/ApiStatus-CyNDp_op.mjs +9 -0
- package/dist/ApiStatus-oqvUEWJx.js +1 -0
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-CupcH8TZ.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-CX8vlY2Z.mjs} +6 -6
- package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-DGisvmez.js +1 -0
- package/dist/ContentWithAsideLayout-B5B8Kwaw.js +1 -0
- package/dist/{ContentWithAsideLayout-Ct24RV-2.mjs → ContentWithAsideLayout-DhfUkZZg.mjs} +10 -16
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DZJ0xukI.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Bus-5gC3.mjs} +21 -13
- package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CkRsyMlJ.js +1 -0
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DsrBsrtk.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Bc2hkpTb.mjs} +19 -9
- package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D0vVUHuY.js +1 -0
- package/dist/PaymentHistoryBlock-BiiFJkpT.js +1 -0
- package/dist/PaymentHistoryBlock-D_B099M7.mjs +4 -0
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BnKwmJ2s.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CaMDtHrL.mjs} +16 -13
- package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DWTEfLrE.js +1 -0
- package/dist/PaymentIntegrationForm-D1oJA9mC.js +1 -0
- package/dist/PaymentIntegrationForm-DNkjhqMF.mjs +4 -0
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BE1lWOk9.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-D37gDtY7.mjs} +95 -199
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-D5bxFJ-p.js +1 -0
- package/dist/{PricingGroupContent.vue_vue_type_script_setup_true_lang-BbvDXvIS.mjs → PricingGroupContent.vue_vue_type_script_setup_true_lang-BChVMzCj.mjs} +5 -31
- package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-Br3bEUlP.js +1 -0
- package/dist/{Skeleton.vue_vue_type_script_setup_true_lang-DXJcL7x6.mjs → Skeleton.vue_vue_type_script_setup_true_lang-DGMxHc20.mjs} +9 -6
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js +1 -0
- package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-AHw3iTfi.js +1 -0
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DVhJy0t8.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BkzLj8n2.mjs} +28 -22
- package/dist/adyen-B_QrYdaC.mjs +4 -0
- package/dist/adyen-Bwewy3HC.mjs +172 -0
- package/dist/adyen-R6aSZ0Yf.js +1 -0
- package/dist/adyen-mQEEOjgl.js +1 -0
- package/dist/adyen.css +1 -0
- package/dist/component-BOqPDAVk.js +1 -0
- package/dist/component-Djrf1L-Z.mjs +889 -0
- package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
- package/dist/components/BillingInformation/BillingInformation.es.js +8 -9
- package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.es.js +14 -18
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +10 -10
- package/dist/components/Invoice/Invoice.cjs.js +1 -1
- package/dist/components/Invoice/Invoice.es.js +70 -2673
- package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.es.js +10 -10
- package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
- package/dist/components/InvoicesList/InvoicesList.es.js +7 -8
- package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.es.js +10 -10
- package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +16 -38
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +17 -4826
- package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.es.js +11 -11
- package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
- package/dist/components/WalletBalances/WalletBalances.es.js +9 -9
- package/dist/core/index.cjs.js +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.es.js +1 -1
- package/dist/core/types.d.ts +6 -2
- package/dist/{customer-CJrpbGX4.mjs → customer-B31QzznT.mjs} +1 -1
- package/dist/{customer-CcQR-JIm.js → customer-hDxW1Dbp.js} +1 -1
- package/dist/en-US-CgPY97Vq.js +1 -0
- package/dist/en-US-N3CUCsVy.mjs +179 -0
- package/dist/index-CzL1ZcGi.mjs +85 -0
- package/dist/index-DIFK3mcJ.js +6 -0
- package/dist/index-DRdBmZ2-.js +1 -0
- package/dist/index-DyvRdSR7.mjs +9673 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +4 -1
- package/dist/{invoices-CNK1Ushv.mjs → invoices-DIYPN2j_.mjs} +2 -15
- package/dist/invoices-DzkA1jDc.js +1 -0
- package/dist/nl-NL-B8U9b85I.mjs +197 -0
- package/dist/nl-NL-qMRaTRrM.js +1 -0
- package/dist/{paymentMethods-C-ApE-G4.mjs → paymentMethods-67b3UlTZ.mjs} +2 -2
- package/dist/paymentMethods-C_sdTkSF.js +1 -0
- package/dist/{payments-CLt0SExf.js → payments-DkHhTHto.js} +1 -1
- package/dist/{payments-CE9U7aKK.mjs → payments-Dq6R37Fz.mjs} +1 -1
- package/dist/registry-BkViv4tv.js +1 -0
- package/dist/{registry-B99ZnfEn.mjs → registry-Df_26rJy.mjs} +6 -4
- package/dist/screens/Checkout/Checkout.cjs.js +1 -1
- package/dist/screens/Checkout/Checkout.es.js +632 -2538
- package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.es.js +23 -17
- package/dist/screens/PayInvoice/PayInvoice.ce.d.ts +3 -0
- package/dist/screens/PayInvoice/PayInvoice.cjs.js +1 -0
- package/dist/screens/PayInvoice/PayInvoice.es.js +458 -0
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -1
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +147 -99
- package/dist/solvimon-web.css +1 -1
- package/dist/{subscriptions-CoeCrY1I.mjs → subscriptions-ClGIr_aS.mjs} +2 -2
- package/dist/subscriptions-jelITJcX.js +1 -0
- package/dist/{useActionDispatchProvider-eO2qFPGv.mjs → useActionDispatchProvider-BC57-Ufn.mjs} +1 -1
- package/dist/{useActionDispatchProvider-CWVV_xsi.js → useActionDispatchProvider-rw9kWeE0.js} +1 -1
- package/dist/{useCustomer--jycAz--.mjs → useCustomer-Ba9WRtuT.mjs} +2 -2
- package/dist/{useCustomer-PthyTFLl.js → useCustomer-CUcaeQn_.js} +1 -1
- package/dist/{useIncrementalLoading-CcnL3flF.mjs → useIncrementalLoading-Cnzh2mAz.mjs} +3 -8
- package/dist/useIncrementalLoading-DoTTXM2Y.js +1 -0
- package/dist/{useInvoiceData-BiMMoVoW.mjs → useInvoiceData-BJwwDur7.mjs} +6 -12
- package/dist/useInvoiceData-D2jkdmlA.js +1 -0
- package/dist/{useInvoicesList-DFhF_gp7.mjs → useInvoicesList-CFzAxyae.mjs} +34 -267
- package/dist/useInvoicesList-CaBCGs4h.js +1 -0
- package/dist/{useLoadInitialData-Dm48tlSO.mjs → useLoadInitialData-5sgImpzc.mjs} +5 -0
- package/dist/useLoadInitialData-DjwRHcAH.js +1 -0
- package/dist/usePaymentMethodOptions-C2k4npCQ.mjs +26 -0
- package/dist/usePaymentMethodOptions-DYO6xr3-.js +1 -0
- package/dist/{usePaymentMethods-BX2RnHZN.mjs → usePaymentMethods-CRWbH48K.mjs} +2 -2
- package/dist/{usePaymentMethods-BRQ7-dUr.js → usePaymentMethods-ryN_YohI.js} +1 -1
- package/dist/usePayments-Cw5PPEJa.mjs +36 -0
- package/dist/usePayments-DWXPGFvp.js +1 -0
- package/dist/usePortal-CxX4nrE4.js +1 -0
- package/dist/usePortal-cmE08vYs.mjs +12 -0
- package/dist/useService-Bb9r_sOQ.js +1 -0
- package/dist/useService-BsSEI8DZ.mjs +53 -0
- package/dist/useViewport-Bu0cyeSi.mjs +38 -0
- package/dist/useViewport-CKRY1CKR.js +1 -0
- package/dist/useWalletBalanceItems-CkDqmk36.mjs +109 -0
- package/dist/useWalletBalanceItems-CpZ1NWPr.js +1 -0
- package/dist/useWatchDebounced-2ZLnfgvG.js +1 -0
- package/dist/useWatchDebounced-D1xuIX6_.mjs +12 -0
- package/dist/vendor-ui-5pJF5KBP.js +1 -0
- package/dist/vendor-ui-C0K3osvz.mjs +27645 -0
- package/package.json +20 -12
- package/dist/Alert.vue.es-DMPvSykx.js +0 -1
- package/dist/Alert.vue.es-DsJ1ckRU.mjs +0 -172
- package/dist/Amount.vue.es-C6JE5rL8.mjs +0 -23
- package/dist/Amount.vue.es-h8wulbBG.js +0 -1
- package/dist/Avatar.vue.es-Ba8ZGfm4.mjs +0 -93
- package/dist/Avatar.vue.es-BbyE0AjW.js +0 -1
- package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-C4Ndo83E.js +0 -1
- package/dist/Button.vue.es-6sBk5tBL.mjs +0 -408
- package/dist/Button.vue.es-BC4_TItq.js +0 -1
- package/dist/CardContent.vue.es-ChEMrFCc.mjs +0 -115
- package/dist/CardContent.vue.es-i9ivuGKG.js +0 -1
- package/dist/Chip.vue.es-D0fkSe8a.js +0 -1
- package/dist/Chip.vue.es-DcW2CjUA.mjs +0 -1576
- package/dist/Comparators.vue.es-BdxDqU8o.js +0 -1
- package/dist/Comparators.vue.es-DdTKGB80.mjs +0 -406
- package/dist/ContentWithAsideLayout-UHovpjZu.js +0 -1
- package/dist/CustomerBillingInformation.vue.es-9rP7-RzN.js +0 -1
- package/dist/CustomerBillingInformation.vue.es-DBMl01Es.mjs +0 -175
- package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CYTCcMgP.js +0 -1
- package/dist/Divider.vue.es-ClFG8QtG.js +0 -1
- package/dist/Divider.vue.es-wKkIVBgb.mjs +0 -24
- package/dist/DividerText.vue.es-B7oa5Xpn.mjs +0 -72
- package/dist/DividerText.vue.es-yiFdPQvo.js +0 -1
- package/dist/ErrorNotification.vue.es-Bgw0MIl8.mjs +0 -30
- package/dist/ErrorNotification.vue.es-FpRyg0De.js +0 -1
- package/dist/FormMessage.vue.es-DFQXxiSC.mjs +0 -46
- package/dist/FormMessage.vue.es-LeWoj774.js +0 -1
- package/dist/IconButton.vue.es-DNCwwH_j.mjs +0 -825
- package/dist/IconButton.vue.es-DiSiGPWO.js +0 -1
- package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BDitcx8B.js +0 -1
- package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-6yi47YWd.js +0 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CC3hm3nx.js +0 -1
- package/dist/PaymentMethod.vue.es-DYlnmZh7.js +0 -1
- package/dist/PaymentMethod.vue.es-nXZoQjG3.mjs +0 -1255
- package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-CmQILA3q.js +0 -1
- package/dist/Section.vue.es-3-H1pUTB.mjs +0 -79
- package/dist/Section.vue.es-BuzTXRLP.js +0 -1
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-D1Xzfc70.js +0 -1
- package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-Pq3d7DTb.js +0 -1
- package/dist/TooltipParagraph.vue.es-DVJLF9Kv.mjs +0 -136
- package/dist/TooltipParagraph.vue.es-kTbRGoPF.js +0 -1
- package/dist/TrialChip.vue.es-BHYbW8b6.mjs +0 -759
- package/dist/TrialChip.vue.es-C6Xg_5rR.js +0 -1
- package/dist/_Uint8Array-DHE03FZr.mjs +0 -507
- package/dist/_Uint8Array-DxISR7XF.js +0 -1
- package/dist/_flatRest.es-BHFPCqZh.mjs +0 -642
- package/dist/_flatRest.es-dFffnTpX.js +0 -1
- package/dist/adyen-51SvcyqV.mjs +0 -4
- package/dist/adyen-DZsyEXkw.js +0 -1
- package/dist/api.es-B4qAAJKr.js +0 -1
- package/dist/api.es-UkfpLiLL.mjs +0 -83
- package/dist/auto-DzZuCneB.mjs +0 -14387
- package/dist/auto-PpnAChnH.js +0 -6
- package/dist/cloneDeep-Hs8Pp07F.js +0 -1
- package/dist/cloneDeep-sm9cY-u2.mjs +0 -212
- package/dist/cn.es-C7xoIs3C.js +0 -1
- package/dist/cn.es-tfxVlz02.mjs +0 -3191
- package/dist/component-ZRZIt3ZW.js +0 -1
- package/dist/component-dpA83LIN.mjs +0 -6569
- package/dist/countryData.es--zJAd6LA.mjs +0 -252
- package/dist/countryData.es-D3MFzU92.js +0 -1
- package/dist/customer.es-D42Md24r.js +0 -1
- package/dist/customer.es-LIW2YmLL.mjs +0 -30
- package/dist/formatting.es-9hM8aHSg.js +0 -1
- package/dist/formatting.es-D5H_ySFv.mjs +0 -68
- package/dist/getCountryNameByCode.es-fP52nO_7.js +0 -1
- package/dist/getCountryNameByCode.es-ymC9R46j.mjs +0 -8
- package/dist/index-2jo9BSPM.js +0 -1
- package/dist/index-BFZ0dPh9.mjs +0 -179
- package/dist/index-CI71bVGE.mjs +0 -2521
- package/dist/index-CWSXne1Q.js +0 -1
- package/dist/index-D3v7hAtc.mjs +0 -253
- package/dist/index-WLSPwi90.js +0 -1
- package/dist/index.es-BBJF2O2l.js +0 -1
- package/dist/index.es-LCAKs4tH.mjs +0 -438
- package/dist/invoices-3kVHsAXr.js +0 -1
- package/dist/isEmpty.es-Bp1SbWFu.mjs +0 -131
- package/dist/isEmpty.es-Dycf-CD_.js +0 -1
- package/dist/paymentMethods-DZRf0WRl.js +0 -1
- package/dist/pick.es-BgDAfhAl.js +0 -1
- package/dist/pick.es-DdVOyp0Q.mjs +0 -45
- package/dist/registry-ClZ43bQn.js +0 -1
- package/dist/sprite.svg.es-CCc3Mz1x.js +0 -1
- package/dist/sprite.svg.es-DZD704h3.mjs +0 -4
- package/dist/subscriptions-CS8HTxzC.js +0 -1
- package/dist/typeGuards.es-C4nR5FkL.js +0 -1
- package/dist/typeGuards.es-fwUoeMCe.mjs +0 -12
- package/dist/useIncrementalLoading-CAdNW-Bf.js +0 -1
- package/dist/useInvoiceData-DvQO_nKz.js +0 -1
- package/dist/useInvoicesList-CHkwSNO9.js +0 -1
- package/dist/useLoadInitialData-BRg7IWqW.js +0 -1
- package/dist/useService-B67YWAcN.js +0 -1
- package/dist/useService-DG_zedHV.mjs +0 -282
- package/dist/useWalletBalanceItems-B5FMmoU2.mjs +0 -308
- package/dist/useWalletBalanceItems-BY3gq0fc.js +0 -1
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { defineComponent, openBlock, createBlock,
|
|
2
|
-
import { _ as _sfc_main$
|
|
3
|
-
import { _ as _sfc_main$
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { c as createPaymentsService } from "./payments-CE9U7aKK.mjs";
|
|
8
|
-
import { c as createPaymentMethodsService } from "./paymentMethods-C-ApE-G4.mjs";
|
|
9
|
-
import { i as isEqual } from "./useService-DG_zedHV.mjs";
|
|
1
|
+
import { defineComponent, computed, openBlock, createBlock, withCtx, unref, createVNode, createTextVNode, toDisplayString, createCommentVNode, createElementVNode, inject, ref, onMounted, onBeforeUnmount, watch, createElementBlock, Fragment, renderList } from "vue";
|
|
2
|
+
import { u as useIntl, _ as _sfc_main$5, l as _sfc_main$6, x as formatAmount, e as _sfc_main$7, k as isEqual, R as _sfc_main$8 } from "./vendor-ui-C0K3osvz.mjs";
|
|
3
|
+
import { _ as _sfc_main$4, g as getQueryParam, t as transformToAdyenAmount, m as mapAdyenPaymentMethods, a as getAdyenEnvironmentFromPaymentMethodOptionsResponse, b as getAdyenClientKeyFromPaymentMethodOptionsResponse, R as REDIRECT_RESULT_QUERY_STRING, P as PAYMENT_ACCEPTOR_ID_QUERY_STRING, c as transformObjectToAdyenObject, d as createReturnUrl } from "./adyen-Bwewy3HC.mjs";
|
|
4
|
+
import { c as createPaymentsService } from "./payments-Dq6R37Fz.mjs";
|
|
5
|
+
import { c as createPaymentMethodsService } from "./paymentMethods-67b3UlTZ.mjs";
|
|
6
|
+
import { E as EXPERIMENTAL_FEATURE_INJECTION_KEY, a as useLogger } from "./component-Djrf1L-Z.mjs";
|
|
10
7
|
const getOverriddenTranslations = (variant) => {
|
|
11
8
|
let result = {};
|
|
12
9
|
if (variant === "TOKENIZE") {
|
|
@@ -139,53 +136,6 @@ const getOverriddenTranslations = (variant) => {
|
|
|
139
136
|
}
|
|
140
137
|
return result;
|
|
141
138
|
};
|
|
142
|
-
const _hoisted_1$1 = { class: "flex flex-col items-center py-10" };
|
|
143
|
-
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
144
|
-
__name: "PaymentFeedbackCard",
|
|
145
|
-
props: {
|
|
146
|
-
status: { default: "success", type: String },
|
|
147
|
-
title: { type: String }
|
|
148
|
-
},
|
|
149
|
-
setup(__props) {
|
|
150
|
-
return (_ctx, _cache) => {
|
|
151
|
-
return openBlock(), createBlock(unref(_sfc_main$5), null, {
|
|
152
|
-
default: withCtx(() => [
|
|
153
|
-
createElementVNode("div", _hoisted_1$1, [
|
|
154
|
-
createVNode(unref(_sfc_main$6), {
|
|
155
|
-
icon: __props.status === "success" ? "check_circle" : "error",
|
|
156
|
-
class: normalizeClass({
|
|
157
|
-
"text-green-400": __props.status === "success",
|
|
158
|
-
"text-red-600": __props.status === "error"
|
|
159
|
-
}),
|
|
160
|
-
size: "lg"
|
|
161
|
-
}, null, 8, ["icon", "class"]),
|
|
162
|
-
createVNode(unref(_sfc_main$7), {
|
|
163
|
-
variant: "heading-3",
|
|
164
|
-
tag: "span",
|
|
165
|
-
class: "mt-2"
|
|
166
|
-
}, {
|
|
167
|
-
default: withCtx(() => [
|
|
168
|
-
createTextVNode(toDisplayString(__props.title), 1)
|
|
169
|
-
]),
|
|
170
|
-
_: 1
|
|
171
|
-
}),
|
|
172
|
-
_ctx.$slots.default ? (openBlock(), createBlock(unref(_sfc_main$7), {
|
|
173
|
-
key: 0,
|
|
174
|
-
tag: "div",
|
|
175
|
-
variant: "body-sm"
|
|
176
|
-
}, {
|
|
177
|
-
default: withCtx(() => [
|
|
178
|
-
renderSlot(_ctx.$slots, "default")
|
|
179
|
-
]),
|
|
180
|
-
_: 3
|
|
181
|
-
})) : createCommentVNode("", true)
|
|
182
|
-
])
|
|
183
|
-
]),
|
|
184
|
-
_: 3
|
|
185
|
-
});
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
139
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
190
140
|
__name: "PaymentCompletedCard",
|
|
191
141
|
props: {
|
|
@@ -212,7 +162,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
212
162
|
title: title.value
|
|
213
163
|
}, {
|
|
214
164
|
default: withCtx(() => [
|
|
215
|
-
__props.amount ? (openBlock(), createBlock(unref(_sfc_main$
|
|
165
|
+
__props.amount ? (openBlock(), createBlock(unref(_sfc_main$5), {
|
|
216
166
|
key: 0,
|
|
217
167
|
variant: "body-sm",
|
|
218
168
|
class: "mt-1"
|
|
@@ -223,7 +173,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
223
173
|
]),
|
|
224
174
|
_: 1
|
|
225
175
|
})) : createCommentVNode("", true),
|
|
226
|
-
createVNode(unref(_sfc_main$
|
|
176
|
+
createVNode(unref(_sfc_main$5), {
|
|
227
177
|
variant: "body-xs",
|
|
228
178
|
shade: "lighter"
|
|
229
179
|
}, {
|
|
@@ -299,7 +249,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
299
249
|
}, {
|
|
300
250
|
default: withCtx(() => [
|
|
301
251
|
createElementVNode("div", _hoisted_1, [
|
|
302
|
-
createVNode(unref(_sfc_main$
|
|
252
|
+
createVNode(unref(_sfc_main$5), {
|
|
303
253
|
variant: "body-xs",
|
|
304
254
|
shade: "lighter",
|
|
305
255
|
class: "mt-3"
|
|
@@ -309,7 +259,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
309
259
|
]),
|
|
310
260
|
_: 1
|
|
311
261
|
}),
|
|
312
|
-
errorConfig.value.isReloadButtonVisible ? (openBlock(), createBlock(unref(_sfc_main$
|
|
262
|
+
errorConfig.value.isReloadButtonVisible ? (openBlock(), createBlock(unref(_sfc_main$7), {
|
|
313
263
|
key: 0,
|
|
314
264
|
type: "button",
|
|
315
265
|
color: "gray",
|
|
@@ -332,103 +282,6 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
332
282
|
};
|
|
333
283
|
}
|
|
334
284
|
});
|
|
335
|
-
function getQueryParam(name, locationSearch = window.location.search) {
|
|
336
|
-
const currentUrl = new URLSearchParams(locationSearch);
|
|
337
|
-
return currentUrl.get(name);
|
|
338
|
-
}
|
|
339
|
-
const PAYMENT_ACCEPTOR_ID_QUERY_STRING = "payment_acceptor_id";
|
|
340
|
-
const REDIRECT_RESULT_QUERY_STRING = "redirectResult";
|
|
341
|
-
function getAdyenClientKeyFromPaymentMethodOptionsResponse(paymentMethodOptionResponse) {
|
|
342
|
-
var _a, _b;
|
|
343
|
-
return (_b = (_a = paymentMethodOptionResponse.integration.payment_gateway) == null ? void 0 : _a.adyen) == null ? void 0 : _b.public_key;
|
|
344
|
-
}
|
|
345
|
-
function transformToAdyenAmount(amount) {
|
|
346
|
-
const formatter = new Intl.NumberFormat(void 0, {
|
|
347
|
-
style: "currency",
|
|
348
|
-
currency: amount.currency
|
|
349
|
-
});
|
|
350
|
-
const { maximumFractionDigits = 10 } = formatter.resolvedOptions();
|
|
351
|
-
return {
|
|
352
|
-
value: Math.round(+amount.quantity * Math.pow(10, maximumFractionDigits)),
|
|
353
|
-
currency: amount.currency
|
|
354
|
-
};
|
|
355
|
-
}
|
|
356
|
-
function mapAdyenPaymentMethods(paymentMethodOptionResponse) {
|
|
357
|
-
var _a;
|
|
358
|
-
return ((_a = paymentMethodOptionResponse.options) == null ? void 0 : _a.flatMap(
|
|
359
|
-
(adyenPaymentMethodOption) => mapAdyenPaymentMethod(adyenPaymentMethodOption.adyen)
|
|
360
|
-
)) ?? [];
|
|
361
|
-
}
|
|
362
|
-
function mapAdyenPaymentMethod(adyen) {
|
|
363
|
-
return {
|
|
364
|
-
type: adyen.type,
|
|
365
|
-
name: adyen.name,
|
|
366
|
-
...adyen.issuers ? { issuers: adyen.issuers } : {},
|
|
367
|
-
...adyen.brands ? { brands: adyen.brands } : {},
|
|
368
|
-
...adyen.funding_source ? { fundingSource: adyen.funding_source } : {},
|
|
369
|
-
...adyen.configuration ? { configuration: adyen.configuration } : {}
|
|
370
|
-
};
|
|
371
|
-
}
|
|
372
|
-
function createReturnUrl({
|
|
373
|
-
paymentAcceptorId,
|
|
374
|
-
redirectUrl = window.location.href
|
|
375
|
-
}) {
|
|
376
|
-
const returnUrl = new URL(redirectUrl);
|
|
377
|
-
returnUrl.searchParams.set(PAYMENT_ACCEPTOR_ID_QUERY_STRING, paymentAcceptorId);
|
|
378
|
-
return returnUrl.toString();
|
|
379
|
-
}
|
|
380
|
-
function getAdyenEnvironmentFromPaymentMethodOptionsResponse(paymentMethodsOptionsResponse) {
|
|
381
|
-
var _a, _b;
|
|
382
|
-
const environment = (_b = (_a = paymentMethodsOptionsResponse == null ? void 0 : paymentMethodsOptionsResponse.integration.payment_gateway) == null ? void 0 : _a.adyen) == null ? void 0 : _b.environment;
|
|
383
|
-
if (!environment) {
|
|
384
|
-
trackSentryException(void 0, {
|
|
385
|
-
Message: "No environment set for adyen advanced flow, defaulted to live"
|
|
386
|
-
});
|
|
387
|
-
return "live";
|
|
388
|
-
}
|
|
389
|
-
switch (environment) {
|
|
390
|
-
case "TEST":
|
|
391
|
-
return "test";
|
|
392
|
-
case "LIVE_IN":
|
|
393
|
-
return "live-in";
|
|
394
|
-
case "LIVE_AU":
|
|
395
|
-
return "live-au";
|
|
396
|
-
case "LIVE_US":
|
|
397
|
-
return "live-us";
|
|
398
|
-
case "LIVE_APSE":
|
|
399
|
-
return "live-apse";
|
|
400
|
-
case "LIVE":
|
|
401
|
-
return "live";
|
|
402
|
-
default:
|
|
403
|
-
trackSentryException(void 0, {
|
|
404
|
-
Message: `Unsupported environment "${environment}" for adyen advanced flow, defaulted to "live"`
|
|
405
|
-
});
|
|
406
|
-
return "live";
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
function getAdyenExpressCheckoutConfiguration({
|
|
410
|
-
amount,
|
|
411
|
-
countryCode,
|
|
412
|
-
locale,
|
|
413
|
-
paymentMethodOptionResponse
|
|
414
|
-
}) {
|
|
415
|
-
return {
|
|
416
|
-
...amount ? { amount: transformToAdyenAmount(amount) } : {},
|
|
417
|
-
analytics: { enabled: false },
|
|
418
|
-
clientKey: getAdyenClientKeyFromPaymentMethodOptionsResponse(paymentMethodOptionResponse),
|
|
419
|
-
countryCode,
|
|
420
|
-
environment: getAdyenEnvironmentFromPaymentMethodOptionsResponse(
|
|
421
|
-
paymentMethodOptionResponse
|
|
422
|
-
),
|
|
423
|
-
locale,
|
|
424
|
-
paymentMethodsResponse: {
|
|
425
|
-
paymentMethods: mapAdyenPaymentMethods(paymentMethodOptionResponse)
|
|
426
|
-
}
|
|
427
|
-
};
|
|
428
|
-
}
|
|
429
|
-
function transformObjectToAdyenObject(obj) {
|
|
430
|
-
return obj ? Object.fromEntries(Object.entries(obj).map(([key, value]) => [key, String(value)])) : void 0;
|
|
431
|
-
}
|
|
432
285
|
const useExperimentalFeature = () => {
|
|
433
286
|
const experimentalFeature = inject(EXPERIMENTAL_FEATURE_INJECTION_KEY);
|
|
434
287
|
return experimentalFeature;
|
|
@@ -442,13 +295,6 @@ function filterOutExpressPaymentMethods(paymentMethods) {
|
|
|
442
295
|
})
|
|
443
296
|
);
|
|
444
297
|
}
|
|
445
|
-
function useLogger() {
|
|
446
|
-
const logger = inject(LOGGER_PROVIDER_INJECTION_KEY, null);
|
|
447
|
-
if (logger) return logger;
|
|
448
|
-
const noop = () => {
|
|
449
|
-
};
|
|
450
|
-
return { debug: noop, info: noop, warn: noop, error: noop, capture: noop };
|
|
451
|
-
}
|
|
452
298
|
const PAYMENT_GATEWAY_VARIANT_ADYEN = "ADYEN";
|
|
453
299
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
454
300
|
__name: "PaymentIntegrationFormAdyen",
|
|
@@ -459,7 +305,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
459
305
|
paymentMethodOptionResponseEntry: { type: Object },
|
|
460
306
|
variant: { type: String },
|
|
461
307
|
selected: { type: Boolean },
|
|
462
|
-
onSelect: { type: Function },
|
|
463
308
|
amount: { type: Object },
|
|
464
309
|
validateOnSubmit: { type: Function, default: () => Promise.resolve(true) },
|
|
465
310
|
context: { type: Object },
|
|
@@ -485,7 +330,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
485
330
|
try {
|
|
486
331
|
dropInInstance == null ? void 0 : dropInInstance.submit();
|
|
487
332
|
} catch (error) {
|
|
488
|
-
|
|
333
|
+
logger.error("ADYEN_SUBMIT_FAILED", "Failed to submit Adyen drop-in", {}, error);
|
|
489
334
|
}
|
|
490
335
|
}
|
|
491
336
|
async function getConfiguration() {
|
|
@@ -501,7 +346,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
501
346
|
props.paymentMethodOptionResponseEntry
|
|
502
347
|
),
|
|
503
348
|
environment: getAdyenEnvironmentFromPaymentMethodOptionsResponse(
|
|
504
|
-
props.paymentMethodOptionResponseEntry
|
|
349
|
+
props.paymentMethodOptionResponseEntry,
|
|
350
|
+
logger
|
|
505
351
|
),
|
|
506
352
|
locale,
|
|
507
353
|
translations: getOverriddenTranslations(props.variant),
|
|
@@ -529,7 +375,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
529
375
|
}
|
|
530
376
|
},
|
|
531
377
|
openFirstPaymentMethod: props.selected,
|
|
532
|
-
onSelect: () =>
|
|
378
|
+
onSelect: ({ props: { type } }) => {
|
|
379
|
+
if (!type) return;
|
|
380
|
+
emit("select", { paymentMethodType: type, paymentGatewayVariant: "ADYEN" });
|
|
381
|
+
},
|
|
533
382
|
onReady: () => emit("ready")
|
|
534
383
|
}
|
|
535
384
|
};
|
|
@@ -538,15 +387,58 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
538
387
|
if (!dropInContainerRef.value) return;
|
|
539
388
|
try {
|
|
540
389
|
await unmountDropIn();
|
|
541
|
-
const [adyenModule, { default:
|
|
542
|
-
import("./
|
|
543
|
-
import("./adyen-
|
|
390
|
+
const [adyenModule, { default: adyenCssUrl }] = await Promise.all([
|
|
391
|
+
import("./index-DyvRdSR7.mjs"),
|
|
392
|
+
import("./adyen-B_QrYdaC.mjs")
|
|
544
393
|
]);
|
|
545
|
-
const {
|
|
394
|
+
const {
|
|
395
|
+
AdyenCheckout,
|
|
396
|
+
Dropin,
|
|
397
|
+
Card,
|
|
398
|
+
Bancontact,
|
|
399
|
+
Ach,
|
|
400
|
+
AmazonPay,
|
|
401
|
+
ApplePay,
|
|
402
|
+
BcmcMobile,
|
|
403
|
+
BacsDirectDebit,
|
|
404
|
+
CashAppPay,
|
|
405
|
+
EPS,
|
|
406
|
+
GooglePay,
|
|
407
|
+
Klarna,
|
|
408
|
+
PayByBank,
|
|
409
|
+
PayPal,
|
|
410
|
+
SepaDirectDebit,
|
|
411
|
+
Trustly,
|
|
412
|
+
Twint,
|
|
413
|
+
PayByBankUS,
|
|
414
|
+
Redirect
|
|
415
|
+
} = adyenModule;
|
|
546
416
|
const { checkoutConfig, dropInConfig } = await getConfiguration();
|
|
547
417
|
checkoutInstance = await AdyenCheckout(checkoutConfig);
|
|
548
|
-
dropInInstance = new Dropin(checkoutInstance,
|
|
549
|
-
|
|
418
|
+
dropInInstance = new Dropin(checkoutInstance, {
|
|
419
|
+
...dropInConfig,
|
|
420
|
+
paymentMethodComponents: [
|
|
421
|
+
Card,
|
|
422
|
+
Bancontact,
|
|
423
|
+
Ach,
|
|
424
|
+
AmazonPay,
|
|
425
|
+
ApplePay,
|
|
426
|
+
BcmcMobile,
|
|
427
|
+
BacsDirectDebit,
|
|
428
|
+
CashAppPay,
|
|
429
|
+
EPS,
|
|
430
|
+
GooglePay,
|
|
431
|
+
Klarna,
|
|
432
|
+
PayByBank,
|
|
433
|
+
PayPal,
|
|
434
|
+
SepaDirectDebit,
|
|
435
|
+
Trustly,
|
|
436
|
+
Twint,
|
|
437
|
+
PayByBankUS,
|
|
438
|
+
Redirect
|
|
439
|
+
]
|
|
440
|
+
}).mount(dropInContainerRef.value);
|
|
441
|
+
injectStylesToShadowRoot(adyenCssUrl);
|
|
550
442
|
} catch (error) {
|
|
551
443
|
logger.error(
|
|
552
444
|
"PAYMENT_INTEGRATION_INITIALIZATION_FAILED",
|
|
@@ -564,12 +456,16 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
564
456
|
dropInContainerRef.value.innerHTML = "";
|
|
565
457
|
}
|
|
566
458
|
}
|
|
567
|
-
function injectStylesToShadowRoot(
|
|
459
|
+
function injectStylesToShadowRoot(adyenCssUrl) {
|
|
568
460
|
var _a;
|
|
569
461
|
const root = (_a = dropInContainerRef.value) == null ? void 0 : _a.getRootNode();
|
|
570
462
|
if (root instanceof ShadowRoot) {
|
|
463
|
+
const link = document.createElement("link");
|
|
464
|
+
link.rel = "stylesheet";
|
|
465
|
+
link.href = adyenCssUrl;
|
|
466
|
+
root.appendChild(link);
|
|
571
467
|
const style = document.createElement("style");
|
|
572
|
-
style.textContent =
|
|
468
|
+
style.textContent = `
|
|
573
469
|
:host {
|
|
574
470
|
--adyen-sdk-color-background-secondary: transparent;
|
|
575
471
|
--adyen-sdk-color-background-primary: rgb(243 244 246 / 0.5);
|
|
@@ -804,7 +700,13 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
804
700
|
actions.resolve({ resultCode: "Error" });
|
|
805
701
|
});
|
|
806
702
|
}
|
|
807
|
-
}).catch(() => {
|
|
703
|
+
}).catch((error) => {
|
|
704
|
+
logger.error(
|
|
705
|
+
"INTEGRATION_ERROR",
|
|
706
|
+
"Unhandled error in payment submission flow",
|
|
707
|
+
{},
|
|
708
|
+
error
|
|
709
|
+
);
|
|
808
710
|
});
|
|
809
711
|
}
|
|
810
712
|
function handleActionRequiredPaymentAction(response, paymentMethodType) {
|
|
@@ -979,7 +881,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
979
881
|
countryCode: { type: String },
|
|
980
882
|
invoiceId: { type: String },
|
|
981
883
|
amount: { type: Object },
|
|
982
|
-
successRedirectUrl: { type: String },
|
|
983
884
|
selectedOption: { type: String },
|
|
984
885
|
validateOnSubmit: { type: Function },
|
|
985
886
|
forceStorePaymentMethod: { type: Boolean }
|
|
@@ -993,9 +894,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
993
894
|
const selectedIntegration = ref();
|
|
994
895
|
const integrationRefs = ref(/* @__PURE__ */ new Map());
|
|
995
896
|
const showIntegrationError = ref(false);
|
|
996
|
-
function handleSelect(
|
|
997
|
-
|
|
897
|
+
function handleSelect({
|
|
898
|
+
paymentGatewayVariant,
|
|
899
|
+
paymentMethodType
|
|
900
|
+
}) {
|
|
998
901
|
showIntegrationError.value = false;
|
|
902
|
+
emit("select", { paymentGatewayVariant, paymentMethodType });
|
|
999
903
|
}
|
|
1000
904
|
function submit() {
|
|
1001
905
|
var _a, _b;
|
|
@@ -1005,12 +909,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1005
909
|
}
|
|
1006
910
|
(_b = integrationRefs.value.get(selectedIntegration.value)) == null ? void 0 : _b.submit();
|
|
1007
911
|
}
|
|
1008
|
-
const handlePaymentSuccess = () => {
|
|
1009
|
-
if (props.successRedirectUrl) {
|
|
1010
|
-
window.location.href = props.successRedirectUrl;
|
|
1011
|
-
}
|
|
1012
|
-
emit("payment-success");
|
|
1013
|
-
};
|
|
1014
912
|
return (_ctx, _cache) => {
|
|
1015
913
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
1016
914
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.paymentMethodOptions, (paymentMethodOption) => {
|
|
@@ -1021,7 +919,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1021
919
|
((_a = paymentMethodOption.integration.payment_gateway) == null ? void 0 : _a.variant) === "ADYEN" ? (openBlock(), createBlock(_sfc_main$1, {
|
|
1022
920
|
key: 0,
|
|
1023
921
|
ref_for: true,
|
|
1024
|
-
ref: (el) => integrationRefs.value.set(
|
|
922
|
+
ref: (el) => integrationRefs.value.set(
|
|
923
|
+
paymentMethodOption.integration.payment_gateway.variant,
|
|
924
|
+
el
|
|
925
|
+
),
|
|
1025
926
|
context: __props.context,
|
|
1026
927
|
"payment-method-option-response-entry": paymentMethodOption,
|
|
1027
928
|
"country-code": __props.countryCode,
|
|
@@ -1029,17 +930,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1029
930
|
variant: __props.variant,
|
|
1030
931
|
amount: __props.amount,
|
|
1031
932
|
"invoice-id": __props.invoiceId,
|
|
1032
|
-
selected: selectedIntegration.value ===
|
|
933
|
+
selected: selectedIntegration.value === paymentMethodOption.integration.payment_gateway.variant,
|
|
1033
934
|
"validate-on-submit": __props.validateOnSubmit,
|
|
1034
935
|
"force-store-payment-method": __props.forceStorePaymentMethod,
|
|
1035
|
-
onSelect:
|
|
1036
|
-
onPaymentFailed: _cache[
|
|
1037
|
-
onPaymentSuccess:
|
|
1038
|
-
onReady: _cache[2] || (_cache[2] = ($event) => emit("ready"))
|
|
936
|
+
onSelect: handleSelect,
|
|
937
|
+
onPaymentFailed: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("payment-failed", $event)),
|
|
938
|
+
onPaymentSuccess: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("payment-success")),
|
|
939
|
+
onReady: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("ready"))
|
|
1039
940
|
}, null, 8, ["context", "payment-method-option-response-entry", "country-code", "customer-id", "variant", "amount", "invoice-id", "selected", "validate-on-submit", "force-store-payment-method"])) : createCommentVNode("", true)
|
|
1040
941
|
], 64);
|
|
1041
942
|
}), 128)),
|
|
1042
|
-
showIntegrationError.value ? (openBlock(), createBlock(unref(_sfc_main$
|
|
943
|
+
showIntegrationError.value ? (openBlock(), createBlock(unref(_sfc_main$8), {
|
|
1043
944
|
key: 0,
|
|
1044
945
|
variant: "error",
|
|
1045
946
|
class: "mt-2"
|
|
@@ -1058,10 +959,5 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1058
959
|
}
|
|
1059
960
|
});
|
|
1060
961
|
export {
|
|
1061
|
-
_sfc_main as _
|
|
1062
|
-
_sfc_main$4 as a,
|
|
1063
|
-
createReturnUrl as c,
|
|
1064
|
-
getAdyenExpressCheckoutConfiguration as g,
|
|
1065
|
-
transformObjectToAdyenObject as t,
|
|
1066
|
-
useLogger as u
|
|
962
|
+
_sfc_main as _
|
|
1067
963
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("vue"),t=require("./vendor-ui-5pJF5KBP.js"),n=require("./adyen-R6aSZ0Yf.js"),a=require("./payments-DkHhTHto.js"),o=require("./paymentMethods-C_sdTkSF.js"),r=require("./component-BOqPDAVk.js"),i=e=>{let t={};return"TOKENIZE"===e&&(t={"en-US":{payButton:"Add payment method",confirmPurchase:"Add payment method"},"fr-FR":{payButton:"Ajouter un moyen de paiement",confirmPurchase:"Ajouter un moyen de paiement"},"de-DE":{payButton:"Zahlungsmethode hinzufügen",confirmPurchase:"Zahlungsmethode hinzufügen"},"it-IT":{payButton:"Aggiungi metodo di pagamento",confirmPurchase:"Aggiungi metodo di pagamento"},"es-ES":{payButton:"Añadir método de pago",confirmPurchase:"Añadir método de pago"},"nl-NL":{payButton:"Betaalmethode toevoegen",confirmPurchase:"Betaalmethode toevoegen"},"pt-BR":{payButton:"Adicionar método de pagamento",confirmPurchase:"Adicionar método de pagamento"},"pt-PT":{payButton:"Adicionar método de pagamento",confirmPurchase:"Adicionar método de pagamento"},"pl-PL":{payButton:"Dodaj metodę płatności",confirmPurchase:"Dodaj metodę płatności"},"ru-RU":{payButton:"Добавить способ оплаты",confirmPurchase:"Добавить способ оплаты"},"sv-SE":{payButton:"Lägg till betalningsmetod",confirmPurchase:"Lägg till betalningsmetod"},"da-DK":{payButton:"Tilføj betalingsmetode",confirmPurchase:"Tilføj betalingsmetode"},"fi-FI":{payButton:"Lisää maksutapa",confirmPurchase:"Lisää maksutapa"},"no-NO":{payButton:"Legg til betalingsmetode",confirmPurchase:"Legg til betalingsmetode"},"cs-CZ":{payButton:"Přidat platební metodu",confirmPurchase:"Přidat platební metodu"},"hu-HU":{payButton:"Fizetési mód hozzáadása",confirmPurchase:"Fizetési mód hozzáadása"},"ro-RO":{payButton:"Adăugați metodă de plată",confirmPurchase:"Adăugați metodă de plată"},"ja-JP":{payButton:"支払い方法を追加",confirmPurchase:"支払い方法を追加"},"ko-KR":{payButton:"결제 수단 추가",confirmPurchase:"결제 수단 추가"},"zh-CN":{payButton:"添加支付方式",confirmPurchase:"添加支付方式"},"zh-TW":{payButton:"新增付款方式",confirmPurchase:"新增付款方式"},ar:{payButton:"إضافة وسيلة دفع",confirmPurchase:"إضافة وسيلة دفع"},"hr-HR":{payButton:"Dodajte način plačanja",confirmPurchase:"Dodajte način plačanja"},"el-GR":{payButton:"Προσθήκη μεθόδου πληρωμής",confirmPurchase:"Προσθήκη μεθόδου πληρωμής"},"sk-SK":{payButton:"Pridať spôsob platby",confirmPurchase:"Pridať spôsob platby"},"sl-SI":{payButton:"Dodajte način plačanja",confirmPurchase:"Dodajte način plačanja"},"bg-BG":{payButton:"Добавяне на начин на плащане",confirmPurchase:"Добавяне на начин на плащане"},"ca-ES":{payButton:"Afegir mètode de pagament",confirmPurchase:"Afegir mètode de pagament"},"et-EE":{payButton:"Lisa makseviis",confirmPurchase:"Lisa makseviis"},"lv-LV":{payButton:"Pievienot maksājuma veidu",confirmPurchase:"Pievienot maksājuma veidu"},"lt-LT":{payButton:"Pridėti mokėjimo metodą",confirmPurchase:"Pridėti mokėjimo metodą"}}),t},d=e.defineComponent({__name:"PaymentCompletedCard",props:{amount:{type:Object},variant:{type:String}},setup(a){const o=a,{$t:r}=t.useIntl(),i=e.computed(()=>"AUTHORIZE"===o.variant?r({defaultMessage:"Payment successful",description:"The title for when a payment has been successful",id:"payment_completed_card.title.authorize"}):r({defaultMessage:"Your payment method is added",description:"The title for when a payment method was successfully added",id:"payment_completed_card.title.tokenize"}));return(o,d)=>(e.openBlock(),e.createBlock(n._sfc_main,{status:"success",title:i.value},{default:e.withCtx(()=>[a.amount?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:0,variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$6),{icon:"check"}),e.createTextVNode(e.toDisplayString(e.unref(t.formatAmount)(a.amount)),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(t._sfc_main),{variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"You are being redirected...",description:"The text shown after a successful message before a redirect",id:"payment_completed_card.redirect_message"})),1)]),_:1})]),_:1},8,["title"]))}}),c={UNKNOWN_ERROR:{title:"Something went wrong",message:"An unknown error has occurred",isReloadButtonVisible:!0},AUTHORIZATION_FAILED:{title:"Payment failed",message:"The payment failed"},PAYMENT_DETAILS_CALL_FAILED:{title:"Payment details call failed",message:"There was a problem getting the payment details"},PAYMENT_METHOD_STORAGE_FAILED:{title:"Failed storing payment method",message:"Something went wrong with storing the payment method"},REDIRECT_RESULT_PAYMENT_ACCEPTOR_MISSING:{title:"Missing payment acceptor",message:"A redirect result is set, but a payment acceptor is missing in the url"},TOKENIZE_FAILED:{title:"Tokenization failed",message:"The tokenization of the payment method has failed"},PAYMENT_INTEGRATION_INITIALIZATION_FAILED:{title:"Failed loading payment methods",message:"Failed loading payment integration",isReloadButtonVisible:!0},RESOURCE_REVOKED:{title:"Resource revoked",message:"The resource has been revoked",isReloadButtonVisible:!0}},s={class:"flex flex-col items-center gap-6"},m=e.defineComponent({__name:"PaymentErrorCard",props:{error:{type:Object}},setup(a){const o=a,{$t:r}=t.useIntl(),i=e.computed(()=>c[o.error.code]),d=()=>{window.location.reload()};return(a,o)=>(e.openBlock(),e.createBlock(n._sfc_main,{status:"error",title:i.value.title},{default:e.withCtx(()=>[e.createElementVNode("div",s,[e.createVNode(e.unref(t._sfc_main),{variant:"body-xs",shade:"lighter",class:"mt-3"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.message),1)]),_:1}),i.value.isReloadButtonVisible?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{key:0,type:"button",color:"gray",variant:"outline",onClick:d},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Try again",description:"Retry button text when an error has happened during a payment",id:"payments.retry_button.label"})),1)]),_:1})):e.createCommentVNode("",!0)])]),_:1},8,["title"]))}}),u=["applepay"];const p="ADYEN",l=e.defineComponent({__name:"PaymentIntegrationFormAdyen",props:{countryCode:{type:String},customerId:{type:String},invoiceId:{type:String},paymentMethodOptionResponseEntry:{type:Object},variant:{type:String},selected:{type:Boolean},amount:{type:Object},validateOnSubmit:{type:Function,default:()=>Promise.resolve(!0)},context:{type:Object},forceStorePaymentMethod:{type:Boolean}},emits:["select","payment-failed","payment-success","ready"],setup(c,{expose:s,emit:l}){let y=null,h=null;const _=c,f=l;s({submit:function(){try{null==y||y.submit()}catch(e){A.error("ADYEN_SUBMIT_FAILED","Failed to submit Adyen drop-in",{},e)}}});const g=e.ref(),E=e.ref(!1),v=e.ref(),A=r.useLogger(),{locale:I}=t.useIntl(),{authorizePayment:R,getPaymentDetails:k}=a.createPaymentsService(),{tokenizePaymentMethod:b}=o.createPaymentMethodsService(),P=e.inject(r.EXPERIMENTAL_FEATURE_INJECTION_KEY),T=e.computed(()=>"TOKENIZE"===_.variant);async function N(){var e;const t=n.transformToAdyenAmount(_.amount),a=(null==(e=null==P?void 0:P.value)?void 0:e["express-checkout"])?function(e){return e.filter(e=>!u.some(t=>{var n;return t===(null==(n=e.type)?void 0:n.toLowerCase())}))}(n.mapAdyenPaymentMethods(_.paymentMethodOptionResponseEntry)):n.mapAdyenPaymentMethods(_.paymentMethodOptionResponseEntry);return{checkoutConfig:{amount:t,clientKey:n.getAdyenClientKeyFromPaymentMethodOptionsResponse(_.paymentMethodOptionResponseEntry),environment:n.getAdyenEnvironmentFromPaymentMethodOptionsResponse(_.paymentMethodOptionResponseEntry,A),locale:I,translations:i(_.variant),countryCode:_.countryCode,analytics:{enabled:!1},paymentMethodsResponse:{paymentMethods:a},onSubmit:B,onAdditionalDetails:x,onPaymentCompleted:M,onPaymentFailed:S,onError:D,showPayButton:T.value},dropInConfig:{disableFinalAnimation:!0,paymentMethodsConfiguration:{card:{hasHolderName:!0,holderNameRequired:!0,enableStoreDetails:!_.forceStorePaymentMethod&&"AUTHORIZE"===_.variant},paypal:{intent:t.value>0?"authorize":"tokenize",showPayButton:!0}},openFirstPaymentMethod:_.selected,onSelect:({props:{type:e}})=>{e&&f("select",{paymentMethodType:e,paymentGatewayVariant:"ADYEN"})},onReady:()=>f("ready")}}}async function O(){if(g.value)try{await w();const[e,{default:t}]=await Promise.all([Promise.resolve().then(()=>require("./index-DIFK3mcJ.js")),Promise.resolve().then(()=>require("./adyen-mQEEOjgl.js"))]),{AdyenCheckout:n,Dropin:a,Card:o,Bancontact:r,Ach:i,AmazonPay:d,ApplePay:c,BcmcMobile:s,BacsDirectDebit:m,CashAppPay:u,EPS:p,GooglePay:l,Klarna:f,PayByBank:E,PayPal:v,SepaDirectDebit:A,Trustly:I,Twint:R,PayByBankUS:k,Redirect:b}=e,{checkoutConfig:P,dropInConfig:T}=await N();h=await n(P),y=new a(h,{...T,paymentMethodComponents:[o,r,i,d,c,s,m,u,p,l,f,E,v,A,I,R,k,b]}).mount(g.value),function(e){var t;const n=null==(t=g.value)?void 0:t.getRootNode();if(n instanceof ShadowRoot){const t=document.createElement("link");t.rel="stylesheet",t.href=e,n.appendChild(t);const a=document.createElement("style");a.textContent="\n :host {\n --adyen-sdk-color-background-secondary: transparent;\n --adyen-sdk-color-background-primary: rgb(243 244 246 / 0.5);\n --adyen-sdk-color-outline-secondary: #e5e7eb;\n --adyen-sdk-color-outline-primary: transparent;\n --adyen-sdk-color-background-always-dark: var(--color-primary-500);\n --adyen-sdk-color-background-inverse-primary-hover: var(--color-primary-600);\n }\n\n .adyen-checkout__payment-method__image__wrapper {\n width: 32px;\n height: 32px;\n }\n\n .adyen-checkout__payment-method__image {\n height: 32px;\n }\n\n .adyen-checkout__input-wrapper,\n .adyen-checkout__input {\n border-color: rgb(229, 231, 235);\n border-radius: var(--adyen-sdk-border-radius-s, 4px);\n }\n\n .adyen-checkout__button,\n .adyen-checkout__payment-method {\n border-radius: var(--adyen-sdk-border-radius-s, 4px);\n }\n\n .adyen-checkout__payment-method {\n border-color: rgb(229, 231, 235);\n box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);\n transition: box-shadow 0.2s ease-in-out;\n }\n\n .adyen-checkout__payment-method--selected {\n box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);\n }\n\n .adyen-checkout__payment-method:after {\n transform: scale(0%);\n }\n\n .adyen-checkout__paypal__button {\n display: block !important;\n }\n\n .adyen-checkout__payment-methods-list {\n gap: 4px;\n }\n\n .adyen-checkout__dropdown__list {\n background-color: white;\n border-radius: var(--adyen-sdk-border-radius-s, 4px);\n }\n\n .adyen-checkout__payment-method.adyen-checkout__payment-method--selected:after {\n content: '✓';\n width: 20px;\n height: 20px;\n border-radius: 10px;\n background-color: var(--color-primary-600);\n position: absolute;\n top: 14px;\n right: 14px;\n text-align: center;\n line-height: 20px;\n color: white;\n transform: scale(100%);\n font-size: 12px;\n }\n\n .adyen-checkout__payment-method__header {\n padding: 8px 16px !important;\n }\n\n .adyen-checkout__payment-method__brands {\n align-items: center;\n }\n .adyen-checkout__payment-method__brand-number {\n line-height: 1;\n }\n .adyen-checkout__button__text {\n font-size: 14px;\n }\n .adyen-checkout__store-details {\n background: transparent;\n padding: 0;\n }\n .adyen-checkout__checkbox__input + .adyen-checkout__checkbox__label:after {\n border-color: rgb(229, 231, 235);\n }\n ","AUTHORIZE"===_.variant&&(a.textContent+="\n .adyen-checkout__payment-method--cashapp .adyen-checkout-pm-details-wrapper {\n display: none;\n }\n "),n.appendChild(a)}}(t)}catch(e){A.error("PAYMENT_INTEGRATION_INITIALIZATION_FAILED","Failed to mount Adyen web drop-in",{error:e})}}async function w(){y&&(y.unmount(),y=null),g.value&&(g.value.innerHTML="")}function B(...e){const[t,a,o]=e;_.validateOnSubmit().then(e=>{if(!e)return;const a=_.paymentMethodOptionResponseEntry.payment_acceptor.id,r={risk_data:n.transformObjectToAdyenObject(t.data.riskData),payment_method:n.transformObjectToAdyenObject(t.data.paymentMethod),browser_info:n.transformObjectToAdyenObject(t.data.browserInfo)};if("AUTHORIZE"===_.variant){const e=n.createReturnUrl({paymentAcceptorId:_.paymentMethodOptionResponseEntry.payment_acceptor.id,redirectUrl:window.location.href});return void R({payment_acceptor_id:a,..._.customerId?{customer_id:_.customerId}:{},payment_gateway_variant:p,adyen:{...r,store_payment_method:_.forceStorePaymentMethod||t.data.storePaymentMethod},amount:_.amount,..._.context?{context:_.context}:{},return_url:e}).then(e=>{const n=t.data.paymentMethod.type;if(["FAILURE","REFUSED"].includes(e.status))return A.error("PAYMENT_AUTHORIZATION_FAILED",`Failed payment authorization for payment acceptor with id ${a}`,{error:e}),void o.resolve({resultCode:"Error"});if("ACTION_REQUIRED"===e.status&&e.action.payment_gateway_variant===p){const t=C(e,n);return t?(y.handleAction(t),void o.resolve({resultCode:e.action.adyen.result_code,action:t})):void A.error("PAYMENT_AUTHORIZATION_FAILED",`Failed payment authorization for payment acceptor with id ${a}`,{error:e})}E.value=!0,o.resolve({resultCode:"Authorised"})}).catch(e=>{A.error("PAYMENT_AUTHORIZATION_FAILED",`Failed payment authorization for payment acceptor with id ${a}`,{error:e}),o.resolve({resultCode:"Error"})})}if("TOKENIZE"===_.variant){const e=n.createReturnUrl({paymentAcceptorId:_.paymentMethodOptionResponseEntry.payment_acceptor.id,redirectUrl:window.location.href});if(!_.customerId)return void A.error("TOKENIZATION_FAILED",`Missing customer id for payment acceptor with id ${a}`);b({customer_id:_.customerId,payment_acceptor_id:a,payment_gateway_variant:p,adyen:r,return_url:e}).then(e=>{const n=t.data.paymentMethod.type;if(["FAILURE","REFUSED"].includes(e.status))return A.error("TOKENIZATION_FAILED",`Tokenization failed for payment acceptor with id ${a}`,{error:e}),void o.resolve({resultCode:"Error"});if("ACTION_REQUIRED"===e.status&&e.action.payment_gateway_variant===p){const t=C(e,n);return t?(y.handleAction(t),void o.resolve({resultCode:e.action.adyen.result_code,action:t})):void A.error("TOKENIZATION_FAILED",`Tokenization failed for payment acceptor with id ${a}`,{error:e})}E.value=!0,o.resolve({resultCode:"Authorised"})}).catch(e=>{A.error("TOKENIZATION_FAILED",`Tokenization failed for payment acceptor with id ${a}`,{error:e}),o.resolve({resultCode:"Error"})})}}).catch(e=>{A.error("INTEGRATION_ERROR","Unhandled error in payment submission flow",{},e)})}function C(e,t){if("ACTION_REQUIRED"!==e.status)return;const n=e.action;if("ADYEN"!=n.payment_gateway_variant)return;const a=n.adyen;return{paymentMethodType:(null==a?void 0:a.payment_method_type)??t,method:n.method,url:n.url,data:n.data,type:null==a?void 0:a.action_type,paymentData:null==a?void 0:a.payment_data,sdkData:null==a?void 0:a.sdk_data}}function x(...e){const[t]=e,n=t.data.details,a=t.data.paymentData;if(_.paymentMethodOptionResponseEntry.payment_acceptor.id)return void F({detailsResult:n?(o=n,Object.fromEntries(Object.entries(o).filter(([,e])=>null!=e))):void 0,paymentDataResult:a,paymentAcceptorId:_.paymentMethodOptionResponseEntry.payment_acceptor.id});var o;const r={code:"UNKNOWN_ERROR",message:"Payment failed",error:e};f("payment-failed",r),v.value=r}function S(...e){const[t]=e,n={code:"UNKNOWN_ERROR",message:"Payment failed",error:t};f("payment-failed",n),v.value=n}function M(...e){const[,t]=e;null==t||t.unmount(),f("payment-success")}function D(...e){const[t,n]=e;if("CANCEL"===t.name)return;const a={code:"UNKNOWN_ERROR",message:"Something went wrong",error:t};A.error("INTEGRATION_ERROR","Something went wrong",{error:t}),v.value=a,null==n||n.unmount()}function F({detailsResult:e,threeDSResult:t,redirectResult:n,paymentDataResult:a,paymentAcceptorId:o}){k({paymentAcceptorId:o,paymentGatewayVariant:p,adyen:{...e?{details:e}:{},...n?{redirect_result:n}:{},...t?{threeds_result:t}:{},...a?{payment_data:a}:{}}}).then(e=>{"FAILURE"!==e.payment_status?"SUCCESS"!==e.payment_status||f("payment-success"):f("payment-failed",{code:"UNKNOWN_ERROR",message:"Failed getting payment details",error:e})}).catch(e=>{A.error("PAYMENT_DETAILS_CALL_FAILED","Failed fetching payment details",{error:e})})}return e.onMounted(()=>{O(),function(){const e=n.getQueryParam(n.REDIRECT_RESULT_QUERY_STRING),t=n.getQueryParam(n.PAYMENT_ACCEPTOR_ID_QUERY_STRING);e&&(t?F({paymentAcceptorId:t,detailsResult:{redirectResult:decodeURI(e)}}):A.error("INVALID_REDIRECT_RESULT","Redirect result is set but payment acceptor id is missing",{context:{redirectResult:e}}))}()}),e.onBeforeUnmount(()=>{w()}),e.watch(()=>_.paymentMethodOptionResponseEntry,(e,n)=>{t.isEqual(e,n)||O()},{deep:!0}),(t,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[E.value?(e.openBlock(),e.createBlock(d,{key:0,variant:c.variant},null,8,["variant"])):v.value?(e.openBlock(),e.createBlock(m,{key:1,error:v.value},null,8,["error"])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"dropInContainerRef",ref:g},null,512)],64))}}),y=e.defineComponent({__name:"PaymentIntegrationForm",props:{customerId:{type:String},variant:{type:String},context:{type:Object},paymentMethodOptions:{type:Array},countryCode:{type:String},invoiceId:{type:String},amount:{type:Object},selectedOption:{type:String},validateOnSubmit:{type:Function},forceStorePaymentMethod:{type:Boolean}},emits:["select","payment-failed","payment-success","ready"],setup(n,{expose:a,emit:o}){const r=n,i=o;a({submit:function(){var e,t;c.value||(m.value=!0,null==(e=r.validateOnSubmit)||e.call(r));null==(t=s.value.get(c.value))||t.submit()}});const{$t:d}=t.useIntl(),c=e.ref(),s=e.ref(new Map),m=e.ref(!1);function u({paymentGatewayVariant:e,paymentMethodType:t}){m.value=!1,i("select",{paymentGatewayVariant:e,paymentMethodType:t})}return(a,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.paymentMethodOptions,t=>{var r;return e.openBlock(),e.createElementBlock(e.Fragment,{key:t.integration.id},["ADYEN"===(null==(r=t.integration.payment_gateway)?void 0:r.variant)?(e.openBlock(),e.createBlock(l,{key:0,ref_for:!0,ref:e=>s.value.set(t.integration.payment_gateway.variant,e),context:n.context,"payment-method-option-response-entry":t,"country-code":n.countryCode,"customer-id":n.customerId,variant:n.variant,amount:n.amount,"invoice-id":n.invoiceId,selected:c.value===t.integration.payment_gateway.variant,"validate-on-submit":n.validateOnSubmit,"force-store-payment-method":n.forceStorePaymentMethod,onSelect:u,onPaymentFailed:o[0]||(o[0]=e=>a.$emit("payment-failed",e)),onPaymentSuccess:o[1]||(o[1]=e=>a.$emit("payment-success")),onReady:o[2]||(o[2]=e=>a.$emit("ready"))},null,8,["context","payment-method-option-response-entry","country-code","customer-id","variant","amount","invoice-id","selected","validate-on-submit","force-store-payment-method"])):e.createCommentVNode("",!0)],64)}),128)),m.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$23),{key:0,variant:"error",class:"mt-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)({defaultMessage:"Select a payment method",id:"payment_integration_form.select_payment_method_error",description:"Error shown when no payment method is selected"})),1)]),_:1})):e.createCommentVNode("",!0)],64))}});exports._sfc_main=y;
|
|
@@ -1,30 +1,5 @@
|
|
|
1
|
-
import { defineComponent, openBlock, createElementBlock, createVNode, unref, withCtx, createTextVNode, toDisplayString,
|
|
2
|
-
import { _ as _sfc_main$
|
|
3
|
-
import { a as _sfc_main$2 } from "./Button.vue.es-6sBk5tBL.mjs";
|
|
4
|
-
const _hoisted_1$1 = { class: "flex gap-1" };
|
|
5
|
-
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
6
|
-
__name: "Kpi",
|
|
7
|
-
props: {
|
|
8
|
-
icon: { type: null },
|
|
9
|
-
kpi: { type: String }
|
|
10
|
-
},
|
|
11
|
-
setup(__props) {
|
|
12
|
-
return (_ctx, _cache) => {
|
|
13
|
-
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
14
|
-
createVNode(unref(_sfc_main$2), {
|
|
15
|
-
icon: __props.icon,
|
|
16
|
-
size: "xs"
|
|
17
|
-
}, null, 8, ["icon"]),
|
|
18
|
-
createVNode(unref(_sfc_main$3), { variant: "body-xs" }, {
|
|
19
|
-
default: withCtx(() => [
|
|
20
|
-
createTextVNode(toDisplayString(__props.kpi), 1)
|
|
21
|
-
]),
|
|
22
|
-
_: 1
|
|
23
|
-
})
|
|
24
|
-
]);
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
});
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, createVNode, unref, withCtx, createTextVNode, toDisplayString, renderSlot } from "vue";
|
|
2
|
+
import { _ as _sfc_main$1 } from "./vendor-ui-C0K3osvz.mjs";
|
|
28
3
|
const _hoisted_1 = { class: "flex items-start" };
|
|
29
4
|
const _hoisted_2 = { class: "flex flex-col grow" };
|
|
30
5
|
const _hoisted_3 = { class: "flex items-center gap-1" };
|
|
@@ -40,7 +15,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
40
15
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
41
16
|
createElementVNode("div", _hoisted_2, [
|
|
42
17
|
createElementVNode("div", _hoisted_3, [
|
|
43
|
-
createVNode(unref(_sfc_main$
|
|
18
|
+
createVNode(unref(_sfc_main$1), {
|
|
44
19
|
tag: "span",
|
|
45
20
|
variant: "body-sm",
|
|
46
21
|
weight: "semibold"
|
|
@@ -52,7 +27,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
52
27
|
}),
|
|
53
28
|
renderSlot(_ctx.$slots, "badge")
|
|
54
29
|
]),
|
|
55
|
-
createVNode(unref(_sfc_main$
|
|
30
|
+
createVNode(unref(_sfc_main$1), {
|
|
56
31
|
tag: "span",
|
|
57
32
|
variant: "body-xs",
|
|
58
33
|
shade: "lighter"
|
|
@@ -71,6 +46,5 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
71
46
|
}
|
|
72
47
|
});
|
|
73
48
|
export {
|
|
74
|
-
_sfc_main as _
|
|
75
|
-
_sfc_main$1 as a
|
|
49
|
+
_sfc_main as _
|
|
76
50
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("vue"),t=require("./vendor-ui-5pJF5KBP.js"),r={class:"flex items-start"},n={class:"flex flex-col grow"},a={class:"flex items-center gap-1"},s={class:"flex items-center ml-4 self-center"},i=e.defineComponent({__name:"PricingGroupContent",props:{name:{type:String},description:{type:String}},setup:i=>(o,l)=>(e.openBlock(),e.createElementBlock("div",r,[e.createElementVNode("div",n,[e.createElementVNode("div",a,[e.createVNode(e.unref(t._sfc_main),{tag:"span",variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.name),1)]),_:1}),e.renderSlot(o.$slots,"badge")]),e.createVNode(e.unref(t._sfc_main),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.description),1)]),_:1})]),e.createElementVNode("div",s,[e.renderSlot(o.$slots,"default")])]))});exports._sfc_main=i;
|
|
@@ -50,21 +50,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
50
50
|
return hasSlotContent.value ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
51
51
|
__props.variant === "title" ? (openBlock(), createElementBlock("div", mergeProps({ key: 0 }, _ctx.$attrs, {
|
|
52
52
|
"data-testid": __props.dataTestid,
|
|
53
|
-
class: "h-6 w-40 rounded border border-gray-50 bg-gray-50/50"
|
|
53
|
+
class: "sv-skeleton sv-skeleton--title h-6 w-40 rounded border border-gray-50 bg-gray-50/50"
|
|
54
54
|
}), null, 16, _hoisted_1)) : __props.variant === "divider-text" ? (openBlock(), createElementBlock("div", mergeProps({ key: 1 }, _ctx.$attrs, {
|
|
55
55
|
"data-testid": __props.dataTestid,
|
|
56
|
-
class: "mx-auto h-4 w-12 rounded border border-gray-50 bg-gray-50/50"
|
|
57
|
-
}), null, 16, _hoisted_2)) : __props.variant === "section" ? (openBlock(), createElementBlock("div", mergeProps({ key: 2 }, _ctx.$attrs, {
|
|
58
|
-
|
|
56
|
+
class: "sv-skeleton sv-skeleton--divider-text mx-auto h-4 w-12 rounded border border-gray-50 bg-gray-50/50"
|
|
57
|
+
}), null, 16, _hoisted_2)) : __props.variant === "section" ? (openBlock(), createElementBlock("div", mergeProps({ key: 2 }, _ctx.$attrs, {
|
|
58
|
+
"data-testid": __props.dataTestid,
|
|
59
|
+
class: "sv-skeleton sv-skeleton--section"
|
|
60
|
+
}), [
|
|
61
|
+
_cache[0] || (_cache[0] = createElementVNode("div", { class: "sv-skeleton__title h-6 w-40 rounded border border-gray-50 bg-gray-50/50" }, null, -1)),
|
|
59
62
|
createElementVNode("div", {
|
|
60
63
|
class: normalizeClass([
|
|
61
|
-
"mt-1 rounded border border-gray-50 bg-gray-50/50 md:mt-2",
|
|
64
|
+
"sv-skeleton__body mt-1 rounded border border-gray-50 bg-gray-50/50 md:mt-2",
|
|
62
65
|
_ctx.$props.class
|
|
63
66
|
])
|
|
64
67
|
}, null, 2)
|
|
65
68
|
], 16, _hoisted_3)) : (openBlock(), createElementBlock("div", mergeProps({ key: 3 }, _ctx.$attrs, {
|
|
66
69
|
"data-testid": __props.dataTestid,
|
|
67
|
-
class: ["rounded border border-gray-50 bg-gray-50/50", _ctx.$props.class]
|
|
70
|
+
class: ["sv-skeleton rounded border border-gray-50 bg-gray-50/50", _ctx.$props.class]
|
|
68
71
|
}), null, 16, _hoisted_4))
|
|
69
72
|
], 64));
|
|
70
73
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("vue"),t=["data-testid"],r=["data-testid"],s=["data-testid"],a=["data-testid"],n=e.defineComponent({__name:"Skeleton",props:{variant:{type:String},class:{type:String},dataTestid:{type:String}},setup(n){const d=e.useSlots(),o=t=>{if(null==t||!1===t)return!0;if("string"==typeof t||"number"==typeof t)return 0===String(t).trim().length;if(Array.isArray(t))return t.every(o);if(!e.isVNode(t))return!1;const r=t;return r.type===e.Comment||(r.type===e.Text?"string"!=typeof r.children||!r.children.trim():r.type===e.Fragment&&(null==r.children||!!Array.isArray(r.children)&&r.children.every(o)))},l=e.computed(()=>{if(!d.default)return!1;const e=d.default({});return!(!e||0===e.length)&&!e.every(o)});return(d,o)=>l.value?e.renderSlot(d.$slots,"default",{key:0}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},["title"===n.variant?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:0},d.$attrs,{"data-testid":n.dataTestid,class:"sv-skeleton sv-skeleton--title h-6 w-40 rounded border border-gray-50 bg-gray-50/50"}),null,16,t)):"divider-text"===n.variant?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:1},d.$attrs,{"data-testid":n.dataTestid,class:"sv-skeleton sv-skeleton--divider-text mx-auto h-4 w-12 rounded border border-gray-50 bg-gray-50/50"}),null,16,r)):"section"===n.variant?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:2},d.$attrs,{"data-testid":n.dataTestid,class:"sv-skeleton sv-skeleton--section"}),[o[0]||(o[0]=e.createElementVNode("div",{class:"sv-skeleton__title h-6 w-40 rounded border border-gray-50 bg-gray-50/50"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["sv-skeleton__body mt-1 rounded border border-gray-50 bg-gray-50/50 md:mt-2",d.$props.class])},null,2)],16,s)):(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:3},d.$attrs,{"data-testid":n.dataTestid,class:["sv-skeleton rounded border border-gray-50 bg-gray-50/50",d.$props.class]}),null,16,a))],64))}});exports._sfc_main=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./useIncrementalLoading-DoTTXM2Y.js"),t=require("./subscriptions-jelITJcX.js"),i=require("vue"),s=require("./vendor-ui-5pJF5KBP.js"),o=require("./Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),n=require("./useActionDispatchProvider-rw9kWeE0.js");const c={class:"sv-subscriptions-list__item-body flex flex-col gap-4 md:flex-row"},r={class:"sv-subscriptions-list__item-content grow"},a={class:"sv-subscriptions-list__item-meta mt-4 flex items-center gap-6"},u={key:1,class:"sv-subscriptions-list__item-next-invoice flex gap-1"},l={class:"sv-subscriptions-list__item-actions flex flex-col items-center gap-2 md:flex-row"},p=i.defineComponent({__name:"SubscriptionsListItem",props:{subscription:{type:Object},paymentMethod:{type:Object},customer:{type:Object},showViewSubscriptionDetailsButton:{type:Boolean,default:!0},showCancelSubscriptionButton:{type:Boolean,default:!0},showRenewSubscriptionButton:{type:Boolean,default:!0}},emits:["view-subscription-details","cancel-subscription","renew-subscription"],setup(e){const t=e,{$t:o}=s.useIntl(),{formatDate:n}=s.useIntl(),p=i.computed(()=>{var e;const i=t.subscription.pricing_plan_schedule_infos;if(0===i.length)return;const s=i[i.length-1];return null==(e=null==s?void 0:s.pricing_plan_version)?void 0:e.pricing_plan}),d=i.computed(()=>{var e;return t.subscription.name||(null==(e=p.value)?void 0:e.name)||o({defaultMessage:"Subscription",description:"The fallback name for when no subscription name can be determined",id:"customer_overview.subscriptions_block.fallback_subscription_name"})}),b=i.computed(()=>{var e;return null==(e=p.value)?void 0:e.description}),m=i.computed(()=>{const e=t.subscription.inactive_periods;return!e||0===e.length}),_=i.computed(()=>{const e=t.subscription.inactive_periods;return Array.isArray(e)&&e.length>0}),v=i.computed(()=>m.value&&t.showCancelSubscriptionButton),f=i.computed(()=>_.value&&t.showRenewSubscriptionButton),h=i.computed(()=>t.showViewSubscriptionDetailsButton);return(t,p)=>(i.openBlock(),i.createBlock(i.unref(s._sfc_main$1),{class:"sv-subscriptions-list__item"},{default:i.withCtx(()=>[i.createElementVNode("div",c,[i.createElementVNode("div",r,[i.createVNode(i.unref(s._sfc_main),{tag:"h3",variant:"heading-2",class:"sv-subscriptions-list__item-title"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(d.value),1)]),_:1}),b.value?(i.openBlock(),i.createBlock(i.unref(s._sfc_main),{key:0,variant:"body-sm",tag:"span",shade:"lighter",class:"sv-subscriptions-list__item-description"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(b.value),1)]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",a,[e.paymentMethod?(i.openBlock(),i.createBlock(i.unref(s._sfc_main$5),{key:0,variant:"condensed",class:"sv-payment-methods__item","payment-method":e.paymentMethod},null,8,["payment-method"])):i.createCommentVNode("",!0),e.subscription.next_invoice?(i.openBlock(),i.createElementBlock("div",u,[i.createVNode(i.unref(s._sfc_main),{tag:"span",variant:"body-xs",shade:"light",weight:"semibold"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)({defaultMessage:"Next billing date",description:"The label for the next billing date",id:"customer.subscriptions_block.next_billing_date"})),1)]),_:1}),i.createVNode(i.unref(s._sfc_main),{tag:"span",variant:"body-xs",shade:"light"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)({date:e.subscription.next_invoice.invoice_date,format:"date",offsetType:"offsetted",timezone:e.customer.timezone})),1)]),_:1})])):i.createCommentVNode("",!0)])]),i.createElementVNode("div",l,[h.value?(i.openBlock(),i.createBlock(i.unref(s._sfc_main$3),{key:0,color:"primary",class:"sv-action sv-action--primary sv-subscriptions-list__item-details w-full md:w-auto",type:"button",onClick:p[0]||(p[0]=i=>t.$emit("view-subscription-details",{subscriptionId:e.subscription.id}))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)({defaultMessage:"Subscription details",description:"The label for the subscription details button in the subscriptions block",id:"customer.subscriptions_block.show_details_button_label"})),1)]),_:1})):i.createCommentVNode("",!0),v.value?(i.openBlock(),i.createBlock(i.unref(s._sfc_main$3),{key:1,variant:"outline",color:"gray",class:"sv-action sv-action--secondary sv-subscriptions-list__item-cancel w-full md:w-auto",type:"button",onClick:p[1]||(p[1]=i=>t.$emit("cancel-subscription",{subscriptionId:e.subscription.id}))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)({defaultMessage:"Cancel subscription",description:"The label for the cancel subscription button in the subscriptions block",id:"customer.subscriptions_block.cancel_button_label"})),1)]),_:1})):f.value?(i.openBlock(),i.createBlock(i.unref(s._sfc_main$3),{key:2,variant:"outline",color:"gray",class:"sv-action sv-action--secondary sv-subscriptions-list__item-renew w-full md:w-auto",type:"button",onClick:p[2]||(p[2]=i=>t.$emit("renew-subscription",{subscriptionId:e.subscription.id}))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)({defaultMessage:"Renew subscription",description:"The label for the renew subscription button in the subscriptions block",id:"customer.subscriptions_block.renew_button_label"})),1)]),_:1})):i.createCommentVNode("",!0)])])]),_:1}))}}),d={key:1,class:"sv-subscriptions-list__items grid grid-cols-1 gap-4"},b=i.defineComponent({__name:"SubscriptionsList",props:{customer:{type:Object},subscriptions:{type:Array},paymentMethods:{default:()=>[],type:Array},isLoading:{type:Boolean},showViewAllButton:{type:Boolean,default:!0},showViewDetailsButton:{type:Boolean,default:!0},showCancelButton:{type:Boolean,default:!0},showRenewButton:{type:Boolean,default:!0}},emits:["view-subscription-details","view-all-subscriptions","cancel-subscription","renew-subscription","load-more"],setup(e){const t=e,{$t:o}=s.useIntl(),n=i.computed(()=>t.subscriptions.length>0),c=e=>{if(e)return t.paymentMethods.find(({id:t})=>t===e)},r=i.computed(()=>t.showViewAllButton);return(t,a)=>(i.openBlock(),i.createBlock(i.unref(s._sfc_main$1),{class:"sv-subscriptions-list","no-spacing":"","no-border":"",title:i.unref(o)({defaultMessage:"{count, plural, one {My subscription} other {My subscriptions}}",description:"Title for the subscriptions block on the customer overview page",id:"customer_overview.subscriptions_block.title"},{count:String(e.subscriptions.length)})},i.createSlots({default:i.withCtx(()=>[n.value?(i.openBlock(),i.createElementBlock("div",d,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.subscriptions,s=>(i.openBlock(),i.createBlock(p,{key:s.id,subscription:s,"payment-method":c(s.payment_method_id),customer:e.customer,"show-view-subscription-details-button":e.showViewDetailsButton,"show-cancel-subscription-button":e.showCancelButton,"show-renew-subscription-button":e.showRenewButton,onViewSubscriptionDetails:a[1]||(a[1]=e=>t.$emit("view-subscription-details",e)),onCancelSubscription:a[2]||(a[2]=e=>t.$emit("cancel-subscription",e)),onRenewSubscription:a[3]||(a[3]=e=>t.$emit("renew-subscription",e))},null,8,["subscription","payment-method","customer","show-view-subscription-details-button","show-cancel-subscription-button","show-renew-subscription-button"]))),128))])):(i.openBlock(),i.createBlock(i.unref(s._sfc_main$1),{key:0,class:"sv-empty-state sv-subscriptions-list__empty"},{default:i.withCtx(()=>[i.createVNode(i.unref(s._sfc_main),{tag:"h3",variant:"heading-3"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)({defaultMessage:"No subscriptions",description:"Title for the my subscriptions block on the customer overview page",id:"customer_overview.subscriptions_block.no_active_subscription_title"})),1)]),_:1}),i.createVNode(i.unref(s._sfc_main),{variant:"body-xs",shade:"lighter"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)({defaultMessage:"There’s no active subscription to display.",description:"Text that is being displayed when there is no active subscription in the subscriptions block",id:"customer_overview.subscriptions_block.no_active_subscription_content"})),1)]),_:1})]),_:1}))]),_:2},[r.value?{name:"right",fn:i.withCtx(()=>[i.createVNode(i.unref(s._sfc_main$3),{size:"sm",variant:"ghost",color:"gray","icon-suffix":"arrow_right_alt",class:"sv-action sv-action--ghost sv-subscriptions-list__view-all",type:"button",onClick:a[0]||(a[0]=e=>t.$emit("view-all-subscriptions"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)({defaultMessage:"View all",description:"The text for the view all subscriptions button",id:"customer_overview.subscriptions_block.view_all_button_label"})),1)]),_:1})]),key:"0"}:void 0]),1032,["title"]))}}),m=i.defineComponent({__name:"SubscriptionsList",props:{customer:{type:null},subscriptions:{type:Array},paymentMethods:{type:Array},isLoading:{type:Boolean},configuration:{type:Object}},emits:["load-more"],setup(e){const{dispatchAction:t}=n.useActionDispatchProvider();return(s,n)=>{var c,r,a,u;return e.isLoading?(i.openBlock(),i.createBlock(o._sfc_main,{key:0,variant:"section",class:"sv-subscriptions-list sv-root sv-component sv-loading min-h-[100px]","data-testid":"subscriptions-list-skeleton"})):e.customer?(i.openBlock(),i.createBlock(b,{key:1,class:"sv-subscriptions-list sv-root sv-component",customer:e.customer,subscriptions:e.subscriptions,"payment-methods":e.paymentMethods,"is-loading":e.isLoading,"show-view-all-button":null==(c=e.configuration)?void 0:c.showViewAllButton,"show-view-details-button":null==(r=e.configuration)?void 0:r.showViewDetailsButton,"show-cancel-button":null==(a=e.configuration)?void 0:a.showCancelButton,"show-renew-button":null==(u=e.configuration)?void 0:u.showRenewButton,onViewSubscriptionDetails:n[0]||(n[0]=e=>i.unref(t)({action:"view-subscription-details",data:{subscriptionId:e.subscriptionId}})),onViewAllSubscriptions:n[1]||(n[1]=e=>i.unref(t)({action:"view-all-subscriptions"})),onCancelSubscription:n[2]||(n[2]=e=>i.unref(t)({action:"cancel-subscription",data:{subscriptionId:e.subscriptionId}})),onRenewSubscription:n[3]||(n[3]=e=>i.unref(t)({action:"renew-subscription",data:{subscriptionId:e.subscriptionId}})),onLoadMore:n[4]||(n[4]=e=>s.$emit("load-more"))},null,8,["customer","subscriptions","payment-methods","is-loading","show-view-all-button","show-view-details-button","show-cancel-button","show-renew-button"])):i.createCommentVNode("",!0)}}});exports._sfc_main=m,exports.useSubscriptionsList=function({customerId:i,batchSize:s=15}){const o=t.createSubscriptionsService();return e.useIncrementalLoading({service:async e=>o.getActiveSubscriptions({customerId:i,pagination:{page:e,pageSize:s}})})};
|