@solvimon/solvimon-web 0.1.0-alpha.16 → 0.1.0-alpha.18
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 +33 -31
- package/dist/AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-C2IRj-FB.mjs +238 -0
- package/dist/AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-Rub9ifBk.js +1 -0
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-BYBAO4Au.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-BWnZ98RQ.mjs} +2 -2
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-BI3Lg7nO.js → BillingInformation.vue_vue_type_script_setup_true_lang-DurgWlLC.js} +1 -1
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CTnn1gkW.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-D7gL7dZX.mjs} +3 -3
- package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Df7CsbiW.js +1 -0
- package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-OUg4yv7r.mjs +2654 -0
- package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-mM5udvi8.js +1 -0
- package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-BIpg-MSJ.mjs +53 -0
- package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-BM3p8Pk8.js +1 -0
- package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D5eSNYH2.js +1 -0
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-ryvFEQMV.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DbY35gE_.mjs} +1 -1
- package/dist/{InvoiceHeader.vue_vue_type_script_setup_true_lang-DdpPrYxi.js → InvoiceHeader.vue_vue_type_script_setup_true_lang-Ci8r6tuC.js} +1 -1
- package/dist/{InvoiceHeader.vue_vue_type_script_setup_true_lang-bAiAbtMi.mjs → InvoiceHeader.vue_vue_type_script_setup_true_lang-jshby9pF.mjs} +1 -1
- package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-CNKxTtO7.js +1 -0
- package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-DBMgilG2.mjs +153 -0
- package/dist/PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-CupZFJSF.mjs +52 -0
- package/dist/PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-D6lpD1zo.js +1 -0
- package/dist/{PaymentHistoryBlock-BKMttUyk.mjs → PaymentHistoryBlock-Bxr8lUGs.mjs} +1 -1
- package/dist/{PaymentHistoryBlock-BGbTy4Se.js → PaymentHistoryBlock-COjIVYX4.js} +1 -1
- package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-Bmgx7PSt.js +1 -0
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-tM7f_fQS.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CDjGab5p.mjs} +1 -1
- package/dist/{PaymentIntegrationForm-D4QupHWl.js → PaymentIntegrationForm-BSauhuKv.js} +1 -1
- package/dist/{PaymentIntegrationForm-CypW6fZY.mjs → PaymentIntegrationForm-PIT8gHYN.mjs} +1 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-5XKz3kop.js +1 -0
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-COO2ZUhN.mjs +148 -0
- package/dist/PaymentIntegrationFormAdyen-B-Jbu2hU.js +1 -0
- package/dist/PaymentIntegrationFormAdyen-Cjj9aK0E.mjs +729 -0
- package/dist/PaymentIntegrationFormStripe-Bnn8S1o5.js +1 -0
- package/dist/PaymentIntegrationFormStripe-arpua_ZT.mjs +545 -0
- package/dist/PaymentMethodForm-B7T5rrNz.mjs +4 -0
- package/dist/PaymentMethodForm-CLz3ZS-b.js +1 -0
- package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-B8eNptZp.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-C4Zf92QP.mjs} +25 -14
- package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-UH9AVXnG.js +1 -0
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-BUTqn4Ey.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-CIIt6fGp.mjs} +77 -31
- package/dist/PaymentMethodsList.vue_vue_type_script_setup_true_lang-ifai5HVr.js +1 -0
- package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Cqk-vonA.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-DaWlLor0.mjs} +115 -68
- package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-DdUoeTUL.js +1 -0
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-CyYhYYRp.mjs +37 -0
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-DdjYVNku.js +1 -0
- package/dist/SubscriptionSummary.vue_vue_type_script_setup_true_lang-Cu55ZvCH.js +1 -0
- package/dist/SubscriptionSummary.vue_vue_type_script_setup_true_lang-z8P1u1Gi.mjs +100 -0
- package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-BKDMwuyh.js +1 -0
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DB1p61kZ.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BOUSk2ZB.mjs} +22 -119
- package/dist/adyen-BMDZQBUG.js +1 -0
- package/dist/{url-1Lbg5Yni.mjs → adyen-Ba-mF3Jy.mjs} +31 -73
- package/dist/component--Y7Igv5i.mjs +1022 -0
- package/dist/component-DIy1hvJM.js +1 -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 +4 -4
- 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 +7 -7
- package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.es.js +3 -3
- package/dist/components/InvoiceHeader/InvoiceHeader.cjs.js +1 -1
- package/dist/components/InvoiceHeader/InvoiceHeader.es.js +4 -4
- 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 +6 -6
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +7 -58
- 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 +25 -9
- package/dist/core/action-request.types.d.ts +3 -15
- package/dist/core/index.cjs.js +1 -1
- package/dist/core/index.es.js +1 -1
- package/dist/core/types.d.ts +4 -2
- package/dist/{customer-Bv_fqXzO.mjs → customer-DovIxTG1.mjs} +1 -1
- package/dist/{customer-_W8gIX5m.js → customer-brfznoHY.js} +1 -1
- package/dist/en-US-BvOHPudj.js +1 -0
- package/dist/{en-US-DAgOSlgv.mjs → en-US-CXDO3qhq.mjs} +121 -36
- package/dist/index-BMWWP8xj.js +1 -0
- package/dist/index-Do7kzLpg.mjs +265 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.es.js +7 -4
- package/dist/invoices-Cf3dSYSj.js +1 -0
- package/dist/{invoices-BGb0AwVF.mjs → invoices-Dk-z04lg.mjs} +32 -16
- package/dist/{nl-NL-DCsmrA8A.mjs → nl-NL-BgL_PuBn.mjs} +126 -40
- package/dist/nl-NL-COGUFg60.js +1 -0
- package/dist/{paymentMethods-DvqlWe96.mjs → paymentMethods-BnF1XYS1.mjs} +21 -5
- package/dist/paymentMethods-DVDC_WfL.js +1 -0
- package/dist/{payments-DMDDI3MK.js → payments-DVZFO5yb.js} +1 -1
- package/dist/{payments-CpzTVrQM.mjs → payments-TnRjtlOw.mjs} +1 -1
- package/dist/pricing-CuYndX6t.js +1 -0
- package/dist/pricing-GwLCiSzs.mjs +19 -0
- package/dist/pricingPlanSchedule-B9HFiXy-.js +1 -0
- package/dist/pricingPlanSchedule-CXG3CQ61.mjs +146 -0
- package/dist/{registry-B-If1W_u.mjs → registry-Ck0Gb6rj.mjs} +7 -4
- package/dist/registry-Cra6yoB4.js +1 -0
- package/dist/screens/Checkout/Checkout.cjs.js +1 -1
- package/dist/screens/Checkout/Checkout.es.js +429 -689
- package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.es.js +61 -39
- package/dist/screens/PayInvoice/PayInvoice.cjs.js +1 -1
- package/dist/screens/PayInvoice/PayInvoice.es.js +30 -13
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.cjs.js +1 -1
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.es.js +28 -18
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.ce.d.ts +3 -0
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.cjs.js +1 -0
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.es.js +889 -0
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.ce.d.ts +3 -0
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.cjs.js +1 -0
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.es.js +716 -0
- package/dist/solvimon-web.css +1 -1
- package/dist/subscription-C41lG-rH.mjs +89 -0
- package/dist/subscription-b0OPx8Du.js +1 -0
- package/dist/subscriptions-BFCKVHnP.js +1 -0
- package/dist/subscriptions-vEE4Y7qm.mjs +58 -0
- package/dist/{useActionDispatchProvider-Dz8-e4gZ.mjs → useActionDispatchProvider-BlEf-RZ5.mjs} +1 -1
- package/dist/{useActionDispatchProvider-BHTknMoH.js → useActionDispatchProvider-aJOy3kr1.js} +1 -1
- package/dist/{useCustomer-Z24KchWC.js → useCustomer-C1XTqmrQ.js} +1 -1
- package/dist/{useCustomer-VVJi8z2w.mjs → useCustomer-Cw8LXT6S.mjs} +2 -2
- package/dist/{useIncrementalLoading-DmOT2MXH.mjs → useIncrementalLoading-8WtKZ-mP.mjs} +2 -2
- package/dist/useIncrementalLoading-CkY2klIW.js +1 -0
- package/dist/{useInvoiceData-Bl87gzIS.js → useInvoiceData-BrxMo4Zt.js} +1 -1
- package/dist/{useInvoiceData-Di5pLPM0.mjs → useInvoiceData-Cy_ysMsq.mjs} +2 -2
- package/dist/{useInvoicesList-z19cteaD.mjs → useInvoicesList-DMsZn1tE.mjs} +4 -4
- package/dist/useInvoicesList-DmisMQzy.js +1 -0
- package/dist/{useLoadInitialData-CkpryfjF.mjs → useLoadInitialData-BP1v7qhd.mjs} +1 -1
- package/dist/{useLoadInitialData-CTqfiMTN.js → useLoadInitialData-_BjCD0Jc.js} +1 -1
- package/dist/{usePaymentMethodOptions-BoGHJjng.mjs → usePaymentMethodOptions-CWfGvW0U.mjs} +9 -3
- package/dist/{usePaymentMethodOptions-BsCZnCQW.js → usePaymentMethodOptions-xeSTmaVo.js} +1 -1
- package/dist/{usePaymentMethods-AC-4rrR9.js → usePaymentMethods-CAFMvSOr.js} +1 -1
- package/dist/{usePaymentMethods-ocHmNoP7.mjs → usePaymentMethods-Cyk4cjoE.mjs} +2 -2
- package/dist/{usePayments-CgXZeWrU.js → usePayments-BieVBaz-.js} +1 -1
- package/dist/{usePayments-D85eB5l4.mjs → usePayments-D88XSZfS.mjs} +10 -4
- package/dist/{usePortal-B1O1zgdV.mjs → usePortal-0NDlbFr9.mjs} +1 -1
- package/dist/{usePortal-DVD7PcWI.js → usePortal-B954nyEB.js} +1 -1
- package/dist/{useService-CHrkefKd.js → useService-BiljI7XA.js} +1 -1
- package/dist/{useService-DF57xuDd.mjs → useService-CqfJi5ST.mjs} +1 -1
- package/dist/useSubscription-9rJpFNUF.mjs +29 -0
- package/dist/useSubscription-k3limdu_.js +1 -0
- package/dist/vendor-ui-Dfh3_g4q.js +1 -0
- package/dist/{vendor-ui-B8IlviSs.mjs → vendor-ui-ItGf7wJV.mjs} +8006 -6329
- package/package.json +23 -9
- package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-C_uHr21N.js +0 -1
- package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DU6X3zxr.js +0 -1
- package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CixdxEGm.js +0 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BBEM-YPz.js +0 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CrGSfZZs.mjs +0 -1537
- package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-eWmC5GOT.js +0 -1
- package/dist/PaymentMethodsList.vue_vue_type_script_setup_true_lang-Be_fF-R_.js +0 -1
- package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BVoS3ZXS.js +0 -1
- package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-56vu59V4.js +0 -1
- package/dist/component-Bg2JVC_O.mjs +0 -933
- package/dist/component-Bs8oszfD.js +0 -1
- package/dist/en-US-C0gIE4Q1.js +0 -1
- package/dist/index-CzL1ZcGi.mjs +0 -85
- package/dist/index-DRdBmZ2-.js +0 -1
- package/dist/invoices-D-OKipCg.js +0 -1
- package/dist/nl-NL-Br7muSHK.js +0 -1
- package/dist/paymentMethods-DIbB759g.js +0 -1
- package/dist/registry-uG2isab0.js +0 -1
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.ce.d.ts +0 -3
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +0 -1
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +0 -1102
- package/dist/subscriptions-BPYyv09M.mjs +0 -75
- package/dist/subscriptions-CC61I6Nj.js +0 -1
- package/dist/url-B6-3PkW2.js +0 -1
- package/dist/useIncrementalLoading-CuSndpP2.js +0 -1
- package/dist/useInvoicesList-CFk-_oVK.js +0 -1
- package/dist/useWalletBalanceItems-BL-R5foK.js +0 -1
- package/dist/useWalletBalanceItems-COQDLfoZ.mjs +0 -109
- package/dist/vendor-ui-C3Tq-qY_.js +0 -1
|
@@ -0,0 +1,729 @@
|
|
|
1
|
+
import { inject, defineComponent, ref, onMounted, onBeforeUnmount, watch, openBlock, createElementBlock, Fragment, createBlock, createCommentVNode, createElementVNode } from "vue";
|
|
2
|
+
import { u as useIntl, q as isEqual } from "./vendor-ui-ItGf7wJV.mjs";
|
|
3
|
+
import { _ as _sfc_main$1, a as _sfc_main$2 } from "./PaymentErrorCard.vue_vue_type_script_setup_true_lang-DBMgilG2.mjs";
|
|
4
|
+
import { c as createPaymentsService } from "./payments-TnRjtlOw.mjs";
|
|
5
|
+
import { g as getQueryParam, t as toMinorUnitAmount, 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-Ba-mF3Jy.mjs";
|
|
6
|
+
import { c as createPaymentMethodsService } from "./paymentMethods-BnF1XYS1.mjs";
|
|
7
|
+
import { b as EXPERIMENTAL_FEATURE_INJECTION_KEY, a as useLogger } from "./component--Y7Igv5i.mjs";
|
|
8
|
+
const getOverriddenTranslations = (variant) => {
|
|
9
|
+
let result = {};
|
|
10
|
+
if (variant === "TOKENIZE") {
|
|
11
|
+
result = {
|
|
12
|
+
"en-US": {
|
|
13
|
+
payButton: "Add payment method",
|
|
14
|
+
confirmPurchase: "Add payment method"
|
|
15
|
+
},
|
|
16
|
+
"fr-FR": {
|
|
17
|
+
payButton: "Ajouter un moyen de paiement",
|
|
18
|
+
confirmPurchase: "Ajouter un moyen de paiement"
|
|
19
|
+
},
|
|
20
|
+
"de-DE": {
|
|
21
|
+
payButton: "Zahlungsmethode hinzufügen",
|
|
22
|
+
confirmPurchase: "Zahlungsmethode hinzufügen"
|
|
23
|
+
},
|
|
24
|
+
"it-IT": {
|
|
25
|
+
payButton: "Aggiungi metodo di pagamento",
|
|
26
|
+
confirmPurchase: "Aggiungi metodo di pagamento"
|
|
27
|
+
},
|
|
28
|
+
"es-ES": {
|
|
29
|
+
payButton: "Añadir método de pago",
|
|
30
|
+
confirmPurchase: "Añadir método de pago"
|
|
31
|
+
},
|
|
32
|
+
"nl-NL": {
|
|
33
|
+
payButton: "Betaalmethode toevoegen",
|
|
34
|
+
confirmPurchase: "Betaalmethode toevoegen"
|
|
35
|
+
},
|
|
36
|
+
"pt-BR": {
|
|
37
|
+
payButton: "Adicionar método de pagamento",
|
|
38
|
+
confirmPurchase: "Adicionar método de pagamento"
|
|
39
|
+
},
|
|
40
|
+
"pt-PT": {
|
|
41
|
+
payButton: "Adicionar método de pagamento",
|
|
42
|
+
confirmPurchase: "Adicionar método de pagamento"
|
|
43
|
+
},
|
|
44
|
+
"pl-PL": {
|
|
45
|
+
payButton: "Dodaj metodę płatności",
|
|
46
|
+
confirmPurchase: "Dodaj metodę płatności"
|
|
47
|
+
},
|
|
48
|
+
"ru-RU": {
|
|
49
|
+
payButton: "Добавить способ оплаты",
|
|
50
|
+
confirmPurchase: "Добавить способ оплаты"
|
|
51
|
+
},
|
|
52
|
+
"sv-SE": {
|
|
53
|
+
payButton: "Lägg till betalningsmetod",
|
|
54
|
+
confirmPurchase: "Lägg till betalningsmetod"
|
|
55
|
+
},
|
|
56
|
+
"da-DK": {
|
|
57
|
+
payButton: "Tilføj betalingsmetode",
|
|
58
|
+
confirmPurchase: "Tilføj betalingsmetode"
|
|
59
|
+
},
|
|
60
|
+
"fi-FI": {
|
|
61
|
+
payButton: "Lisää maksutapa",
|
|
62
|
+
confirmPurchase: "Lisää maksutapa"
|
|
63
|
+
},
|
|
64
|
+
"no-NO": {
|
|
65
|
+
payButton: "Legg til betalingsmetode",
|
|
66
|
+
confirmPurchase: "Legg til betalingsmetode"
|
|
67
|
+
},
|
|
68
|
+
"cs-CZ": {
|
|
69
|
+
payButton: "Přidat platební metodu",
|
|
70
|
+
confirmPurchase: "Přidat platební metodu"
|
|
71
|
+
},
|
|
72
|
+
"hu-HU": {
|
|
73
|
+
payButton: "Fizetési mód hozzáadása",
|
|
74
|
+
confirmPurchase: "Fizetési mód hozzáadása"
|
|
75
|
+
},
|
|
76
|
+
"ro-RO": {
|
|
77
|
+
payButton: "Adăugați metodă de plată",
|
|
78
|
+
confirmPurchase: "Adăugați metodă de plată"
|
|
79
|
+
},
|
|
80
|
+
"ja-JP": {
|
|
81
|
+
payButton: "支払い方法を追加",
|
|
82
|
+
confirmPurchase: "支払い方法を追加"
|
|
83
|
+
},
|
|
84
|
+
"ko-KR": {
|
|
85
|
+
payButton: "결제 수단 추가",
|
|
86
|
+
confirmPurchase: "결제 수단 추가"
|
|
87
|
+
},
|
|
88
|
+
"zh-CN": {
|
|
89
|
+
payButton: "添加支付方式",
|
|
90
|
+
confirmPurchase: "添加支付方式"
|
|
91
|
+
},
|
|
92
|
+
"zh-TW": {
|
|
93
|
+
payButton: "新增付款方式",
|
|
94
|
+
confirmPurchase: "新增付款方式"
|
|
95
|
+
},
|
|
96
|
+
ar: {
|
|
97
|
+
payButton: "إضافة وسيلة دفع",
|
|
98
|
+
confirmPurchase: "إضافة وسيلة دفع"
|
|
99
|
+
},
|
|
100
|
+
"hr-HR": {
|
|
101
|
+
payButton: "Dodajte način plačanja",
|
|
102
|
+
confirmPurchase: "Dodajte način plačanja"
|
|
103
|
+
},
|
|
104
|
+
"el-GR": {
|
|
105
|
+
payButton: "Προσθήκη μεθόδου πληρωμής",
|
|
106
|
+
confirmPurchase: "Προσθήκη μεθόδου πληρωμής"
|
|
107
|
+
},
|
|
108
|
+
"sk-SK": {
|
|
109
|
+
payButton: "Pridať spôsob platby",
|
|
110
|
+
confirmPurchase: "Pridať spôsob platby"
|
|
111
|
+
},
|
|
112
|
+
"sl-SI": {
|
|
113
|
+
payButton: "Dodajte način plačanja",
|
|
114
|
+
confirmPurchase: "Dodajte način plačanja"
|
|
115
|
+
},
|
|
116
|
+
"bg-BG": {
|
|
117
|
+
payButton: "Добавяне на начин на плащане",
|
|
118
|
+
confirmPurchase: "Добавяне на начин на плащане"
|
|
119
|
+
},
|
|
120
|
+
"ca-ES": {
|
|
121
|
+
payButton: "Afegir mètode de pagament",
|
|
122
|
+
confirmPurchase: "Afegir mètode de pagament"
|
|
123
|
+
},
|
|
124
|
+
"et-EE": {
|
|
125
|
+
payButton: "Lisa makseviis",
|
|
126
|
+
confirmPurchase: "Lisa makseviis"
|
|
127
|
+
},
|
|
128
|
+
"lv-LV": {
|
|
129
|
+
payButton: "Pievienot maksājuma veidu",
|
|
130
|
+
confirmPurchase: "Pievienot maksājuma veidu"
|
|
131
|
+
},
|
|
132
|
+
"lt-LT": {
|
|
133
|
+
payButton: "Pridėti mokėjimo metodą",
|
|
134
|
+
confirmPurchase: "Pridėti mokėjimo metodą"
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
return result;
|
|
139
|
+
};
|
|
140
|
+
const useExperimentalFeature = () => {
|
|
141
|
+
const experimentalFeature = inject(EXPERIMENTAL_FEATURE_INJECTION_KEY);
|
|
142
|
+
return experimentalFeature;
|
|
143
|
+
};
|
|
144
|
+
const EXPRESS_PAYMENT_METHOD_TYPES = ["applepay"];
|
|
145
|
+
function filterOutExpressPaymentMethods(paymentMethods) {
|
|
146
|
+
return paymentMethods.filter(
|
|
147
|
+
(method) => !EXPRESS_PAYMENT_METHOD_TYPES.some((type) => {
|
|
148
|
+
var _a;
|
|
149
|
+
return type === ((_a = method.type) == null ? void 0 : _a.toLowerCase());
|
|
150
|
+
})
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
const PAYMENT_GATEWAY_VARIANT_ADYEN = "ADYEN";
|
|
154
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
155
|
+
__name: "PaymentIntegrationFormAdyen",
|
|
156
|
+
props: {
|
|
157
|
+
countryCode: { type: String },
|
|
158
|
+
customerId: { type: String },
|
|
159
|
+
invoiceId: { type: String },
|
|
160
|
+
paymentMethodOptionResponseEntry: { type: Object },
|
|
161
|
+
variant: { type: String },
|
|
162
|
+
selected: { type: Boolean },
|
|
163
|
+
amount: { type: Object },
|
|
164
|
+
validateOnSubmit: { type: Function, default: () => Promise.resolve(true) },
|
|
165
|
+
context: { type: Object },
|
|
166
|
+
forceStorePaymentMethod: { type: Boolean }
|
|
167
|
+
},
|
|
168
|
+
emits: ["select", "payment-failed", "payment-success", "ready"],
|
|
169
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
170
|
+
let dropInInstance = null;
|
|
171
|
+
let checkoutInstance = null;
|
|
172
|
+
const props = __props;
|
|
173
|
+
const emit = __emit;
|
|
174
|
+
__expose({ submit });
|
|
175
|
+
const dropInContainerRef = ref();
|
|
176
|
+
const showPaymentSuccess = ref(false);
|
|
177
|
+
const integrationError = ref();
|
|
178
|
+
const logger = useLogger();
|
|
179
|
+
const { locale } = useIntl();
|
|
180
|
+
const { authorizePayment, getPaymentDetails } = createPaymentsService();
|
|
181
|
+
const { tokenizePaymentMethod } = createPaymentMethodsService();
|
|
182
|
+
const experimentalFeatures = useExperimentalFeature();
|
|
183
|
+
function submit() {
|
|
184
|
+
try {
|
|
185
|
+
dropInInstance == null ? void 0 : dropInInstance.submit();
|
|
186
|
+
} catch (error) {
|
|
187
|
+
logger.error("ADYEN_SUBMIT_FAILED", "Failed to submit Adyen drop-in", {}, error);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
async function getConfiguration() {
|
|
191
|
+
var _a;
|
|
192
|
+
const adyenAmount = toMinorUnitAmount(props.amount);
|
|
193
|
+
const paymentMethods = ((_a = experimentalFeatures == null ? void 0 : experimentalFeatures.value) == null ? void 0 : _a["express-checkout"]) ? filterOutExpressPaymentMethods(
|
|
194
|
+
mapAdyenPaymentMethods(props.paymentMethodOptionResponseEntry)
|
|
195
|
+
) : mapAdyenPaymentMethods(props.paymentMethodOptionResponseEntry);
|
|
196
|
+
return {
|
|
197
|
+
checkoutConfig: {
|
|
198
|
+
amount: adyenAmount,
|
|
199
|
+
clientKey: getAdyenClientKeyFromPaymentMethodOptionsResponse(
|
|
200
|
+
props.paymentMethodOptionResponseEntry
|
|
201
|
+
),
|
|
202
|
+
environment: getAdyenEnvironmentFromPaymentMethodOptionsResponse(
|
|
203
|
+
props.paymentMethodOptionResponseEntry,
|
|
204
|
+
logger
|
|
205
|
+
),
|
|
206
|
+
locale,
|
|
207
|
+
translations: getOverriddenTranslations(props.variant),
|
|
208
|
+
countryCode: props.countryCode,
|
|
209
|
+
analytics: { enabled: false },
|
|
210
|
+
paymentMethodsResponse: { paymentMethods },
|
|
211
|
+
onSubmit: handleOnSubmit,
|
|
212
|
+
onAdditionalDetails: handleOnAdditionalDetails,
|
|
213
|
+
onPaymentCompleted: handleOnPaymentCompleted,
|
|
214
|
+
onPaymentFailed: handleOnPaymentFailed,
|
|
215
|
+
onError: handleOnError,
|
|
216
|
+
showPayButton: false
|
|
217
|
+
},
|
|
218
|
+
dropInConfig: {
|
|
219
|
+
disableFinalAnimation: true,
|
|
220
|
+
paymentMethodsConfiguration: {
|
|
221
|
+
card: {
|
|
222
|
+
hasHolderName: true,
|
|
223
|
+
holderNameRequired: true,
|
|
224
|
+
enableStoreDetails: !props.forceStorePaymentMethod && props.variant === "AUTHORIZE"
|
|
225
|
+
},
|
|
226
|
+
paypal: {
|
|
227
|
+
intent: adyenAmount.value > 0 ? "authorize" : "tokenize",
|
|
228
|
+
showPayButton: true
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
openFirstPaymentMethod: props.selected,
|
|
232
|
+
onSelect: ({ props: { type } }) => {
|
|
233
|
+
if (!type) return;
|
|
234
|
+
emit("select", { paymentMethodType: type, paymentGatewayVariant: "ADYEN" });
|
|
235
|
+
},
|
|
236
|
+
onReady: () => emit("ready")
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
async function mountDropIn() {
|
|
241
|
+
if (!dropInContainerRef.value) return;
|
|
242
|
+
try {
|
|
243
|
+
await unmountDropIn();
|
|
244
|
+
const [adyenModule, { default: adyenCss }] = await Promise.all([
|
|
245
|
+
import("./index-DyvRdSR7.mjs"),
|
|
246
|
+
import("./adyen-51SvcyqV.mjs")
|
|
247
|
+
]);
|
|
248
|
+
const {
|
|
249
|
+
AdyenCheckout,
|
|
250
|
+
Dropin,
|
|
251
|
+
Card,
|
|
252
|
+
Bancontact,
|
|
253
|
+
Ach,
|
|
254
|
+
AmazonPay,
|
|
255
|
+
ApplePay,
|
|
256
|
+
BcmcMobile,
|
|
257
|
+
BacsDirectDebit,
|
|
258
|
+
CashAppPay,
|
|
259
|
+
EPS,
|
|
260
|
+
GooglePay,
|
|
261
|
+
Klarna,
|
|
262
|
+
PayByBank,
|
|
263
|
+
PayPal,
|
|
264
|
+
SepaDirectDebit,
|
|
265
|
+
Trustly,
|
|
266
|
+
Twint,
|
|
267
|
+
PayByBankUS,
|
|
268
|
+
Redirect
|
|
269
|
+
} = adyenModule;
|
|
270
|
+
const { checkoutConfig, dropInConfig } = await getConfiguration();
|
|
271
|
+
checkoutInstance = await AdyenCheckout(checkoutConfig);
|
|
272
|
+
dropInInstance = new Dropin(checkoutInstance, {
|
|
273
|
+
...dropInConfig,
|
|
274
|
+
paymentMethodComponents: [
|
|
275
|
+
Card,
|
|
276
|
+
Bancontact,
|
|
277
|
+
Ach,
|
|
278
|
+
AmazonPay,
|
|
279
|
+
ApplePay,
|
|
280
|
+
BcmcMobile,
|
|
281
|
+
BacsDirectDebit,
|
|
282
|
+
CashAppPay,
|
|
283
|
+
EPS,
|
|
284
|
+
GooglePay,
|
|
285
|
+
Klarna,
|
|
286
|
+
PayByBank,
|
|
287
|
+
PayPal,
|
|
288
|
+
SepaDirectDebit,
|
|
289
|
+
Trustly,
|
|
290
|
+
Twint,
|
|
291
|
+
PayByBankUS,
|
|
292
|
+
Redirect
|
|
293
|
+
]
|
|
294
|
+
}).mount(dropInContainerRef.value);
|
|
295
|
+
injectStylesToShadowRoot(adyenCss);
|
|
296
|
+
} catch (error) {
|
|
297
|
+
logger.error(
|
|
298
|
+
"PAYMENT_INTEGRATION_INITIALIZATION_FAILED",
|
|
299
|
+
"Failed to mount Adyen web drop-in",
|
|
300
|
+
{ error }
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
async function unmountDropIn() {
|
|
305
|
+
if (dropInInstance) {
|
|
306
|
+
dropInInstance.unmount();
|
|
307
|
+
dropInInstance = null;
|
|
308
|
+
}
|
|
309
|
+
if (dropInContainerRef.value) {
|
|
310
|
+
dropInContainerRef.value.innerHTML = "";
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
function injectStylesToShadowRoot(adyenCss) {
|
|
314
|
+
var _a;
|
|
315
|
+
const root = (_a = dropInContainerRef.value) == null ? void 0 : _a.getRootNode();
|
|
316
|
+
if (root instanceof ShadowRoot) {
|
|
317
|
+
const adyenStyle = document.createElement("style");
|
|
318
|
+
adyenStyle.textContent = adyenCss;
|
|
319
|
+
root.appendChild(adyenStyle);
|
|
320
|
+
const style = document.createElement("style");
|
|
321
|
+
style.textContent = `
|
|
322
|
+
:host {
|
|
323
|
+
--adyen-sdk-color-background-secondary: transparent;
|
|
324
|
+
--adyen-sdk-color-background-primary: rgb(243 244 246 / 0.5);
|
|
325
|
+
--adyen-sdk-color-outline-secondary: #e5e7eb;
|
|
326
|
+
--adyen-sdk-color-outline-primary: transparent;
|
|
327
|
+
--adyen-sdk-color-background-always-dark: var(--color-primary-500);
|
|
328
|
+
--adyen-sdk-color-background-inverse-primary-hover: var(--color-primary-600);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.adyen-checkout__payment-method__image__wrapper {
|
|
332
|
+
width: 32px;
|
|
333
|
+
height: 32px;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.adyen-checkout__payment-method__image {
|
|
337
|
+
height: 32px;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.adyen-checkout__input-wrapper,
|
|
341
|
+
.adyen-checkout__input {
|
|
342
|
+
border-color: rgb(229, 231, 235);
|
|
343
|
+
border-radius: var(--adyen-sdk-border-radius-s, 4px);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.adyen-checkout__button,
|
|
347
|
+
.adyen-checkout__payment-method {
|
|
348
|
+
border-radius: var(--adyen-sdk-border-radius-s, 4px);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.adyen-checkout__payment-method {
|
|
352
|
+
border-color: rgb(229, 231, 235);
|
|
353
|
+
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
354
|
+
transition: box-shadow 0.2s ease-in-out;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.adyen-checkout__payment-method--selected {
|
|
358
|
+
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.adyen-checkout__payment-method:after {
|
|
362
|
+
transform: scale(0%);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.adyen-checkout__paypal__button {
|
|
366
|
+
display: block !important;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.adyen-checkout__payment-methods-list {
|
|
370
|
+
gap: 4px;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.adyen-checkout__dropdown__list {
|
|
374
|
+
background-color: white;
|
|
375
|
+
border-radius: var(--adyen-sdk-border-radius-s, 4px);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.adyen-checkout__payment-method.adyen-checkout__payment-method--selected:after {
|
|
379
|
+
content: '✓';
|
|
380
|
+
width: 20px;
|
|
381
|
+
height: 20px;
|
|
382
|
+
border-radius: 10px;
|
|
383
|
+
background-color: var(--color-primary-600);
|
|
384
|
+
position: absolute;
|
|
385
|
+
top: 14px;
|
|
386
|
+
right: 14px;
|
|
387
|
+
text-align: center;
|
|
388
|
+
line-height: 20px;
|
|
389
|
+
color: white;
|
|
390
|
+
transform: scale(100%);
|
|
391
|
+
font-size: 12px;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.adyen-checkout__payment-method__header {
|
|
395
|
+
padding: 8px 16px !important;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.adyen-checkout__payment-method__brands {
|
|
399
|
+
align-items: center;
|
|
400
|
+
}
|
|
401
|
+
.adyen-checkout__payment-method__brand-number {
|
|
402
|
+
line-height: 1;
|
|
403
|
+
}
|
|
404
|
+
.adyen-checkout__button__text {
|
|
405
|
+
font-size: 14px;
|
|
406
|
+
}
|
|
407
|
+
.adyen-checkout__store-details {
|
|
408
|
+
background: transparent;
|
|
409
|
+
padding: 0;
|
|
410
|
+
}
|
|
411
|
+
.adyen-checkout__checkbox__input + .adyen-checkout__checkbox__label:after {
|
|
412
|
+
border-color: rgb(229, 231, 235);
|
|
413
|
+
}
|
|
414
|
+
`;
|
|
415
|
+
if (props.variant === "AUTHORIZE") {
|
|
416
|
+
style.textContent += `
|
|
417
|
+
.adyen-checkout__payment-method--cashapp .adyen-checkout-pm-details-wrapper {
|
|
418
|
+
display: none;
|
|
419
|
+
}
|
|
420
|
+
`;
|
|
421
|
+
}
|
|
422
|
+
root.appendChild(style);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
function handleOnSubmit(...args) {
|
|
426
|
+
const [state, _component, actions] = args;
|
|
427
|
+
props.validateOnSubmit().then((isValid) => {
|
|
428
|
+
if (!isValid) {
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
const paymentAcceptorId = props.paymentMethodOptionResponseEntry.payment_acceptor.id;
|
|
432
|
+
const adyen = {
|
|
433
|
+
risk_data: transformObjectToAdyenObject(state.data.riskData),
|
|
434
|
+
payment_method: transformObjectToAdyenObject(state.data.paymentMethod),
|
|
435
|
+
browser_info: transformObjectToAdyenObject(state.data.browserInfo)
|
|
436
|
+
};
|
|
437
|
+
if (props.variant === "AUTHORIZE") {
|
|
438
|
+
const returnUrl = createReturnUrl({
|
|
439
|
+
paymentAcceptorId: props.paymentMethodOptionResponseEntry.payment_acceptor.id,
|
|
440
|
+
redirectUrl: window.location.href
|
|
441
|
+
});
|
|
442
|
+
authorizePayment({
|
|
443
|
+
payment_acceptor_id: paymentAcceptorId,
|
|
444
|
+
...props.customerId ? { customer_id: props.customerId } : {},
|
|
445
|
+
payment_gateway_variant: PAYMENT_GATEWAY_VARIANT_ADYEN,
|
|
446
|
+
adyen: {
|
|
447
|
+
...adyen,
|
|
448
|
+
store_payment_method: props.forceStorePaymentMethod || state.data.storePaymentMethod
|
|
449
|
+
},
|
|
450
|
+
amount: props.amount,
|
|
451
|
+
...props.context ? { context: props.context } : {},
|
|
452
|
+
return_url: returnUrl
|
|
453
|
+
}).then((paymentResult) => {
|
|
454
|
+
const paymentMethodType = state.data.paymentMethod.type;
|
|
455
|
+
if (paymentResult.status === "ACTION_REQUIRED" && paymentResult.action.payment_gateway_variant === PAYMENT_GATEWAY_VARIANT_ADYEN) {
|
|
456
|
+
const requiredAction = handleActionRequiredPaymentAction(
|
|
457
|
+
paymentResult,
|
|
458
|
+
paymentMethodType
|
|
459
|
+
);
|
|
460
|
+
if (!requiredAction) {
|
|
461
|
+
logger.error(
|
|
462
|
+
"PAYMENT_AUTHORIZATION_FAILED",
|
|
463
|
+
`Failed payment authorization for payment acceptor with id ${paymentAcceptorId}`,
|
|
464
|
+
{ error: paymentResult }
|
|
465
|
+
);
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
dropInInstance.handleAction(requiredAction);
|
|
469
|
+
actions.resolve({
|
|
470
|
+
resultCode: paymentResult.action.adyen.result_code,
|
|
471
|
+
action: requiredAction
|
|
472
|
+
});
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
if (paymentResult.payment.result === "AUTHORIZED") {
|
|
476
|
+
showPaymentSuccess.value = true;
|
|
477
|
+
actions.resolve({ resultCode: "Authorised" });
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
logger.error(
|
|
481
|
+
"PAYMENT_AUTHORIZATION_FAILED",
|
|
482
|
+
`Failed payment authorization for payment acceptor with id ${paymentAcceptorId}`,
|
|
483
|
+
{ error: paymentResult }
|
|
484
|
+
);
|
|
485
|
+
actions.resolve({ resultCode: "Error" });
|
|
486
|
+
}).catch((error) => {
|
|
487
|
+
logger.error(
|
|
488
|
+
"PAYMENT_AUTHORIZATION_FAILED",
|
|
489
|
+
`Failed payment authorization for payment acceptor with id ${paymentAcceptorId}`,
|
|
490
|
+
{ error }
|
|
491
|
+
);
|
|
492
|
+
actions.resolve({ resultCode: "Error" });
|
|
493
|
+
});
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
if (props.variant === "TOKENIZE") {
|
|
497
|
+
const returnUrl = createReturnUrl({
|
|
498
|
+
paymentAcceptorId: props.paymentMethodOptionResponseEntry.payment_acceptor.id,
|
|
499
|
+
redirectUrl: window.location.href
|
|
500
|
+
});
|
|
501
|
+
if (!props.customerId) {
|
|
502
|
+
logger.error(
|
|
503
|
+
"TOKENIZATION_FAILED",
|
|
504
|
+
`Missing customer id for payment acceptor with id ${paymentAcceptorId}`
|
|
505
|
+
);
|
|
506
|
+
return;
|
|
507
|
+
}
|
|
508
|
+
tokenizePaymentMethod({
|
|
509
|
+
customer_id: props.customerId,
|
|
510
|
+
payment_acceptor_id: paymentAcceptorId,
|
|
511
|
+
payment_gateway_variant: PAYMENT_GATEWAY_VARIANT_ADYEN,
|
|
512
|
+
adyen,
|
|
513
|
+
return_url: returnUrl
|
|
514
|
+
}).then((paymentResult) => {
|
|
515
|
+
const paymentMethodType = state.data.paymentMethod.type;
|
|
516
|
+
if (paymentResult.status === "ACTION_REQUIRED" && paymentResult.action.payment_gateway_variant === PAYMENT_GATEWAY_VARIANT_ADYEN) {
|
|
517
|
+
const requiredAction = handleActionRequiredPaymentAction(
|
|
518
|
+
paymentResult,
|
|
519
|
+
paymentMethodType
|
|
520
|
+
);
|
|
521
|
+
if (!requiredAction) {
|
|
522
|
+
logger.error(
|
|
523
|
+
"TOKENIZATION_FAILED",
|
|
524
|
+
`Tokenization failed for payment acceptor with id ${paymentAcceptorId}`,
|
|
525
|
+
{ error: paymentResult }
|
|
526
|
+
);
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
dropInInstance.handleAction(requiredAction);
|
|
530
|
+
actions.resolve({
|
|
531
|
+
resultCode: paymentResult.action.adyen.result_code,
|
|
532
|
+
action: requiredAction
|
|
533
|
+
});
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
if (paymentResult.payment.result === "AUTHORIZED") {
|
|
537
|
+
showPaymentSuccess.value = true;
|
|
538
|
+
actions.resolve({ resultCode: "Authorised" });
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
logger.error(
|
|
542
|
+
"TOKENIZATION_FAILED",
|
|
543
|
+
`Tokenization failed for payment acceptor with id ${paymentAcceptorId}`,
|
|
544
|
+
{ error: paymentResult }
|
|
545
|
+
);
|
|
546
|
+
actions.resolve({ resultCode: "Error" });
|
|
547
|
+
}).catch((error) => {
|
|
548
|
+
logger.error(
|
|
549
|
+
"TOKENIZATION_FAILED",
|
|
550
|
+
`Tokenization failed for payment acceptor with id ${paymentAcceptorId}`,
|
|
551
|
+
{ error }
|
|
552
|
+
);
|
|
553
|
+
actions.resolve({ resultCode: "Error" });
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
}).catch((error) => {
|
|
557
|
+
logger.error(
|
|
558
|
+
"INTEGRATION_ERROR",
|
|
559
|
+
"Unhandled error in payment submission flow",
|
|
560
|
+
{},
|
|
561
|
+
error
|
|
562
|
+
);
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
function handleActionRequiredPaymentAction(response, paymentMethodType) {
|
|
566
|
+
if (response.status !== "ACTION_REQUIRED") {
|
|
567
|
+
return void 0;
|
|
568
|
+
}
|
|
569
|
+
const action = response.action;
|
|
570
|
+
if (action.payment_gateway_variant != "ADYEN") {
|
|
571
|
+
return void 0;
|
|
572
|
+
}
|
|
573
|
+
const adyenRequiredAction = action.adyen;
|
|
574
|
+
return {
|
|
575
|
+
paymentMethodType: (adyenRequiredAction == null ? void 0 : adyenRequiredAction.payment_method_type) ?? paymentMethodType,
|
|
576
|
+
method: action.method,
|
|
577
|
+
url: action.url,
|
|
578
|
+
data: action.data,
|
|
579
|
+
type: adyenRequiredAction == null ? void 0 : adyenRequiredAction.action_type,
|
|
580
|
+
paymentData: adyenRequiredAction == null ? void 0 : adyenRequiredAction.payment_data,
|
|
581
|
+
sdkData: adyenRequiredAction == null ? void 0 : adyenRequiredAction.sdk_data
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
function handleOnAdditionalDetails(...args) {
|
|
585
|
+
const [state] = args;
|
|
586
|
+
const detailsResult = state.data.details;
|
|
587
|
+
const paymentDataResult = state.data.paymentData;
|
|
588
|
+
if (props.paymentMethodOptionResponseEntry.payment_acceptor.id) {
|
|
589
|
+
handlePaymentDetails({
|
|
590
|
+
// For the moment: Adyen gives a null value back which is not accepted by Solvimon API, so filter that out
|
|
591
|
+
detailsResult: detailsResult ? removeEmptyValues(detailsResult) : void 0,
|
|
592
|
+
paymentDataResult,
|
|
593
|
+
paymentAcceptorId: props.paymentMethodOptionResponseEntry.payment_acceptor.id
|
|
594
|
+
});
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
const error = {
|
|
598
|
+
code: "UNKNOWN_ERROR",
|
|
599
|
+
message: "Payment failed",
|
|
600
|
+
error: args
|
|
601
|
+
};
|
|
602
|
+
emit("payment-failed", error);
|
|
603
|
+
integrationError.value = error;
|
|
604
|
+
}
|
|
605
|
+
function removeEmptyValues(obj) {
|
|
606
|
+
return Object.fromEntries(
|
|
607
|
+
Object.entries(obj).filter(([, value]) => value !== null && value !== void 0)
|
|
608
|
+
);
|
|
609
|
+
}
|
|
610
|
+
function handleOnPaymentFailed(...args) {
|
|
611
|
+
const [data] = args;
|
|
612
|
+
const error = {
|
|
613
|
+
code: "UNKNOWN_ERROR",
|
|
614
|
+
message: "Payment failed",
|
|
615
|
+
error: data
|
|
616
|
+
};
|
|
617
|
+
emit("payment-failed", error);
|
|
618
|
+
integrationError.value = error;
|
|
619
|
+
}
|
|
620
|
+
function handleOnPaymentCompleted(...args) {
|
|
621
|
+
const [, component] = args;
|
|
622
|
+
component == null ? void 0 : component.unmount();
|
|
623
|
+
emit("payment-success");
|
|
624
|
+
}
|
|
625
|
+
function handleOnError(...args) {
|
|
626
|
+
const [data, component] = args;
|
|
627
|
+
if (data.name === "CANCEL") {
|
|
628
|
+
return;
|
|
629
|
+
}
|
|
630
|
+
const error = {
|
|
631
|
+
code: "UNKNOWN_ERROR",
|
|
632
|
+
message: "Something went wrong",
|
|
633
|
+
error: data
|
|
634
|
+
};
|
|
635
|
+
logger.error("INTEGRATION_ERROR", "Something went wrong", { error: data });
|
|
636
|
+
integrationError.value = error;
|
|
637
|
+
component == null ? void 0 : component.unmount();
|
|
638
|
+
}
|
|
639
|
+
function handlePaymentDetails({
|
|
640
|
+
detailsResult,
|
|
641
|
+
threeDSResult,
|
|
642
|
+
redirectResult,
|
|
643
|
+
paymentDataResult,
|
|
644
|
+
paymentAcceptorId
|
|
645
|
+
}) {
|
|
646
|
+
getPaymentDetails({
|
|
647
|
+
paymentAcceptorId,
|
|
648
|
+
paymentGatewayVariant: PAYMENT_GATEWAY_VARIANT_ADYEN,
|
|
649
|
+
adyen: {
|
|
650
|
+
...detailsResult ? { details: detailsResult } : {},
|
|
651
|
+
...redirectResult ? { redirect_result: redirectResult } : {},
|
|
652
|
+
...threeDSResult ? { threeds_result: threeDSResult } : {},
|
|
653
|
+
...paymentDataResult ? { payment_data: paymentDataResult } : {}
|
|
654
|
+
}
|
|
655
|
+
}).then((result) => {
|
|
656
|
+
if (result.payment_status === "FAILURE") {
|
|
657
|
+
emit("payment-failed", {
|
|
658
|
+
code: "UNKNOWN_ERROR",
|
|
659
|
+
message: "Failed getting payment details",
|
|
660
|
+
error: result
|
|
661
|
+
});
|
|
662
|
+
return;
|
|
663
|
+
}
|
|
664
|
+
if (result.payment_status === "SUCCESS") {
|
|
665
|
+
emit("payment-success");
|
|
666
|
+
return;
|
|
667
|
+
}
|
|
668
|
+
}).catch((error) => {
|
|
669
|
+
logger.error("PAYMENT_DETAILS_CALL_FAILED", "Failed fetching payment details", {
|
|
670
|
+
error
|
|
671
|
+
});
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
function handleRedirectResult() {
|
|
675
|
+
const redirectResult = getQueryParam(REDIRECT_RESULT_QUERY_STRING);
|
|
676
|
+
const paymentAcceptorId = getQueryParam(PAYMENT_ACCEPTOR_ID_QUERY_STRING);
|
|
677
|
+
if (!redirectResult) {
|
|
678
|
+
return;
|
|
679
|
+
}
|
|
680
|
+
if (!paymentAcceptorId) {
|
|
681
|
+
logger.error(
|
|
682
|
+
"INVALID_REDIRECT_RESULT",
|
|
683
|
+
"Redirect result is set but payment acceptor id is missing",
|
|
684
|
+
{ context: { redirectResult } }
|
|
685
|
+
);
|
|
686
|
+
return;
|
|
687
|
+
}
|
|
688
|
+
handlePaymentDetails({
|
|
689
|
+
paymentAcceptorId,
|
|
690
|
+
detailsResult: {
|
|
691
|
+
redirectResult: decodeURI(redirectResult)
|
|
692
|
+
}
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
onMounted(() => {
|
|
696
|
+
void mountDropIn();
|
|
697
|
+
handleRedirectResult();
|
|
698
|
+
});
|
|
699
|
+
onBeforeUnmount(() => {
|
|
700
|
+
void unmountDropIn();
|
|
701
|
+
});
|
|
702
|
+
watch(
|
|
703
|
+
() => props.paymentMethodOptionResponseEntry,
|
|
704
|
+
(newValue, oldValue) => {
|
|
705
|
+
if (isEqual(newValue, oldValue)) return;
|
|
706
|
+
void mountDropIn();
|
|
707
|
+
},
|
|
708
|
+
{ deep: true }
|
|
709
|
+
);
|
|
710
|
+
return (_ctx, _cache) => {
|
|
711
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
712
|
+
showPaymentSuccess.value ? (openBlock(), createBlock(_sfc_main$1, {
|
|
713
|
+
key: 0,
|
|
714
|
+
variant: __props.variant
|
|
715
|
+
}, null, 8, ["variant"])) : integrationError.value ? (openBlock(), createBlock(_sfc_main$2, {
|
|
716
|
+
key: 1,
|
|
717
|
+
error: integrationError.value
|
|
718
|
+
}, null, 8, ["error"])) : createCommentVNode("", true),
|
|
719
|
+
createElementVNode("div", {
|
|
720
|
+
ref_key: "dropInContainerRef",
|
|
721
|
+
ref: dropInContainerRef
|
|
722
|
+
}, null, 512)
|
|
723
|
+
], 64);
|
|
724
|
+
};
|
|
725
|
+
}
|
|
726
|
+
});
|
|
727
|
+
export {
|
|
728
|
+
_sfc_main as default
|
|
729
|
+
};
|