@solvimon/solvimon-web 0.1.0-alpha.6 → 0.1.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/dist/Alert.vue.es-DMPvSykx.js +1 -0
  2. package/dist/Alert.vue.es-DsJ1ckRU.mjs +172 -0
  3. package/dist/Amount.vue.es-C6JE5rL8.mjs +23 -0
  4. package/dist/Amount.vue.es-h8wulbBG.js +1 -0
  5. package/dist/Avatar.vue.es-Ba8ZGfm4.mjs +93 -0
  6. package/dist/Avatar.vue.es-BbyE0AjW.js +1 -0
  7. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-C4Ndo83E.js +1 -0
  8. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-DZ1XkSJ3.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-CupcH8TZ.mjs} +6 -4
  9. package/dist/Button.vue.es-6sBk5tBL.mjs +408 -0
  10. package/dist/Button.vue.es-BC4_TItq.js +1 -0
  11. package/dist/CardContent.vue.es-ChEMrFCc.mjs +115 -0
  12. package/dist/CardContent.vue.es-i9ivuGKG.js +1 -0
  13. package/dist/Chip.vue.es-D0fkSe8a.js +1 -0
  14. package/dist/Chip.vue.es-DcW2CjUA.mjs +1576 -0
  15. package/dist/Comparators.vue.es-BdxDqU8o.js +1 -0
  16. package/dist/Comparators.vue.es-DdTKGB80.mjs +406 -0
  17. package/dist/{ContentWithAsideLayout-D_T137tN.mjs → ContentWithAsideLayout-Ct24RV-2.mjs} +1 -1
  18. package/dist/{ContentWithAsideLayout-BZJPhvLh.js → ContentWithAsideLayout-UHovpjZu.js} +1 -1
  19. package/dist/CustomerBillingInformation.vue.es-9rP7-RzN.js +1 -0
  20. package/dist/CustomerBillingInformation.vue.es-DBMl01Es.mjs +175 -0
  21. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CYTCcMgP.js +1 -0
  22. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DK6tiecN.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DZJ0xukI.mjs} +14 -11
  23. package/dist/Divider.vue.es-ClFG8QtG.js +1 -0
  24. package/dist/Divider.vue.es-wKkIVBgb.mjs +24 -0
  25. package/dist/DividerText.vue.es-B7oa5Xpn.mjs +72 -0
  26. package/dist/DividerText.vue.es-yiFdPQvo.js +1 -0
  27. package/dist/ErrorNotification.vue.es-Bgw0MIl8.mjs +30 -0
  28. package/dist/ErrorNotification.vue.es-FpRyg0De.js +1 -0
  29. package/dist/FormMessage.vue.es-DFQXxiSC.mjs +46 -0
  30. package/dist/FormMessage.vue.es-LeWoj774.js +1 -0
  31. package/dist/IconButton.vue.es-DNCwwH_j.mjs +825 -0
  32. package/dist/IconButton.vue.es-DiSiGPWO.js +1 -0
  33. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BDitcx8B.js +1 -0
  34. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BWXmZmGZ.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DsrBsrtk.mjs} +3 -2
  35. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-6yi47YWd.js +1 -0
  36. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BSn_Zy0Y.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BnKwmJ2s.mjs} +9 -5
  37. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BE1lWOk9.mjs +1067 -0
  38. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CC3hm3nx.js +1 -0
  39. package/dist/PaymentMethod.vue.es-DYlnmZh7.js +1 -0
  40. package/dist/PaymentMethod.vue.es-nXZoQjG3.mjs +1255 -0
  41. package/dist/{PricingGroupContent.vue_vue_type_script_setup_true_lang-X7-dfeZP.mjs → PricingGroupContent.vue_vue_type_script_setup_true_lang-BbvDXvIS.mjs} +6 -5
  42. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-CmQILA3q.js +1 -0
  43. package/dist/Section.vue.es-3-H1pUTB.mjs +79 -0
  44. package/dist/Section.vue.es-BuzTXRLP.js +1 -0
  45. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-AxYjVFUM.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-DVhJy0t8.mjs} +23 -20
  46. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-Pq3d7DTb.js +1 -0
  47. package/dist/TooltipParagraph.vue.es-DVJLF9Kv.mjs +136 -0
  48. package/dist/TooltipParagraph.vue.es-kTbRGoPF.js +1 -0
  49. package/dist/TrialChip.vue.es-BHYbW8b6.mjs +759 -0
  50. package/dist/TrialChip.vue.es-C6Xg_5rR.js +1 -0
  51. package/dist/_flatRest.es-BHFPCqZh.mjs +642 -0
  52. package/dist/_flatRest.es-dFffnTpX.js +1 -0
  53. package/dist/adyen-51SvcyqV.mjs +4 -0
  54. package/dist/adyen-DZsyEXkw.js +1 -0
  55. package/dist/api.es-B4qAAJKr.js +1 -0
  56. package/dist/api.es-UkfpLiLL.mjs +83 -0
  57. package/dist/{cloneDeep-DranHQkY.js → cloneDeep-Hs8Pp07F.js} +1 -1
  58. package/dist/cn.es-C7xoIs3C.js +1 -0
  59. package/dist/cn.es-tfxVlz02.mjs +3191 -0
  60. package/dist/component-ZRZIt3ZW.js +1 -0
  61. package/dist/component-dpA83LIN.mjs +6569 -0
  62. package/dist/components/BillingInformation/BillingInformation.ce.d.ts +1 -1
  63. package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
  64. package/dist/components/BillingInformation/BillingInformation.es.js +14 -10
  65. package/dist/components/BillingInformationForm/BillingInformationForm.ce.d.ts +1 -1
  66. package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
  67. package/dist/components/BillingInformationForm/BillingInformationForm.es.js +27 -23
  68. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.ce.d.ts +1 -1
  69. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
  70. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +3 -3
  71. package/dist/components/Invoice/Invoice.ce.d.ts +1 -1
  72. package/dist/components/Invoice/Invoice.cjs.js +1 -1
  73. package/dist/components/Invoice/Invoice.es.js +2612 -28
  74. package/dist/components/InvoiceDetails/InvoiceDetails.ce.d.ts +1 -1
  75. package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
  76. package/dist/components/InvoiceDetails/InvoiceDetails.es.js +3 -3
  77. package/dist/components/InvoicesList/InvoicesList.ce.d.ts +1 -1
  78. package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
  79. package/dist/components/InvoicesList/InvoicesList.es.js +2 -2
  80. package/dist/components/PaymentHistory/PaymentHistory.ce.d.ts +1 -1
  81. package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
  82. package/dist/components/PaymentHistory/PaymentHistory.es.js +3 -3
  83. package/dist/components/PaymentMethodForm/PaymentMethodForm.ce.d.ts +1 -1
  84. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
  85. package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +10 -8
  86. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.ce.d.ts +1 -1
  87. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
  88. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +4820 -7
  89. package/dist/components/SubscriptionsList/SubscriptionsList.ce.d.ts +1 -1
  90. package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
  91. package/dist/components/SubscriptionsList/SubscriptionsList.es.js +4 -4
  92. package/dist/components/WalletBalances/WalletBalances.ce.d.ts +1 -1
  93. package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
  94. package/dist/components/WalletBalances/WalletBalances.es.js +2 -2
  95. package/dist/core/index.cjs.js +1 -1
  96. package/dist/core/index.es.js +1 -1
  97. package/dist/countryData.es--zJAd6LA.mjs +252 -0
  98. package/dist/countryData.es-D3MFzU92.js +1 -0
  99. package/dist/customer-CJrpbGX4.mjs +32 -0
  100. package/dist/customer-CcQR-JIm.js +1 -0
  101. package/dist/customer.es-D42Md24r.js +1 -0
  102. package/dist/customer.es-LIW2YmLL.mjs +30 -0
  103. package/dist/formatting.es-9hM8aHSg.js +1 -0
  104. package/dist/formatting.es-D5H_ySFv.mjs +68 -0
  105. package/dist/getCountryNameByCode.es-fP52nO_7.js +1 -0
  106. package/dist/getCountryNameByCode.es-ymC9R46j.mjs +8 -0
  107. package/dist/index-CI71bVGE.mjs +2521 -0
  108. package/dist/index-WLSPwi90.js +1 -0
  109. package/dist/index.cjs.js +1 -1
  110. package/dist/index.es-BBJF2O2l.js +1 -0
  111. package/dist/index.es-LCAKs4tH.mjs +438 -0
  112. package/dist/index.es.js +1 -1
  113. package/dist/invoices-3kVHsAXr.js +1 -0
  114. package/dist/{invoices-C7BHqB0g.mjs → invoices-CNK1Ushv.mjs} +15 -1
  115. package/dist/isEmpty.es-Bp1SbWFu.mjs +131 -0
  116. package/dist/isEmpty.es-Dycf-CD_.js +1 -0
  117. package/dist/{paymentMethods-BA7Kt8ti.mjs → paymentMethods-C-ApE-G4.mjs} +2 -1
  118. package/dist/paymentMethods-DZRf0WRl.js +1 -0
  119. package/dist/{payments-NTHUh5je.mjs → payments-CE9U7aKK.mjs} +1 -1
  120. package/dist/{payments-B8W0W6wZ.js → payments-CLt0SExf.js} +1 -1
  121. package/dist/pick.es-BgDAfhAl.js +1 -0
  122. package/dist/pick.es-DdVOyp0Q.mjs +45 -0
  123. package/dist/{registry-DgRnFEVF.mjs → registry-B99ZnfEn.mjs} +1 -2
  124. package/dist/registry-ClZ43bQn.js +1 -0
  125. package/dist/screens/Checkout/Checkout.ce.d.ts +1 -1
  126. package/dist/screens/Checkout/Checkout.cjs.js +1 -1
  127. package/dist/screens/Checkout/Checkout.es.js +1862 -162
  128. package/dist/screens/CustomerOverview/CustomerOverview.ce.d.ts +1 -1
  129. package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
  130. package/dist/screens/CustomerOverview/CustomerOverview.es.js +11 -11
  131. package/dist/screens/UpgradeSubscription/UpgradeSubscription.ce.d.ts +1 -1
  132. package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -1
  133. package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +46 -40
  134. package/dist/solvimon-web.css +1 -1
  135. package/dist/subscriptions-CS8HTxzC.js +1 -0
  136. package/dist/{subscriptions-BEoXaAHw.mjs → subscriptions-CoeCrY1I.mjs} +2 -1
  137. package/dist/typeGuards.es-C4nR5FkL.js +1 -0
  138. package/dist/typeGuards.es-fwUoeMCe.mjs +12 -0
  139. package/dist/{useActionDispatchProvider-DmTJ_bqE.js → useActionDispatchProvider-CWVV_xsi.js} +1 -1
  140. package/dist/{useActionDispatchProvider-zSXRlc2S.mjs → useActionDispatchProvider-eO2qFPGv.mjs} +1 -1
  141. package/dist/useCustomer--jycAz--.mjs +25 -0
  142. package/dist/useCustomer-PthyTFLl.js +1 -0
  143. package/dist/useIncrementalLoading-CAdNW-Bf.js +1 -0
  144. package/dist/{useIncrementalLoading-Bgs0mqyb.mjs → useIncrementalLoading-CcnL3flF.mjs} +5 -1
  145. package/dist/{useInvoiceData-B6P2VShe.mjs → useInvoiceData-BiMMoVoW.mjs} +2 -2
  146. package/dist/{useInvoiceData-CS7hLTea.js → useInvoiceData-DvQO_nKz.js} +1 -1
  147. package/dist/useInvoicesList-CHkwSNO9.js +1 -0
  148. package/dist/{useInvoicesList-23Ra-23Z.mjs → useInvoicesList-DFhF_gp7.mjs} +260 -23
  149. package/dist/{usePaymentMethods-BK4unvj2.js → usePaymentMethods-BRQ7-dUr.js} +1 -1
  150. package/dist/{usePaymentMethods-B8Nft16c.mjs → usePaymentMethods-BX2RnHZN.mjs} +2 -2
  151. package/dist/{useService-D-CUtlp3.js → useService-B67YWAcN.js} +1 -1
  152. package/dist/{useService-B4qv5N2D.mjs → useService-DG_zedHV.mjs} +1 -0
  153. package/dist/useWalletBalanceItems-B5FMmoU2.mjs +308 -0
  154. package/dist/useWalletBalanceItems-BY3gq0fc.js +1 -0
  155. package/package.json +14 -8
  156. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-eRGZRjmq.js +0 -1
  157. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BvmKLc2H.js +0 -1
  158. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DNWspHtC.js +0 -1
  159. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-Cx4c8E4i.js +0 -1
  160. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Ct26TY0a.js +0 -1
  161. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-WRXecMCj.mjs +0 -6568
  162. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-KnhKv07X.js +0 -1
  163. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-D9_G7CyE.js +0 -1
  164. package/dist/component-DI3AxwdD.mjs +0 -58733
  165. package/dist/component-yWF07boR.js +0 -1
  166. package/dist/index-CzL1ZcGi.mjs +0 -85
  167. package/dist/index-DRdBmZ2-.js +0 -1
  168. package/dist/invoices-CjBHfDXp.js +0 -1
  169. package/dist/paymentMethods-A-5SBmy1.js +0 -1
  170. package/dist/registry-SwmYGFn7.js +0 -1
  171. package/dist/subscriptions-DSi93KpN.js +0 -1
  172. package/dist/useCustomer-DkrBNt5f.mjs +0 -45
  173. package/dist/useCustomer-fK-w7ifj.js +0 -1
  174. package/dist/useIncrementalLoading-BK6N8sYW.js +0 -1
  175. package/dist/useInvoicesList-CIFGVsDj.js +0 -1
  176. package/dist/useWalletBalanceItems-DreHuOra.mjs +0 -105
  177. package/dist/useWalletBalanceItems-NlFk6jPD.js +0 -1
  178. /package/dist/{sprite-DZD704h3-CCc3Mz1x.js → sprite.svg.es-CCc3Mz1x.js} +0 -0
  179. /package/dist/{sprite-DZD704h3-DZD704h3.mjs → sprite.svg.es-DZD704h3.mjs} +0 -0
@@ -0,0 +1,1067 @@
1
+ import { defineComponent, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode, normalizeClass, createTextVNode, toDisplayString, renderSlot, createCommentVNode, computed, inject, ref, onMounted, onBeforeUnmount, watch, createElementBlock, Fragment, renderList } from "vue";
2
+ import { _ as _sfc_main$7, a as useIntl, t as trackSentryException, E as EXPERIMENTAL_FEATURE_INJECTION_KEY, L as LOGGER_PROVIDER_INJECTION_KEY } from "./component-dpA83LIN.mjs";
3
+ import { _ as _sfc_main$9 } from "./FormMessage.vue.es-DFQXxiSC.mjs";
4
+ import { a as formatAmount } from "./formatting.es-D5H_ySFv.mjs";
5
+ import { a as _sfc_main$6, _ as _sfc_main$8 } from "./Button.vue.es-6sBk5tBL.mjs";
6
+ import { _ as _sfc_main$5 } from "./Section.vue.es-3-H1pUTB.mjs";
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";
10
+ const getOverriddenTranslations = (variant) => {
11
+ let result = {};
12
+ if (variant === "TOKENIZE") {
13
+ result = {
14
+ "en-US": {
15
+ payButton: "Add payment method",
16
+ confirmPurchase: "Add payment method"
17
+ },
18
+ "fr-FR": {
19
+ payButton: "Ajouter un moyen de paiement",
20
+ confirmPurchase: "Ajouter un moyen de paiement"
21
+ },
22
+ "de-DE": {
23
+ payButton: "Zahlungsmethode hinzufügen",
24
+ confirmPurchase: "Zahlungsmethode hinzufügen"
25
+ },
26
+ "it-IT": {
27
+ payButton: "Aggiungi metodo di pagamento",
28
+ confirmPurchase: "Aggiungi metodo di pagamento"
29
+ },
30
+ "es-ES": {
31
+ payButton: "Añadir método de pago",
32
+ confirmPurchase: "Añadir método de pago"
33
+ },
34
+ "nl-NL": {
35
+ payButton: "Betaalmethode toevoegen",
36
+ confirmPurchase: "Betaalmethode toevoegen"
37
+ },
38
+ "pt-BR": {
39
+ payButton: "Adicionar método de pagamento",
40
+ confirmPurchase: "Adicionar método de pagamento"
41
+ },
42
+ "pt-PT": {
43
+ payButton: "Adicionar método de pagamento",
44
+ confirmPurchase: "Adicionar método de pagamento"
45
+ },
46
+ "pl-PL": {
47
+ payButton: "Dodaj metodę płatności",
48
+ confirmPurchase: "Dodaj metodę płatności"
49
+ },
50
+ "ru-RU": {
51
+ payButton: "Добавить способ оплаты",
52
+ confirmPurchase: "Добавить способ оплаты"
53
+ },
54
+ "sv-SE": {
55
+ payButton: "Lägg till betalningsmetod",
56
+ confirmPurchase: "Lägg till betalningsmetod"
57
+ },
58
+ "da-DK": {
59
+ payButton: "Tilføj betalingsmetode",
60
+ confirmPurchase: "Tilføj betalingsmetode"
61
+ },
62
+ "fi-FI": {
63
+ payButton: "Lisää maksutapa",
64
+ confirmPurchase: "Lisää maksutapa"
65
+ },
66
+ "no-NO": {
67
+ payButton: "Legg til betalingsmetode",
68
+ confirmPurchase: "Legg til betalingsmetode"
69
+ },
70
+ "cs-CZ": {
71
+ payButton: "Přidat platební metodu",
72
+ confirmPurchase: "Přidat platební metodu"
73
+ },
74
+ "hu-HU": {
75
+ payButton: "Fizetési mód hozzáadása",
76
+ confirmPurchase: "Fizetési mód hozzáadása"
77
+ },
78
+ "ro-RO": {
79
+ payButton: "Adăugați metodă de plată",
80
+ confirmPurchase: "Adăugați metodă de plată"
81
+ },
82
+ "ja-JP": {
83
+ payButton: "支払い方法を追加",
84
+ confirmPurchase: "支払い方法を追加"
85
+ },
86
+ "ko-KR": {
87
+ payButton: "결제 수단 추가",
88
+ confirmPurchase: "결제 수단 추가"
89
+ },
90
+ "zh-CN": {
91
+ payButton: "添加支付方式",
92
+ confirmPurchase: "添加支付方式"
93
+ },
94
+ "zh-TW": {
95
+ payButton: "新增付款方式",
96
+ confirmPurchase: "新增付款方式"
97
+ },
98
+ ar: {
99
+ payButton: "إضافة وسيلة دفع",
100
+ confirmPurchase: "إضافة وسيلة دفع"
101
+ },
102
+ "hr-HR": {
103
+ payButton: "Dodajte način plačanja",
104
+ confirmPurchase: "Dodajte način plačanja"
105
+ },
106
+ "el-GR": {
107
+ payButton: "Προσθήκη μεθόδου πληρωμής",
108
+ confirmPurchase: "Προσθήκη μεθόδου πληρωμής"
109
+ },
110
+ "sk-SK": {
111
+ payButton: "Pridať spôsob platby",
112
+ confirmPurchase: "Pridať spôsob platby"
113
+ },
114
+ "sl-SI": {
115
+ payButton: "Dodajte način plačanja",
116
+ confirmPurchase: "Dodajte način plačanja"
117
+ },
118
+ "bg-BG": {
119
+ payButton: "Добавяне на начин на плащане",
120
+ confirmPurchase: "Добавяне на начин на плащане"
121
+ },
122
+ "ca-ES": {
123
+ payButton: "Afegir mètode de pagament",
124
+ confirmPurchase: "Afegir mètode de pagament"
125
+ },
126
+ "et-EE": {
127
+ payButton: "Lisa makseviis",
128
+ confirmPurchase: "Lisa makseviis"
129
+ },
130
+ "lv-LV": {
131
+ payButton: "Pievienot maksājuma veidu",
132
+ confirmPurchase: "Pievienot maksājuma veidu"
133
+ },
134
+ "lt-LT": {
135
+ payButton: "Pridėti mokėjimo metodą",
136
+ confirmPurchase: "Pridėti mokėjimo metodą"
137
+ }
138
+ };
139
+ }
140
+ return result;
141
+ };
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
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
190
+ __name: "PaymentCompletedCard",
191
+ props: {
192
+ amount: { type: Object },
193
+ variant: { type: String }
194
+ },
195
+ setup(__props) {
196
+ const props = __props;
197
+ const { $t } = useIntl();
198
+ const title = computed(
199
+ () => props.variant === "AUTHORIZE" ? $t({
200
+ defaultMessage: "Payment successful",
201
+ description: "The title for when a payment has been successful",
202
+ id: "payment_completed_card.title.authorize"
203
+ }) : $t({
204
+ defaultMessage: "Your payment method is added",
205
+ description: "The title for when a payment method was successfully added",
206
+ id: "payment_completed_card.title.tokenize"
207
+ })
208
+ );
209
+ return (_ctx, _cache) => {
210
+ return openBlock(), createBlock(_sfc_main$4, {
211
+ status: "success",
212
+ title: title.value
213
+ }, {
214
+ default: withCtx(() => [
215
+ __props.amount ? (openBlock(), createBlock(unref(_sfc_main$7), {
216
+ key: 0,
217
+ variant: "body-sm",
218
+ class: "mt-1"
219
+ }, {
220
+ default: withCtx(() => [
221
+ createVNode(unref(_sfc_main$6), { icon: "check" }),
222
+ createTextVNode(toDisplayString(unref(formatAmount)(__props.amount)), 1)
223
+ ]),
224
+ _: 1
225
+ })) : createCommentVNode("", true),
226
+ createVNode(unref(_sfc_main$7), {
227
+ variant: "body-xs",
228
+ shade: "lighter"
229
+ }, {
230
+ default: withCtx(() => [
231
+ createTextVNode(toDisplayString(unref($t)({
232
+ defaultMessage: "You are being redirected...",
233
+ description: "The text shown after a successful message before a redirect",
234
+ id: "payment_completed_card.redirect_message"
235
+ })), 1)
236
+ ]),
237
+ _: 1
238
+ })
239
+ ]),
240
+ _: 1
241
+ }, 8, ["title"]);
242
+ };
243
+ }
244
+ });
245
+ const ErrorMap = {
246
+ UNKNOWN_ERROR: {
247
+ title: "Something went wrong",
248
+ message: "An unknown error has occurred",
249
+ isReloadButtonVisible: true
250
+ },
251
+ AUTHORIZATION_FAILED: {
252
+ title: "Payment failed",
253
+ message: "The payment failed"
254
+ },
255
+ PAYMENT_DETAILS_CALL_FAILED: {
256
+ title: "Payment details call failed",
257
+ message: "There was a problem getting the payment details"
258
+ },
259
+ PAYMENT_METHOD_STORAGE_FAILED: {
260
+ title: "Failed storing payment method",
261
+ message: "Something went wrong with storing the payment method"
262
+ },
263
+ REDIRECT_RESULT_PAYMENT_ACCEPTOR_MISSING: {
264
+ title: "Missing payment acceptor",
265
+ message: "A redirect result is set, but a payment acceptor is missing in the url"
266
+ },
267
+ TOKENIZE_FAILED: {
268
+ title: "Tokenization failed",
269
+ message: "The tokenization of the payment method has failed"
270
+ },
271
+ PAYMENT_INTEGRATION_INITIALIZATION_FAILED: {
272
+ title: "Failed loading payment methods",
273
+ message: "Failed loading payment integration",
274
+ isReloadButtonVisible: true
275
+ },
276
+ RESOURCE_REVOKED: {
277
+ title: "Resource revoked",
278
+ message: "The resource has been revoked",
279
+ isReloadButtonVisible: true
280
+ }
281
+ };
282
+ const _hoisted_1 = { class: "flex flex-col items-center gap-6" };
283
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
284
+ __name: "PaymentErrorCard",
285
+ props: {
286
+ error: { type: Object }
287
+ },
288
+ setup(__props) {
289
+ const props = __props;
290
+ const { $t } = useIntl();
291
+ const errorConfig = computed(() => ErrorMap[props.error.code]);
292
+ const reload = () => {
293
+ window.location.reload();
294
+ };
295
+ return (_ctx, _cache) => {
296
+ return openBlock(), createBlock(_sfc_main$4, {
297
+ status: "error",
298
+ title: errorConfig.value.title
299
+ }, {
300
+ default: withCtx(() => [
301
+ createElementVNode("div", _hoisted_1, [
302
+ createVNode(unref(_sfc_main$7), {
303
+ variant: "body-xs",
304
+ shade: "lighter",
305
+ class: "mt-3"
306
+ }, {
307
+ default: withCtx(() => [
308
+ createTextVNode(toDisplayString(errorConfig.value.message), 1)
309
+ ]),
310
+ _: 1
311
+ }),
312
+ errorConfig.value.isReloadButtonVisible ? (openBlock(), createBlock(unref(_sfc_main$8), {
313
+ key: 0,
314
+ type: "button",
315
+ color: "gray",
316
+ variant: "outline",
317
+ onClick: reload
318
+ }, {
319
+ default: withCtx(() => [
320
+ createTextVNode(toDisplayString(unref($t)({
321
+ defaultMessage: "Try again",
322
+ description: "Retry button text when an error has happened during a payment",
323
+ id: "payments.retry_button.label"
324
+ })), 1)
325
+ ]),
326
+ _: 1
327
+ })) : createCommentVNode("", true)
328
+ ])
329
+ ]),
330
+ _: 1
331
+ }, 8, ["title"]);
332
+ };
333
+ }
334
+ });
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
+ const useExperimentalFeature = () => {
433
+ const experimentalFeature = inject(EXPERIMENTAL_FEATURE_INJECTION_KEY);
434
+ return experimentalFeature;
435
+ };
436
+ const EXPRESS_PAYMENT_METHOD_TYPES = ["applepay"];
437
+ function filterOutExpressPaymentMethods(paymentMethods) {
438
+ return paymentMethods.filter(
439
+ (method) => !EXPRESS_PAYMENT_METHOD_TYPES.some((type) => {
440
+ var _a;
441
+ return type === ((_a = method.type) == null ? void 0 : _a.toLowerCase());
442
+ })
443
+ );
444
+ }
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
+ const PAYMENT_GATEWAY_VARIANT_ADYEN = "ADYEN";
453
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
454
+ __name: "PaymentIntegrationFormAdyen",
455
+ props: {
456
+ countryCode: { type: String },
457
+ customerId: { type: String },
458
+ invoiceId: { type: String },
459
+ paymentMethodOptionResponseEntry: { type: Object },
460
+ variant: { type: String },
461
+ selected: { type: Boolean },
462
+ onSelect: { type: Function },
463
+ amount: { type: Object },
464
+ validateOnSubmit: { type: Function, default: () => Promise.resolve(true) },
465
+ context: { type: Object },
466
+ forceStorePaymentMethod: { type: Boolean }
467
+ },
468
+ emits: ["select", "payment-failed", "payment-success", "ready"],
469
+ setup(__props, { expose: __expose, emit: __emit }) {
470
+ let dropInInstance = null;
471
+ let checkoutInstance = null;
472
+ const props = __props;
473
+ const emit = __emit;
474
+ __expose({ submit });
475
+ const dropInContainerRef = ref();
476
+ const showPaymentSuccess = ref(false);
477
+ const integrationError = ref();
478
+ const logger = useLogger();
479
+ const { locale } = useIntl();
480
+ const { authorizePayment, getPaymentDetails } = createPaymentsService();
481
+ const { tokenizePaymentMethod } = createPaymentMethodsService();
482
+ const experimentalFeatures = useExperimentalFeature();
483
+ const showPayButton = computed(() => props.variant === "TOKENIZE");
484
+ function submit() {
485
+ try {
486
+ dropInInstance == null ? void 0 : dropInInstance.submit();
487
+ } catch (error) {
488
+ console.error(error);
489
+ }
490
+ }
491
+ async function getConfiguration() {
492
+ var _a;
493
+ const adyenAmount = transformToAdyenAmount(props.amount);
494
+ const paymentMethods = ((_a = experimentalFeatures == null ? void 0 : experimentalFeatures.value) == null ? void 0 : _a["express-checkout"]) ? filterOutExpressPaymentMethods(
495
+ mapAdyenPaymentMethods(props.paymentMethodOptionResponseEntry)
496
+ ) : mapAdyenPaymentMethods(props.paymentMethodOptionResponseEntry);
497
+ return {
498
+ checkoutConfig: {
499
+ amount: adyenAmount,
500
+ clientKey: getAdyenClientKeyFromPaymentMethodOptionsResponse(
501
+ props.paymentMethodOptionResponseEntry
502
+ ),
503
+ environment: getAdyenEnvironmentFromPaymentMethodOptionsResponse(
504
+ props.paymentMethodOptionResponseEntry
505
+ ),
506
+ locale,
507
+ translations: getOverriddenTranslations(props.variant),
508
+ countryCode: props.countryCode,
509
+ analytics: { enabled: false },
510
+ paymentMethodsResponse: { paymentMethods },
511
+ onSubmit: handleOnSubmit,
512
+ onAdditionalDetails: handleOnAdditionalDetails,
513
+ onPaymentCompleted: handleOnPaymentCompleted,
514
+ onPaymentFailed: handleOnPaymentFailed,
515
+ onError: handleOnError,
516
+ showPayButton: showPayButton.value
517
+ },
518
+ dropInConfig: {
519
+ disableFinalAnimation: true,
520
+ paymentMethodsConfiguration: {
521
+ card: {
522
+ hasHolderName: true,
523
+ holderNameRequired: true,
524
+ enableStoreDetails: !props.forceStorePaymentMethod && props.variant === "AUTHORIZE"
525
+ },
526
+ paypal: {
527
+ intent: adyenAmount.value > 0 ? "authorize" : "tokenize",
528
+ showPayButton: true
529
+ }
530
+ },
531
+ openFirstPaymentMethod: props.selected,
532
+ onSelect: () => emit("select"),
533
+ onReady: () => emit("ready")
534
+ }
535
+ };
536
+ }
537
+ async function mountDropIn() {
538
+ if (!dropInContainerRef.value) return;
539
+ try {
540
+ await unmountDropIn();
541
+ const [adyenModule, { default: adyenCss }] = await Promise.all([
542
+ import("./auto-DzZuCneB.mjs"),
543
+ import("./adyen-51SvcyqV.mjs")
544
+ ]);
545
+ const { AdyenCheckout, Dropin } = adyenModule;
546
+ const { checkoutConfig, dropInConfig } = await getConfiguration();
547
+ checkoutInstance = await AdyenCheckout(checkoutConfig);
548
+ dropInInstance = new Dropin(checkoutInstance, dropInConfig).mount(dropInContainerRef.value);
549
+ injectStylesToShadowRoot(adyenCss);
550
+ } catch (error) {
551
+ logger.error(
552
+ "PAYMENT_INTEGRATION_INITIALIZATION_FAILED",
553
+ "Failed to mount Adyen web drop-in",
554
+ { error }
555
+ );
556
+ }
557
+ }
558
+ async function unmountDropIn() {
559
+ if (dropInInstance) {
560
+ dropInInstance.unmount();
561
+ dropInInstance = null;
562
+ }
563
+ if (dropInContainerRef.value) {
564
+ dropInContainerRef.value.innerHTML = "";
565
+ }
566
+ }
567
+ function injectStylesToShadowRoot(adyenCss) {
568
+ var _a;
569
+ const root = (_a = dropInContainerRef.value) == null ? void 0 : _a.getRootNode();
570
+ if (root instanceof ShadowRoot) {
571
+ const style = document.createElement("style");
572
+ style.textContent = `${adyenCss}
573
+ :host {
574
+ --adyen-sdk-color-background-secondary: transparent;
575
+ --adyen-sdk-color-background-primary: rgb(243 244 246 / 0.5);
576
+ --adyen-sdk-color-outline-secondary: #e5e7eb;
577
+ --adyen-sdk-color-outline-primary: transparent;
578
+ --adyen-sdk-color-background-always-dark: var(--color-primary-500);
579
+ --adyen-sdk-color-background-inverse-primary-hover: var(--color-primary-600);
580
+ }
581
+
582
+ .adyen-checkout__payment-method__image__wrapper {
583
+ width: 32px;
584
+ height: 32px;
585
+ }
586
+
587
+ .adyen-checkout__payment-method__image {
588
+ height: 32px;
589
+ }
590
+
591
+ .adyen-checkout__input-wrapper,
592
+ .adyen-checkout__input {
593
+ border-color: rgb(229, 231, 235);
594
+ border-radius: var(--adyen-sdk-border-radius-s, 4px);
595
+ }
596
+
597
+ .adyen-checkout__button,
598
+ .adyen-checkout__payment-method {
599
+ border-radius: var(--adyen-sdk-border-radius-s, 4px);
600
+ }
601
+
602
+ .adyen-checkout__payment-method {
603
+ border-color: rgb(229, 231, 235);
604
+ box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
605
+ transition: box-shadow 0.2s ease-in-out;
606
+ }
607
+
608
+ .adyen-checkout__payment-method--selected {
609
+ box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
610
+ }
611
+
612
+ .adyen-checkout__payment-method:after {
613
+ transform: scale(0%);
614
+ }
615
+
616
+ .adyen-checkout__paypal__button {
617
+ display: block !important;
618
+ }
619
+
620
+ .adyen-checkout__payment-methods-list {
621
+ gap: 4px;
622
+ }
623
+
624
+ .adyen-checkout__dropdown__list {
625
+ background-color: white;
626
+ border-radius: var(--adyen-sdk-border-radius-s, 4px);
627
+ }
628
+
629
+ .adyen-checkout__payment-method.adyen-checkout__payment-method--selected:after {
630
+ content: '✓';
631
+ width: 20px;
632
+ height: 20px;
633
+ border-radius: 10px;
634
+ background-color: var(--color-primary-600);
635
+ position: absolute;
636
+ top: 14px;
637
+ right: 14px;
638
+ text-align: center;
639
+ line-height: 20px;
640
+ color: white;
641
+ transform: scale(100%);
642
+ font-size: 12px;
643
+ }
644
+
645
+ .adyen-checkout__payment-method__header {
646
+ padding: 8px 16px !important;
647
+ }
648
+
649
+ .adyen-checkout__payment-method__brands {
650
+ align-items: center;
651
+ }
652
+ .adyen-checkout__payment-method__brand-number {
653
+ line-height: 1;
654
+ }
655
+ .adyen-checkout__button__text {
656
+ font-size: 14px;
657
+ }
658
+ .adyen-checkout__store-details {
659
+ background: transparent;
660
+ padding: 0;
661
+ }
662
+ .adyen-checkout__checkbox__input + .adyen-checkout__checkbox__label:after {
663
+ border-color: rgb(229, 231, 235);
664
+ }
665
+ `;
666
+ if (props.variant === "AUTHORIZE") {
667
+ style.textContent += `
668
+ .adyen-checkout__payment-method--cashapp .adyen-checkout-pm-details-wrapper {
669
+ display: none;
670
+ }
671
+ `;
672
+ }
673
+ root.appendChild(style);
674
+ }
675
+ }
676
+ function handleOnSubmit(...args) {
677
+ const [state, _component, actions] = args;
678
+ props.validateOnSubmit().then((isValid) => {
679
+ if (!isValid) {
680
+ return;
681
+ }
682
+ const paymentAcceptorId = props.paymentMethodOptionResponseEntry.payment_acceptor.id;
683
+ const adyen = {
684
+ risk_data: transformObjectToAdyenObject(state.data.riskData),
685
+ payment_method: transformObjectToAdyenObject(state.data.paymentMethod),
686
+ browser_info: transformObjectToAdyenObject(state.data.browserInfo)
687
+ };
688
+ if (props.variant === "AUTHORIZE") {
689
+ const returnUrl = createReturnUrl({
690
+ paymentAcceptorId: props.paymentMethodOptionResponseEntry.payment_acceptor.id,
691
+ redirectUrl: window.location.href
692
+ });
693
+ authorizePayment({
694
+ payment_acceptor_id: paymentAcceptorId,
695
+ ...props.customerId ? { customer_id: props.customerId } : {},
696
+ payment_gateway_variant: PAYMENT_GATEWAY_VARIANT_ADYEN,
697
+ adyen: {
698
+ ...adyen,
699
+ store_payment_method: props.forceStorePaymentMethod || state.data.storePaymentMethod
700
+ },
701
+ amount: props.amount,
702
+ ...props.context ? { context: props.context } : {},
703
+ return_url: returnUrl
704
+ }).then((paymentResult) => {
705
+ const paymentMethodType = state.data.paymentMethod.type;
706
+ if (["FAILURE", "REFUSED"].includes(paymentResult.status)) {
707
+ logger.error(
708
+ "PAYMENT_AUTHORIZATION_FAILED",
709
+ `Failed payment authorization for payment acceptor with id ${paymentAcceptorId}`,
710
+ { error: paymentResult }
711
+ );
712
+ actions.resolve({ resultCode: "Error" });
713
+ return;
714
+ }
715
+ if (paymentResult.status === "ACTION_REQUIRED" && paymentResult.action.payment_gateway_variant === PAYMENT_GATEWAY_VARIANT_ADYEN) {
716
+ const requiredAction = handleActionRequiredPaymentAction(
717
+ paymentResult,
718
+ paymentMethodType
719
+ );
720
+ if (!requiredAction) {
721
+ logger.error(
722
+ "PAYMENT_AUTHORIZATION_FAILED",
723
+ `Failed payment authorization for payment acceptor with id ${paymentAcceptorId}`,
724
+ { error: paymentResult }
725
+ );
726
+ return;
727
+ }
728
+ dropInInstance.handleAction(requiredAction);
729
+ actions.resolve({
730
+ resultCode: paymentResult.action.adyen.result_code,
731
+ action: requiredAction
732
+ });
733
+ return;
734
+ }
735
+ showPaymentSuccess.value = true;
736
+ actions.resolve({ resultCode: "Authorised" });
737
+ }).catch((error) => {
738
+ logger.error(
739
+ "PAYMENT_AUTHORIZATION_FAILED",
740
+ `Failed payment authorization for payment acceptor with id ${paymentAcceptorId}`,
741
+ { error }
742
+ );
743
+ actions.resolve({ resultCode: "Error" });
744
+ });
745
+ return;
746
+ }
747
+ if (props.variant === "TOKENIZE") {
748
+ const returnUrl = createReturnUrl({
749
+ paymentAcceptorId: props.paymentMethodOptionResponseEntry.payment_acceptor.id,
750
+ redirectUrl: window.location.href
751
+ });
752
+ if (!props.customerId) {
753
+ logger.error(
754
+ "TOKENIZATION_FAILED",
755
+ `Missing customer id for payment acceptor with id ${paymentAcceptorId}`
756
+ );
757
+ return;
758
+ }
759
+ tokenizePaymentMethod({
760
+ customer_id: props.customerId,
761
+ payment_acceptor_id: paymentAcceptorId,
762
+ payment_gateway_variant: PAYMENT_GATEWAY_VARIANT_ADYEN,
763
+ adyen,
764
+ return_url: returnUrl
765
+ }).then((paymentResult) => {
766
+ const paymentMethodType = state.data.paymentMethod.type;
767
+ if (["FAILURE", "REFUSED"].includes(paymentResult.status)) {
768
+ logger.error(
769
+ "TOKENIZATION_FAILED",
770
+ `Tokenization failed for payment acceptor with id ${paymentAcceptorId}`,
771
+ { error: paymentResult }
772
+ );
773
+ actions.resolve({ resultCode: "Error" });
774
+ return;
775
+ }
776
+ if (paymentResult.status === "ACTION_REQUIRED" && paymentResult.action.payment_gateway_variant === PAYMENT_GATEWAY_VARIANT_ADYEN) {
777
+ const requiredAction = handleActionRequiredPaymentAction(
778
+ paymentResult,
779
+ paymentMethodType
780
+ );
781
+ if (!requiredAction) {
782
+ logger.error(
783
+ "TOKENIZATION_FAILED",
784
+ `Tokenization failed for payment acceptor with id ${paymentAcceptorId}`,
785
+ { error: paymentResult }
786
+ );
787
+ return;
788
+ }
789
+ dropInInstance.handleAction(requiredAction);
790
+ actions.resolve({
791
+ resultCode: paymentResult.action.adyen.result_code,
792
+ action: requiredAction
793
+ });
794
+ return;
795
+ }
796
+ showPaymentSuccess.value = true;
797
+ actions.resolve({ resultCode: "Authorised" });
798
+ }).catch((error) => {
799
+ logger.error(
800
+ "TOKENIZATION_FAILED",
801
+ `Tokenization failed for payment acceptor with id ${paymentAcceptorId}`,
802
+ { error }
803
+ );
804
+ actions.resolve({ resultCode: "Error" });
805
+ });
806
+ }
807
+ }).catch(() => {
808
+ });
809
+ }
810
+ function handleActionRequiredPaymentAction(response, paymentMethodType) {
811
+ if (response.status !== "ACTION_REQUIRED") {
812
+ return void 0;
813
+ }
814
+ const action = response.action;
815
+ if (action.payment_gateway_variant != "ADYEN") {
816
+ return void 0;
817
+ }
818
+ const adyenRequiredAction = action.adyen;
819
+ return {
820
+ paymentMethodType: (adyenRequiredAction == null ? void 0 : adyenRequiredAction.payment_method_type) ?? paymentMethodType,
821
+ method: action.method,
822
+ url: action.url,
823
+ data: action.data,
824
+ type: adyenRequiredAction == null ? void 0 : adyenRequiredAction.action_type,
825
+ paymentData: adyenRequiredAction == null ? void 0 : adyenRequiredAction.payment_data,
826
+ sdkData: adyenRequiredAction == null ? void 0 : adyenRequiredAction.sdk_data
827
+ };
828
+ }
829
+ function handleOnAdditionalDetails(...args) {
830
+ const [state] = args;
831
+ const detailsResult = state.data.details;
832
+ const paymentDataResult = state.data.paymentData;
833
+ if (props.paymentMethodOptionResponseEntry.payment_acceptor.id) {
834
+ handlePaymentDetails({
835
+ // For the moment: Adyen gives a null value back which is not accepted by Solvimon API, so filter that out
836
+ detailsResult: detailsResult ? removeEmptyValues(detailsResult) : void 0,
837
+ paymentDataResult,
838
+ paymentAcceptorId: props.paymentMethodOptionResponseEntry.payment_acceptor.id
839
+ });
840
+ return;
841
+ }
842
+ const error = {
843
+ code: "UNKNOWN_ERROR",
844
+ message: "Payment failed",
845
+ error: args
846
+ };
847
+ emit("payment-failed", error);
848
+ integrationError.value = error;
849
+ }
850
+ function removeEmptyValues(obj) {
851
+ return Object.fromEntries(
852
+ Object.entries(obj).filter(([, value]) => value !== null && value !== void 0)
853
+ );
854
+ }
855
+ function handleOnPaymentFailed(...args) {
856
+ const [data] = args;
857
+ const error = {
858
+ code: "UNKNOWN_ERROR",
859
+ message: "Payment failed",
860
+ error: data
861
+ };
862
+ emit("payment-failed", error);
863
+ integrationError.value = error;
864
+ }
865
+ function handleOnPaymentCompleted(...args) {
866
+ const [, component] = args;
867
+ component == null ? void 0 : component.unmount();
868
+ emit("payment-success");
869
+ }
870
+ function handleOnError(...args) {
871
+ const [data, component] = args;
872
+ if (data.name === "CANCEL") {
873
+ return;
874
+ }
875
+ const error = {
876
+ code: "UNKNOWN_ERROR",
877
+ message: "Something went wrong",
878
+ error: data
879
+ };
880
+ logger.error("INTEGRATION_ERROR", "Something went wrong", { error: data });
881
+ integrationError.value = error;
882
+ component == null ? void 0 : component.unmount();
883
+ }
884
+ function handlePaymentDetails({
885
+ detailsResult,
886
+ threeDSResult,
887
+ redirectResult,
888
+ paymentDataResult,
889
+ paymentAcceptorId
890
+ }) {
891
+ getPaymentDetails({
892
+ paymentAcceptorId,
893
+ paymentGatewayVariant: PAYMENT_GATEWAY_VARIANT_ADYEN,
894
+ adyen: {
895
+ ...detailsResult ? { details: detailsResult } : {},
896
+ ...redirectResult ? { redirect_result: redirectResult } : {},
897
+ ...threeDSResult ? { threeds_result: threeDSResult } : {},
898
+ ...paymentDataResult ? { payment_data: paymentDataResult } : {}
899
+ }
900
+ }).then((result) => {
901
+ if (result.payment_status === "FAILURE") {
902
+ emit("payment-failed", {
903
+ code: "UNKNOWN_ERROR",
904
+ message: "Failed getting payment details",
905
+ error: result
906
+ });
907
+ return;
908
+ }
909
+ if (result.payment_status === "SUCCESS") {
910
+ emit("payment-success");
911
+ return;
912
+ }
913
+ }).catch((error) => {
914
+ logger.error("PAYMENT_DETAILS_CALL_FAILED", "Failed fetching payment details", {
915
+ error
916
+ });
917
+ });
918
+ }
919
+ function handleRedirectResult() {
920
+ const redirectResult = getQueryParam(REDIRECT_RESULT_QUERY_STRING);
921
+ const paymentAcceptorId = getQueryParam(PAYMENT_ACCEPTOR_ID_QUERY_STRING);
922
+ if (!redirectResult) {
923
+ return;
924
+ }
925
+ if (!paymentAcceptorId) {
926
+ logger.error(
927
+ "INVALID_REDIRECT_RESULT",
928
+ "Redirect result is set but payment acceptor id is missing",
929
+ { context: { redirectResult } }
930
+ );
931
+ return;
932
+ }
933
+ handlePaymentDetails({
934
+ paymentAcceptorId,
935
+ detailsResult: {
936
+ redirectResult: decodeURI(redirectResult)
937
+ }
938
+ });
939
+ }
940
+ onMounted(() => {
941
+ void mountDropIn();
942
+ handleRedirectResult();
943
+ });
944
+ onBeforeUnmount(() => {
945
+ void unmountDropIn();
946
+ });
947
+ watch(
948
+ () => props.paymentMethodOptionResponseEntry,
949
+ (newValue, oldValue) => {
950
+ if (isEqual(newValue, oldValue)) return;
951
+ void mountDropIn();
952
+ },
953
+ { deep: true }
954
+ );
955
+ return (_ctx, _cache) => {
956
+ return openBlock(), createElementBlock(Fragment, null, [
957
+ showPaymentSuccess.value ? (openBlock(), createBlock(_sfc_main$3, {
958
+ key: 0,
959
+ variant: __props.variant
960
+ }, null, 8, ["variant"])) : integrationError.value ? (openBlock(), createBlock(_sfc_main$2, {
961
+ key: 1,
962
+ error: integrationError.value
963
+ }, null, 8, ["error"])) : createCommentVNode("", true),
964
+ createElementVNode("div", {
965
+ ref_key: "dropInContainerRef",
966
+ ref: dropInContainerRef
967
+ }, null, 512)
968
+ ], 64);
969
+ };
970
+ }
971
+ });
972
+ const _sfc_main = /* @__PURE__ */ defineComponent({
973
+ __name: "PaymentIntegrationForm",
974
+ props: {
975
+ customerId: { type: String },
976
+ variant: { type: String },
977
+ context: { type: Object },
978
+ paymentMethodOptions: { type: Array },
979
+ countryCode: { type: String },
980
+ invoiceId: { type: String },
981
+ amount: { type: Object },
982
+ successRedirectUrl: { type: String },
983
+ selectedOption: { type: String },
984
+ validateOnSubmit: { type: Function },
985
+ forceStorePaymentMethod: { type: Boolean }
986
+ },
987
+ emits: ["select", "payment-failed", "payment-success", "ready"],
988
+ setup(__props, { expose: __expose, emit: __emit }) {
989
+ const props = __props;
990
+ const emit = __emit;
991
+ __expose({ submit });
992
+ const { $t } = useIntl();
993
+ const selectedIntegration = ref();
994
+ const integrationRefs = ref(/* @__PURE__ */ new Map());
995
+ const showIntegrationError = ref(false);
996
+ function handleSelect(type) {
997
+ selectedIntegration.value = type;
998
+ showIntegrationError.value = false;
999
+ }
1000
+ function submit() {
1001
+ var _a, _b;
1002
+ if (!selectedIntegration.value) {
1003
+ showIntegrationError.value = true;
1004
+ void ((_a = props.validateOnSubmit) == null ? void 0 : _a.call(props));
1005
+ }
1006
+ (_b = integrationRefs.value.get(selectedIntegration.value)) == null ? void 0 : _b.submit();
1007
+ }
1008
+ const handlePaymentSuccess = () => {
1009
+ if (props.successRedirectUrl) {
1010
+ window.location.href = props.successRedirectUrl;
1011
+ }
1012
+ emit("payment-success");
1013
+ };
1014
+ return (_ctx, _cache) => {
1015
+ return openBlock(), createElementBlock(Fragment, null, [
1016
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.paymentMethodOptions, (paymentMethodOption) => {
1017
+ var _a;
1018
+ return openBlock(), createElementBlock(Fragment, {
1019
+ key: paymentMethodOption.integration.id
1020
+ }, [
1021
+ ((_a = paymentMethodOption.integration.payment_gateway) == null ? void 0 : _a.variant) === "ADYEN" ? (openBlock(), createBlock(_sfc_main$1, {
1022
+ key: 0,
1023
+ ref_for: true,
1024
+ ref: (el) => integrationRefs.value.set("PAYMENT_GATEWAY_ADYEN", el),
1025
+ context: __props.context,
1026
+ "payment-method-option-response-entry": paymentMethodOption,
1027
+ "country-code": __props.countryCode,
1028
+ "customer-id": __props.customerId,
1029
+ variant: __props.variant,
1030
+ amount: __props.amount,
1031
+ "invoice-id": __props.invoiceId,
1032
+ selected: selectedIntegration.value === "PAYMENT_GATEWAY_ADYEN",
1033
+ "validate-on-submit": __props.validateOnSubmit,
1034
+ "force-store-payment-method": __props.forceStorePaymentMethod,
1035
+ onSelect: _cache[0] || (_cache[0] = () => handleSelect("PAYMENT_GATEWAY_ADYEN")),
1036
+ onPaymentFailed: _cache[1] || (_cache[1] = (args) => _ctx.$emit("payment-failed", args)),
1037
+ onPaymentSuccess: handlePaymentSuccess,
1038
+ onReady: _cache[2] || (_cache[2] = ($event) => emit("ready"))
1039
+ }, 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
+ ], 64);
1041
+ }), 128)),
1042
+ showIntegrationError.value ? (openBlock(), createBlock(unref(_sfc_main$9), {
1043
+ key: 0,
1044
+ variant: "error",
1045
+ class: "mt-2"
1046
+ }, {
1047
+ default: withCtx(() => [
1048
+ createTextVNode(toDisplayString(unref($t)({
1049
+ defaultMessage: "Select a payment method",
1050
+ id: "payment_integration_form.select_payment_method_error",
1051
+ description: "Error shown when no payment method is selected"
1052
+ })), 1)
1053
+ ]),
1054
+ _: 1
1055
+ })) : createCommentVNode("", true)
1056
+ ], 64);
1057
+ };
1058
+ }
1059
+ });
1060
+ 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
1067
+ };