@adyen/adyen-web 6.5.0 → 6.6.0

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 (248) hide show
  1. package/dist/cjs/adyen.css +2 -2
  2. package/dist/cjs/adyen.css.map +1 -1
  3. package/dist/cjs/index.cjs +2 -2
  4. package/dist/cjs/index.cjs.map +1 -1
  5. package/dist/cjs/index.d.cts +68 -30
  6. package/dist/es/adyen.css +2 -2
  7. package/dist/es/adyen.css.map +1 -1
  8. package/dist/es/components/ANCV/ANCV.js.map +1 -1
  9. package/dist/es/components/Ach/components/AchInput/defaultProps.js +1 -1
  10. package/dist/es/components/Ach/components/AchInput/defaultProps.js.map +1 -1
  11. package/dist/es/components/ApplePay/components/ApplePayButton.js.map +1 -1
  12. package/dist/es/components/BacsDD/BacsDD.js.map +1 -1
  13. package/dist/es/components/Boleto/Boleto.js.map +1 -1
  14. package/dist/es/components/Boleto/components/BoletoVoucherResult/BoletoVoucherResult.js +1 -1
  15. package/dist/es/components/Boleto/components/BoletoVoucherResult/BoletoVoucherResult.js.map +1 -1
  16. package/dist/es/components/Card/Card.js.map +1 -1
  17. package/dist/es/components/Card/components/CardInput/components/BrandIcon.js +1 -1
  18. package/dist/es/components/Card/components/CardInput/components/BrandIcon.js.map +1 -1
  19. package/dist/es/components/Card/components/CardInput/components/CVCHint.js.map +1 -1
  20. package/dist/es/components/Card/components/CardInput/types.js +1 -1
  21. package/dist/es/components/Card/components/CardInput/types.js.map +1 -1
  22. package/dist/es/components/CashAppPay/CashAppPay.js.map +1 -1
  23. package/dist/es/components/CashAppPay/services/types.js +1 -1
  24. package/dist/es/components/CashAppPay/services/types.js.map +1 -1
  25. package/dist/es/components/CustomCard/CustomCard.js.map +1 -1
  26. package/dist/es/components/Donation/components/CampaignContent.js +1 -1
  27. package/dist/es/components/Donation/components/CampaignContent.js.map +1 -1
  28. package/dist/es/components/Donation/components/CampaignInfo.js +2 -0
  29. package/dist/es/components/Donation/components/CampaignInfo.js.map +1 -0
  30. package/dist/es/components/Donation/components/DonationComponent.js +1 -1
  31. package/dist/es/components/Donation/components/DonationComponent.js.map +1 -1
  32. package/dist/es/components/Dropin/components/DropinComponent.js +1 -1
  33. package/dist/es/components/Dropin/components/DropinComponent.js.map +1 -1
  34. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
  35. package/dist/es/components/Giftcard/Giftcard.js.map +1 -1
  36. package/dist/es/components/Giftcard/components/GiftcardComponent.js.map +1 -1
  37. package/dist/es/components/GooglePay/GooglePay.js.map +1 -1
  38. package/dist/es/components/Klarna/KlarnaPayments.js +1 -1
  39. package/dist/es/components/Klarna/KlarnaPayments.js.map +1 -1
  40. package/dist/es/components/Klarna/components/KlarnaContainer/KlarnaContainer.js +1 -1
  41. package/dist/es/components/Klarna/components/KlarnaContainer/KlarnaContainer.js.map +1 -1
  42. package/dist/es/components/Klarna/components/KlarnaWidget/KlarnaWidget.js +1 -1
  43. package/dist/es/components/Klarna/components/KlarnaWidget/KlarnaWidget.js.map +1 -1
  44. package/dist/es/components/Multibanco/Multibanco.js.map +1 -1
  45. package/dist/es/components/OnlineBankingCZ/index.js +1 -1
  46. package/dist/es/components/OnlineBankingCZ/index.js.map +1 -1
  47. package/dist/es/components/OnlineBankingSK/index.js +1 -1
  48. package/dist/es/components/OnlineBankingSK/index.js.map +1 -1
  49. package/dist/es/components/Oxxo/Oxxo.js.map +1 -1
  50. package/dist/es/components/Oxxo/components/OxxoVoucherResult/OxxoVoucherResult.js +1 -1
  51. package/dist/es/components/Oxxo/components/OxxoVoucherResult/OxxoVoucherResult.js.map +1 -1
  52. package/dist/es/components/PayPal/Paypal.js.map +1 -1
  53. package/dist/es/components/Redirect/Redirect.js +1 -1
  54. package/dist/es/components/Redirect/Redirect.js.map +1 -1
  55. package/dist/es/components/Redirect/components/RedirectShopper/RedirectShopper.js +1 -1
  56. package/dist/es/components/Redirect/components/RedirectShopper/RedirectShopper.js.map +1 -1
  57. package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
  58. package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
  59. package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
  60. package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  61. package/dist/es/components/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
  62. package/dist/es/components/ThreeDS2/callSubmit3DS2Fingerprint.js.map +1 -1
  63. package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
  64. package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
  65. package/dist/es/components/ThreeDS2/components/DeviceFingerprint/DoFingerprint3DS2.js.map +1 -1
  66. package/dist/es/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js +1 -1
  67. package/dist/es/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
  68. package/dist/es/components/ThreeDS2/components/Form/ThreeDS2Form.js.map +1 -1
  69. package/dist/es/components/Twint/Twint.js.map +1 -1
  70. package/dist/es/components/UPI/UPI.js.map +1 -1
  71. package/dist/es/components/internal/Address/components/CountryField.js +1 -1
  72. package/dist/es/components/internal/Address/components/CountryField.js.map +1 -1
  73. package/dist/es/components/internal/Address/components/FieldContainer.js +1 -1
  74. package/dist/es/components/internal/Address/components/FieldContainer.js.map +1 -1
  75. package/dist/es/components/internal/Address/components/ReadOnlyAddress.js.map +1 -1
  76. package/dist/es/components/internal/Address/components/StateField.js +1 -1
  77. package/dist/es/components/internal/Address/components/StateField.js.map +1 -1
  78. package/dist/es/components/internal/BaseElement/BaseElement.js +1 -1
  79. package/dist/es/components/internal/BaseElement/BaseElement.js.map +1 -1
  80. package/dist/es/components/internal/Button/Button.js.map +1 -1
  81. package/dist/es/components/internal/ClickToPay/errors/TimeoutError.js.map +1 -1
  82. package/dist/es/components/internal/ClickToPay/services/ClickToPayService.js +1 -1
  83. package/dist/es/components/internal/ClickToPay/services/ClickToPayService.js.map +1 -1
  84. package/dist/es/components/internal/ClickToPay/services/sdks/SrciError.js.map +1 -1
  85. package/dist/es/components/internal/FormFields/Select/Select.js +1 -1
  86. package/dist/es/components/internal/FormFields/Select/Select.js.map +1 -1
  87. package/dist/es/components/internal/FormFields/Select/components/SelectButton.js +1 -1
  88. package/dist/es/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
  89. package/dist/es/components/internal/IFrame/Iframe.js.map +1 -1
  90. package/dist/es/components/internal/IssuerList/IssuerList.js +1 -1
  91. package/dist/es/components/internal/IssuerList/IssuerList.js.map +1 -1
  92. package/dist/es/components/internal/PersonalDetails/ReadOnlyPersonalDetails.js.map +1 -1
  93. package/dist/es/components/internal/QRLoader/QRLoader.js +1 -1
  94. package/dist/es/components/internal/QRLoader/QRLoader.js.map +1 -1
  95. package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
  96. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleIOSTouchEvents.js.map +1 -1
  97. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/cardType.js.map +1 -1
  98. package/dist/es/components/internal/SecuredFields/lib/constants.js +1 -1
  99. package/dist/es/components/internal/SecuredFields/lib/constants.js.map +1 -1
  100. package/dist/es/components/internal/SecuredFields/lib/securedField/SecuredField.js.map +1 -1
  101. package/dist/es/components/internal/SecuredFields/lib/utilities/logger.js.map +1 -1
  102. package/dist/es/components/internal/UIElement/UIElement.js +1 -1
  103. package/dist/es/components/internal/UIElement/UIElement.js.map +1 -1
  104. package/dist/es/components/tx-variants.js +1 -1
  105. package/dist/es/components/tx-variants.js.map +1 -1
  106. package/dist/es/core/Analytics/Analytics.js +1 -1
  107. package/dist/es/core/Analytics/Analytics.js.map +1 -1
  108. package/dist/es/core/Analytics/EventsQueue.js.map +1 -1
  109. package/dist/es/core/Analytics/analyticsPreProcessor.js +1 -1
  110. package/dist/es/core/Analytics/analyticsPreProcessor.js.map +1 -1
  111. package/dist/es/core/Analytics/constants.js +1 -1
  112. package/dist/es/core/Analytics/constants.js.map +1 -1
  113. package/dist/es/core/CheckoutSession/CheckoutSession.js.map +1 -1
  114. package/dist/es/core/Errors/AdyenCheckoutError.js.map +1 -1
  115. package/dist/es/core/Errors/SRPanel.js.map +1 -1
  116. package/dist/es/core/Errors/constants.js +1 -1
  117. package/dist/es/core/Errors/constants.js.map +1 -1
  118. package/dist/es/core/Errors/utils.js +1 -1
  119. package/dist/es/core/RiskModule/RiskModule.js.map +1 -1
  120. package/dist/es/core/RiskModule/components/DeviceFingerprint/GetDeviceFingerprint.js.map +1 -1
  121. package/dist/es/core/Services/analytics/collect-id.js +1 -1
  122. package/dist/es/core/core.js +1 -1
  123. package/dist/es/index.d.ts +68 -30
  124. package/dist/es-legacy/adyen.css +2 -2
  125. package/dist/es-legacy/adyen.css.map +1 -1
  126. package/dist/es-legacy/components/ANCV/ANCV.js.map +1 -1
  127. package/dist/es-legacy/components/Ach/components/AchInput/defaultProps.js +1 -1
  128. package/dist/es-legacy/components/Ach/components/AchInput/defaultProps.js.map +1 -1
  129. package/dist/es-legacy/components/ApplePay/components/ApplePayButton.js.map +1 -1
  130. package/dist/es-legacy/components/BacsDD/BacsDD.js.map +1 -1
  131. package/dist/es-legacy/components/Boleto/Boleto.js.map +1 -1
  132. package/dist/es-legacy/components/Boleto/components/BoletoVoucherResult/BoletoVoucherResult.js +1 -1
  133. package/dist/es-legacy/components/Boleto/components/BoletoVoucherResult/BoletoVoucherResult.js.map +1 -1
  134. package/dist/es-legacy/components/Card/Card.js.map +1 -1
  135. package/dist/es-legacy/components/Card/components/CardInput/components/BrandIcon.js +1 -1
  136. package/dist/es-legacy/components/Card/components/CardInput/components/BrandIcon.js.map +1 -1
  137. package/dist/es-legacy/components/Card/components/CardInput/components/CVCHint.js.map +1 -1
  138. package/dist/es-legacy/components/Card/components/CardInput/types.js +1 -1
  139. package/dist/es-legacy/components/Card/components/CardInput/types.js.map +1 -1
  140. package/dist/es-legacy/components/CashAppPay/CashAppPay.js.map +1 -1
  141. package/dist/es-legacy/components/CashAppPay/services/types.js +1 -1
  142. package/dist/es-legacy/components/CashAppPay/services/types.js.map +1 -1
  143. package/dist/es-legacy/components/CustomCard/CustomCard.js.map +1 -1
  144. package/dist/es-legacy/components/Donation/components/CampaignContent.js +1 -1
  145. package/dist/es-legacy/components/Donation/components/CampaignContent.js.map +1 -1
  146. package/dist/es-legacy/components/Donation/components/CampaignInfo.js +2 -0
  147. package/dist/es-legacy/components/Donation/components/CampaignInfo.js.map +1 -0
  148. package/dist/es-legacy/components/Donation/components/DonationComponent.js +1 -1
  149. package/dist/es-legacy/components/Donation/components/DonationComponent.js.map +1 -1
  150. package/dist/es-legacy/components/Dropin/components/DropinComponent.js +1 -1
  151. package/dist/es-legacy/components/Dropin/components/DropinComponent.js.map +1 -1
  152. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
  153. package/dist/es-legacy/components/Giftcard/Giftcard.js.map +1 -1
  154. package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js.map +1 -1
  155. package/dist/es-legacy/components/GooglePay/GooglePay.js.map +1 -1
  156. package/dist/es-legacy/components/Klarna/KlarnaPayments.js +1 -1
  157. package/dist/es-legacy/components/Klarna/KlarnaPayments.js.map +1 -1
  158. package/dist/es-legacy/components/Klarna/components/KlarnaContainer/KlarnaContainer.js +1 -1
  159. package/dist/es-legacy/components/Klarna/components/KlarnaContainer/KlarnaContainer.js.map +1 -1
  160. package/dist/es-legacy/components/Klarna/components/KlarnaWidget/KlarnaWidget.js +1 -1
  161. package/dist/es-legacy/components/Klarna/components/KlarnaWidget/KlarnaWidget.js.map +1 -1
  162. package/dist/es-legacy/components/Multibanco/Multibanco.js.map +1 -1
  163. package/dist/es-legacy/components/OnlineBankingCZ/index.js +1 -1
  164. package/dist/es-legacy/components/OnlineBankingCZ/index.js.map +1 -1
  165. package/dist/es-legacy/components/OnlineBankingSK/index.js +1 -1
  166. package/dist/es-legacy/components/OnlineBankingSK/index.js.map +1 -1
  167. package/dist/es-legacy/components/Oxxo/Oxxo.js.map +1 -1
  168. package/dist/es-legacy/components/Oxxo/components/OxxoVoucherResult/OxxoVoucherResult.js +1 -1
  169. package/dist/es-legacy/components/Oxxo/components/OxxoVoucherResult/OxxoVoucherResult.js.map +1 -1
  170. package/dist/es-legacy/components/PayPal/Paypal.js.map +1 -1
  171. package/dist/es-legacy/components/Redirect/Redirect.js +1 -1
  172. package/dist/es-legacy/components/Redirect/Redirect.js.map +1 -1
  173. package/dist/es-legacy/components/Redirect/components/RedirectShopper/RedirectShopper.js +1 -1
  174. package/dist/es-legacy/components/Redirect/components/RedirectShopper/RedirectShopper.js.map +1 -1
  175. package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
  176. package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
  177. package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
  178. package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  179. package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
  180. package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js.map +1 -1
  181. package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
  182. package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
  183. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/DoFingerprint3DS2.js.map +1 -1
  184. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js +1 -1
  185. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
  186. package/dist/es-legacy/components/ThreeDS2/components/Form/ThreeDS2Form.js.map +1 -1
  187. package/dist/es-legacy/components/Twint/Twint.js.map +1 -1
  188. package/dist/es-legacy/components/UPI/UPI.js.map +1 -1
  189. package/dist/es-legacy/components/internal/Address/components/CountryField.js +1 -1
  190. package/dist/es-legacy/components/internal/Address/components/CountryField.js.map +1 -1
  191. package/dist/es-legacy/components/internal/Address/components/FieldContainer.js +1 -1
  192. package/dist/es-legacy/components/internal/Address/components/FieldContainer.js.map +1 -1
  193. package/dist/es-legacy/components/internal/Address/components/ReadOnlyAddress.js.map +1 -1
  194. package/dist/es-legacy/components/internal/Address/components/StateField.js +1 -1
  195. package/dist/es-legacy/components/internal/Address/components/StateField.js.map +1 -1
  196. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js +1 -1
  197. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js.map +1 -1
  198. package/dist/es-legacy/components/internal/Button/Button.js.map +1 -1
  199. package/dist/es-legacy/components/internal/ClickToPay/components/CtPCards/CtPCards.js.map +1 -1
  200. package/dist/es-legacy/components/internal/ClickToPay/errors/TimeoutError.js.map +1 -1
  201. package/dist/es-legacy/components/internal/ClickToPay/services/ClickToPayService.js +1 -1
  202. package/dist/es-legacy/components/internal/ClickToPay/services/ClickToPayService.js.map +1 -1
  203. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/SrciError.js.map +1 -1
  204. package/dist/es-legacy/components/internal/FormFields/Select/Select.js +1 -1
  205. package/dist/es-legacy/components/internal/FormFields/Select/Select.js.map +1 -1
  206. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js +1 -1
  207. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
  208. package/dist/es-legacy/components/internal/IFrame/Iframe.js.map +1 -1
  209. package/dist/es-legacy/components/internal/IssuerList/IssuerList.js +1 -1
  210. package/dist/es-legacy/components/internal/IssuerList/IssuerList.js.map +1 -1
  211. package/dist/es-legacy/components/internal/PersonalDetails/ReadOnlyPersonalDetails.js.map +1 -1
  212. package/dist/es-legacy/components/internal/QRLoader/QRLoader.js +1 -1
  213. package/dist/es-legacy/components/internal/QRLoader/QRLoader.js.map +1 -1
  214. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
  215. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleIOSTouchEvents.js.map +1 -1
  216. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/cardType.js.map +1 -1
  217. package/dist/es-legacy/components/internal/SecuredFields/lib/constants.js +1 -1
  218. package/dist/es-legacy/components/internal/SecuredFields/lib/constants.js.map +1 -1
  219. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/SecuredField.js.map +1 -1
  220. package/dist/es-legacy/components/internal/SecuredFields/lib/utilities/logger.js.map +1 -1
  221. package/dist/es-legacy/components/internal/UIElement/UIElement.js +1 -1
  222. package/dist/es-legacy/components/internal/UIElement/UIElement.js.map +1 -1
  223. package/dist/es-legacy/components/tx-variants.js +1 -1
  224. package/dist/es-legacy/components/tx-variants.js.map +1 -1
  225. package/dist/es-legacy/core/Analytics/Analytics.js +1 -1
  226. package/dist/es-legacy/core/Analytics/Analytics.js.map +1 -1
  227. package/dist/es-legacy/core/Analytics/EventsQueue.js.map +1 -1
  228. package/dist/es-legacy/core/Analytics/analyticsPreProcessor.js +1 -1
  229. package/dist/es-legacy/core/Analytics/analyticsPreProcessor.js.map +1 -1
  230. package/dist/es-legacy/core/Analytics/constants.js +1 -1
  231. package/dist/es-legacy/core/Analytics/constants.js.map +1 -1
  232. package/dist/es-legacy/core/Analytics/utils.js.map +1 -1
  233. package/dist/es-legacy/core/CheckoutSession/CheckoutSession.js.map +1 -1
  234. package/dist/es-legacy/core/Errors/AdyenCheckoutError.js.map +1 -1
  235. package/dist/es-legacy/core/Errors/SRPanel.js.map +1 -1
  236. package/dist/es-legacy/core/Errors/constants.js +1 -1
  237. package/dist/es-legacy/core/Errors/constants.js.map +1 -1
  238. package/dist/es-legacy/core/Errors/utils.js +1 -1
  239. package/dist/es-legacy/core/RiskModule/RiskModule.js.map +1 -1
  240. package/dist/es-legacy/core/RiskModule/components/DeviceFingerprint/GetDeviceFingerprint.js.map +1 -1
  241. package/dist/es-legacy/core/Services/analytics/collect-id.js +1 -1
  242. package/dist/es-legacy/core/core.js +1 -1
  243. package/package.json +15 -12
  244. package/styles/adyen.css +2 -2
  245. package/dist/es/components/Donation/components/CampaignContainer.js +0 -2
  246. package/dist/es/components/Donation/components/CampaignContainer.js.map +0 -1
  247. package/dist/es-legacy/components/Donation/components/CampaignContainer.js +0 -2
  248. package/dist/es-legacy/components/Donation/components/CampaignContainer.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import e from"../helpers/IssuerListContainer/IssuerListContainer.js";import{TxVariants as n}from"../tx-variants.js";function s(e,n,s){return n in e?Object.defineProperty(e,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[n]=s,e}class t extends e{formatProps(e){return{...super.formatProps(e),showImage:!1,termsAndConditions:t.termsAndConditions}}get icon(){return this.props.icon??this.resources.getImage()("bankTransfer_IBAN")}}s(t,"type",n.onlineBanking_CZ),s(t,"termsAndConditions",{translationKey:"onlineBanking.termsAndConditions",urls:["https://static.payu.com/sites/terms/files/payu_privacy_policy_cs.pdf"]});export{t as default};
1
+ import e from"../helpers/IssuerListContainer/IssuerListContainer.js";import{TxVariants as n}from"../tx-variants.js";function s(e,n,s){return n in e?Object.defineProperty(e,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[n]=s,e}class t extends e{formatProps(e){return{...super.formatProps(e),showImage:!0,termsAndConditions:t.termsAndConditions}}get icon(){return this.props.icon??this.resources.getImage()("bankTransfer_IBAN")}}s(t,"type",n.onlineBanking_CZ),s(t,"termsAndConditions",{translationKey:"onlineBanking.termsAndConditions",urls:["https://static.payu.com/sites/terms/files/payu_privacy_policy_cs.pdf"]});export{t as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/OnlineBankingCZ/index.ts"],"sourcesContent":["import IssuerListContainer from '../helpers/IssuerListContainer/IssuerListContainer';\nimport { TxVariants } from '../tx-variants';\n\nconst TERMS_AND_CONDITIONS = 'https://static.payu.com/sites/terms/files/payu_privacy_policy_cs.pdf';\nconst ICON = 'bankTransfer_IBAN';\n\nclass OnlineBankingCZElement extends IssuerListContainer {\n public static type = TxVariants.onlineBanking_CZ;\n\n private static termsAndConditions = {\n translationKey: 'onlineBanking.termsAndConditions',\n urls: [TERMS_AND_CONDITIONS]\n };\n\n formatProps(props) {\n return {\n ...super.formatProps(props),\n showImage: false,\n termsAndConditions: OnlineBankingCZElement.termsAndConditions\n };\n }\n\n get icon(): string {\n return this.props.icon ?? this.resources.getImage()(ICON);\n }\n}\n\nexport default OnlineBankingCZElement;\n"],"names":["OnlineBankingCZElement","IssuerListContainer","formatProps","props","super","showImage","termsAndConditions","icon","this","resources","getImage","_define_property","type","TxVariants","onlineBanking_CZ","translationKey","urls"],"mappings":"4OAMA,MAAMA,UAA+BC,EAQjCC,WAAAA,CAAYC,GACR,MAAO,IACAC,MAAMF,YAAYC,GACrBE,WAAW,EACXC,mBAAoBN,EAAuBM,mBAEnD,CAEA,QAAIC,GACA,OAAOC,KAAKL,MAAMI,MAAQC,KAAKC,UAAUC,UAAfF,CAnBrB,oBAoBT,EAjBAG,EADEX,EACYY,OAAOC,EAAWC,kBAEhCH,EAHEX,EAGaM,qBAAqB,CAChCS,eAAgB,mCAChBC,KAAM,CARe"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/OnlineBankingCZ/index.ts"],"sourcesContent":["import IssuerListContainer from '../helpers/IssuerListContainer/IssuerListContainer';\nimport { TxVariants } from '../tx-variants';\n\nconst TERMS_AND_CONDITIONS = 'https://static.payu.com/sites/terms/files/payu_privacy_policy_cs.pdf';\nconst ICON = 'bankTransfer_IBAN';\n\nclass OnlineBankingCZElement extends IssuerListContainer {\n public static type = TxVariants.onlineBanking_CZ;\n\n private static termsAndConditions = {\n translationKey: 'onlineBanking.termsAndConditions',\n urls: [TERMS_AND_CONDITIONS]\n };\n\n formatProps(props) {\n return {\n ...super.formatProps(props),\n showImage: true,\n termsAndConditions: OnlineBankingCZElement.termsAndConditions\n };\n }\n\n get icon(): string {\n return this.props.icon ?? this.resources.getImage()(ICON);\n }\n}\n\nexport default OnlineBankingCZElement;\n"],"names":["OnlineBankingCZElement","IssuerListContainer","formatProps","props","super","showImage","termsAndConditions","icon","this","resources","getImage","_define_property","type","TxVariants","onlineBanking_CZ","translationKey","urls"],"mappings":"4OAMA,MAAMA,UAA+BC,EAQjCC,WAAAA,CAAYC,GACR,MAAO,IACAC,MAAMF,YAAYC,GACrBE,WAAW,EACXC,mBAAoBN,EAAuBM,mBAEnD,CAEA,QAAIC,GACA,OAAOC,KAAKL,MAAMI,MAAQC,KAAKC,UAAUC,UAAfF,CAnBrB,oBAoBT,EAjBAG,EADEX,EACYY,OAAOC,EAAWC,kBAEhCH,EAHEX,EAGaM,qBAAqB,CAChCS,eAAgB,mCAChBC,KAAM,CARe"}
@@ -1,2 +1,2 @@
1
- import e from"../helpers/IssuerListContainer/IssuerListContainer.js";import{TxVariants as n}from"../tx-variants.js";function s(e,n,s){return n in e?Object.defineProperty(e,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[n]=s,e}class t extends e{formatProps(e){return{...super.formatProps(e),showImage:!1,termsAndConditions:t.termsAndConditions}}get icon(){return this.props.icon??this.resources.getImage()("bankTransfer_IBAN")}}s(t,"type",n.onlineBanking_SK),s(t,"termsAndConditions",{translationKey:"onlineBanking.termsAndConditions",urls:["https://static.payu.com/sites/terms/files/payu_privacy_policy_sk.pdf"]});export{t as default};
1
+ import e from"../helpers/IssuerListContainer/IssuerListContainer.js";import{TxVariants as n}from"../tx-variants.js";function s(e,n,s){return n in e?Object.defineProperty(e,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[n]=s,e}class t extends e{formatProps(e){return{...super.formatProps(e),showImage:!0,termsAndConditions:t.termsAndConditions}}get icon(){return this.props.icon??this.resources.getImage()("bankTransfer_IBAN")}}s(t,"type",n.onlineBanking_SK),s(t,"termsAndConditions",{translationKey:"onlineBanking.termsAndConditions",urls:["https://static.payu.com/sites/terms/files/payu_privacy_policy_sk.pdf"]});export{t as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/OnlineBankingSK/index.ts"],"sourcesContent":["import IssuerListContainer from '../helpers/IssuerListContainer/IssuerListContainer';\nimport { TxVariants } from '../tx-variants';\n\nconst TERMS_AND_CONDITIONS = 'https://static.payu.com/sites/terms/files/payu_privacy_policy_sk.pdf';\nconst ICON = 'bankTransfer_IBAN';\n\nclass OnlineBankingSKElement extends IssuerListContainer {\n public static type = TxVariants.onlineBanking_SK;\n\n private static termsAndConditions = {\n translationKey: 'onlineBanking.termsAndConditions',\n urls: [TERMS_AND_CONDITIONS]\n };\n\n formatProps(props) {\n return {\n ...super.formatProps(props),\n showImage: false,\n termsAndConditions: OnlineBankingSKElement.termsAndConditions\n };\n }\n\n get icon(): string {\n return this.props.icon ?? this.resources.getImage()(ICON);\n }\n}\n\nexport default OnlineBankingSKElement;\n"],"names":["OnlineBankingSKElement","IssuerListContainer","formatProps","props","super","showImage","termsAndConditions","icon","this","resources","getImage","_define_property","type","TxVariants","onlineBanking_SK","translationKey","urls"],"mappings":"4OAMA,MAAMA,UAA+BC,EAQjCC,WAAAA,CAAYC,GACR,MAAO,IACAC,MAAMF,YAAYC,GACrBE,WAAW,EACXC,mBAAoBN,EAAuBM,mBAEnD,CAEA,QAAIC,GACA,OAAOC,KAAKL,MAAMI,MAAQC,KAAKC,UAAUC,UAAfF,CAnBrB,oBAoBT,EAjBAG,EADEX,EACYY,OAAOC,EAAWC,kBAEhCH,EAHEX,EAGaM,qBAAqB,CAChCS,eAAgB,mCAChBC,KAAM,CARe"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/OnlineBankingSK/index.ts"],"sourcesContent":["import IssuerListContainer from '../helpers/IssuerListContainer/IssuerListContainer';\nimport { TxVariants } from '../tx-variants';\n\nconst TERMS_AND_CONDITIONS = 'https://static.payu.com/sites/terms/files/payu_privacy_policy_sk.pdf';\nconst ICON = 'bankTransfer_IBAN';\n\nclass OnlineBankingSKElement extends IssuerListContainer {\n public static type = TxVariants.onlineBanking_SK;\n\n private static termsAndConditions = {\n translationKey: 'onlineBanking.termsAndConditions',\n urls: [TERMS_AND_CONDITIONS]\n };\n\n formatProps(props) {\n return {\n ...super.formatProps(props),\n showImage: true,\n termsAndConditions: OnlineBankingSKElement.termsAndConditions\n };\n }\n\n get icon(): string {\n return this.props.icon ?? this.resources.getImage()(ICON);\n }\n}\n\nexport default OnlineBankingSKElement;\n"],"names":["OnlineBankingSKElement","IssuerListContainer","formatProps","props","super","showImage","termsAndConditions","icon","this","resources","getImage","_define_property","type","TxVariants","onlineBanking_SK","translationKey","urls"],"mappings":"4OAMA,MAAMA,UAA+BC,EAQjCC,WAAAA,CAAYC,GACR,MAAO,IACAC,MAAMF,YAAYC,GACrBE,WAAW,EACXC,mBAAoBN,EAAuBM,mBAEnD,CAEA,QAAIC,GACA,OAAOC,KAAKL,MAAMI,MAAQC,KAAKC,UAAUC,UAAfF,CAnBrB,oBAoBT,EAjBAG,EADEX,EACYY,OAAOC,EAAWC,kBAEhCH,EAHEX,EAGaM,qBAAqB,CAChCS,eAAgB,mCAChBC,KAAM,CARe"}
@@ -1 +1 @@
1
- {"version":3,"file":"Oxxo.js","sources":["../../../../src/components/Oxxo/Oxxo.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport OxxoVoucherResult from './components/OxxoVoucherResult';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport { TxVariants } from '../tx-variants';\nimport { VoucherConfiguration } from '../internal/Voucher/types';\n\nexport class OxxoElement extends UIElement<VoucherConfiguration> {\n public static type = TxVariants.oxxo;\n\n protected static defaultProps = {\n name: 'Oxxo'\n };\n\n get isValid(): boolean {\n return true;\n }\n\n formatData() {\n return {\n paymentMethod: {\n type: this.props.type || OxxoElement.type\n }\n };\n }\n\n private handleRef = ref => {\n this.componentRef = ref;\n };\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n {this.props.reference ? (\n <OxxoVoucherResult ref={this.handleRef} {...this.props} onActionHandled={this.onActionHandled} />\n ) : (\n this.props.showPayButton &&\n this.payButton({\n ...this.props,\n classNameModifiers: ['standalone'],\n label: `${this.props.i18n.get('continueTo')} ${this.props.name}`,\n onClick: this.submit\n })\n )}\n </CoreProvider>\n );\n }\n}\n\nexport default OxxoElement;\n"],"names":["OxxoElement","UIElement","isValid","formatData","paymentMethod","type","this","props","render","h","CoreProvider","i18n","loadingContext","resources","reference","OxxoVoucherResult","ref","handleRef","onActionHandled","showPayButton","payButton","classNameModifiers","label","get","name","onClick","submit","_define_property","componentRef","TxVariants","oxxo","defaultProps"],"mappings":"gbAOO,MAAMA,UAAoBC,EAO7B,WAAIC,GACA,OAAO,CACX,CAEAC,UAAAA,GACI,MAAO,CACHC,cAAe,CACXC,KAAMC,KAAKC,MAAMF,MAAQL,EAAYK,MAGjD,CAMAG,MAAAA,GACI,OACIC,EAACC,EAAAA,CAAaC,KAAML,KAAKC,MAAMI,KAAMC,eAAgBN,KAAKC,MAAMK,eAAgBC,UAAWP,KAAKO,WAC3FP,KAAKC,MAAMO,UACRL,EAACM,EAAAA,CAAkBC,IAAKV,KAAKW,aAAeX,KAAKC,MAAOW,gBAAiBZ,KAAKY,kBAE9EZ,KAAKC,MAAMY,eACXb,KAAKc,UAAU,IACRd,KAAKC,MACRc,mBAAoB,CAAC,cACrBC,MAAO,GAAGhB,KAAKC,MAAMI,KAAKY,IAAI,iBAAiBjB,KAAKC,MAAMiB,OAC1DC,QAASnB,KAAKoB,SAKlC,+BApBAC,EAAArB,KAAQW,aAAYD,IAChBV,KAAKsB,aAAeZ,CAAAA,KAnBxBW,EADS3B,EACKK,OAAOwB,EAAWC,MAEhCH,EAHS3B,EAGQ+B,eAAe,CAC5BP,KAAM"}
1
+ {"version":3,"file":"Oxxo.js","sources":["../../../../src/components/Oxxo/Oxxo.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport OxxoVoucherResult from './components/OxxoVoucherResult';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport { TxVariants } from '../tx-variants';\nimport { VoucherConfiguration } from '../internal/Voucher/types';\n\nexport class OxxoElement extends UIElement<VoucherConfiguration> {\n public static type = TxVariants.oxxo;\n\n protected static defaultProps = {\n name: 'Oxxo'\n };\n\n get isValid(): boolean {\n return true;\n }\n\n formatData() {\n return {\n paymentMethod: {\n type: this.props.type || OxxoElement.type\n }\n };\n }\n\n private handleRef = ref => {\n this.componentRef = ref;\n };\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n {this.props.reference ? (\n <OxxoVoucherResult ref={this.handleRef} {...this.props} onActionHandled={this.onActionHandled} />\n ) : (\n this.props.showPayButton &&\n this.payButton({\n ...this.props,\n classNameModifiers: ['standalone'],\n label: `${this.props.i18n.get('continueTo')} ${this.props.name}`,\n onClick: this.submit\n })\n )}\n </CoreProvider>\n );\n }\n}\n\nexport default OxxoElement;\n"],"names":["OxxoElement","UIElement","isValid","formatData","paymentMethod","type","this","props","render","h","CoreProvider","i18n","loadingContext","resources","reference","OxxoVoucherResult","ref","handleRef","onActionHandled","showPayButton","payButton","classNameModifiers","label","get","name","onClick","submit","super","args","_define_property","componentRef","TxVariants","oxxo","defaultProps"],"mappings":"gbAOO,MAAMA,UAAoBC,EAO7B,WAAIC,GACA,OAAO,CACX,CAEAC,UAAAA,GACI,MAAO,CACHC,cAAe,CACXC,KAAMC,KAAKC,MAAMF,MAAQL,EAAYK,MAGjD,CAMAG,MAAAA,GACI,OACIC,EAACC,EAAAA,CAAaC,KAAML,KAAKC,MAAMI,KAAMC,eAAgBN,KAAKC,MAAMK,eAAgBC,UAAWP,KAAKO,WAC3FP,KAAKC,MAAMO,UACRL,EAACM,EAAAA,CAAkBC,IAAKV,KAAKW,aAAeX,KAAKC,MAAOW,gBAAiBZ,KAAKY,kBAE9EZ,KAAKC,MAAMY,eACXb,KAAKc,UAAU,IACRd,KAAKC,MACRc,mBAAoB,CAAC,cACrBC,MAAO,GAAGhB,KAAKC,MAAMI,KAAKY,IAAI,iBAAiBjB,KAAKC,MAAMiB,OAC1DC,QAASnB,KAAKoB,SAKlC,mBApBAC,SAAAC,GAAAC,EAAAvB,KAAQW,aAAYD,IAChBV,KAAKwB,aAAed,CAAAA,KAnBxBa,EADS7B,EACKK,OAAO0B,EAAWC,MAEhCH,EAHS7B,EAGQiC,eAAe,CAC5BT,KAAM"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../external/preact/dist/preact.js";import r from"../../../internal/Voucher/Voucher.js";import{useCoreContext as t}from"../../../../core/Context/CoreProvider.js";import o from"../../../../core/Context/useImage.js";import{extractCommonPropsForVoucher as a}from"../../../internal/Voucher/utils.js";const n=n=>{const{i18n:c,loadingContext:l}=t(),i=o(),{alternativeReference:p,reference:s,expiresAt:u,merchantReference:d,downloadUrl:m}=n,f=`${l}barcode.shtml?data=${s}&barcodeType=BT_Code128C&fileType=png`,h=[...u?[{label:c.get("voucher.expirationDate"),value:c.date(u)}]:[],...d?[{label:c.get("voucher.shopperReference"),value:d}]:[],...p?[{label:c.get("voucher.alternativeReference"),value:p}]:[]];return e(r,{...a({props:n,i18n:c,introKey:"voucher.introduction",getImage:i()}),barcode:f,copyBtn:!0,downloadUrl:m,voucherDetails:h})};export{n as default};
1
+ import{createElement as e}from"../../../../external/preact/dist/preact.js";import r from"../../../internal/Voucher/Voucher.js";import{useCoreContext as t}from"../../../../core/Context/CoreProvider.js";import o from"../../../../core/Context/useImage.js";import{extractCommonPropsForVoucher as a}from"../../../internal/Voucher/utils.js";const n=n=>{const{i18n:c,loadingContext:i}=t(),l=o(),{alternativeReference:p,reference:u,expiresAt:s,merchantReference:d,downloadUrl:m}=n,v=`${i}utility/v1/barcode.png?data=${u}&type=code128c&clientKey=${n.clientKey}`,f=[...s?[{label:c.get("voucher.expirationDate"),value:c.date(s)}]:[],...d?[{label:c.get("voucher.shopperReference"),value:d}]:[],...p?[{label:c.get("voucher.alternativeReference"),value:p}]:[]];return e(r,{...a({props:n,i18n:c,introKey:"voucher.introduction",getImage:l()}),barcode:v,copyBtn:!0,downloadUrl:m,voucherDetails:f})};export{n as default};
2
2
  //# sourceMappingURL=OxxoVoucherResult.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OxxoVoucherResult.js","sources":["../../../../../../src/components/Oxxo/components/OxxoVoucherResult/OxxoVoucherResult.tsx"],"sourcesContent":["import { h } from 'preact';\nimport Voucher from '../../../../components/internal/Voucher';\nimport { VoucherDetail } from '../../../internal/Voucher/types';\n\nimport { useCoreContext } from '../../../../core/Context/CoreProvider';\nimport { OxxoVoucherResultProps } from '../../types';\nimport './OxxoVoucherResult.scss';\nimport useImage from '../../../../core/Context/useImage';\nimport { extractCommonPropsForVoucher } from '../../../internal/Voucher/utils';\n\nconst OxxoVoucherResult = (props: OxxoVoucherResultProps) => {\n const { i18n, loadingContext } = useCoreContext();\n const getImage = useImage();\n const { alternativeReference, reference, expiresAt, merchantReference, downloadUrl } = props;\n\n const barcodeUrl = `${loadingContext}barcode.shtml?data=${reference}&barcodeType=BT_Code128C&fileType=png`;\n const voucherDetails: VoucherDetail[] = [\n ...(expiresAt\n ? [\n {\n label: i18n.get('voucher.expirationDate'),\n value: i18n.date(expiresAt)\n }\n ]\n : []),\n ...(merchantReference\n ? [\n {\n label: i18n.get('voucher.shopperReference'),\n value: merchantReference\n }\n ]\n : []),\n ...(alternativeReference\n ? [\n {\n label: i18n.get('voucher.alternativeReference'),\n value: alternativeReference\n }\n ]\n : [])\n ];\n\n return (\n <Voucher\n {...extractCommonPropsForVoucher({ props, i18n, introKey: 'voucher.introduction', getImage: getImage() })}\n barcode={barcodeUrl}\n copyBtn\n downloadUrl={downloadUrl}\n voucherDetails={voucherDetails}\n />\n );\n};\n\nexport default OxxoVoucherResult;\n"],"names":["OxxoVoucherResult","props","i18n","loadingContext","useCoreContext","getImage","useImage","alternativeReference","reference","expiresAt","merchantReference","downloadUrl","barcodeUrl","voucherDetails","label","get","value","date","h","Voucher","extractCommonPropsForVoucher","introKey","barcode","copyBtn"],"mappings":"+UAUA,MAAMA,EAAqBC,IACvB,MAAMC,KAAEA,EAAIC,eAAEA,GAAmBC,IAC3BC,EAAWC,KACXC,qBAAEA,EAAoBC,UAAEA,EAASC,UAAEA,EAASC,kBAAEA,EAAiBC,YAAEA,GAAgBV,EAEjFW,EAAa,GAAGT,uBAAoCK,yCACpDK,EAAkC,IAChCJ,EACE,CACI,CACIK,MAAOZ,EAAKa,IAAI,0BAChBC,MAAOd,EAAKe,KAAKR,KAGzB,MACFC,EACE,CACI,CACII,MAAOZ,EAAKa,IAAI,4BAChBC,MAAON,IAGf,MACFH,EACE,CACI,CACIO,MAAOZ,EAAKa,IAAI,gCAChBC,MAAOT,IAGf,IAGV,OACIW,EAACC,EAAAA,IACOC,EAA6B,CAAEnB,QAAOC,OAAMmB,SAAU,uBAAwBhB,SAAUA,MAC5FiB,QAASV,EACTW,SAAAA,EACAZ,YAAaA,EACbE,eAAgBA"}
1
+ {"version":3,"file":"OxxoVoucherResult.js","sources":["../../../../../../src/components/Oxxo/components/OxxoVoucherResult/OxxoVoucherResult.tsx"],"sourcesContent":["import { h } from 'preact';\nimport Voucher from '../../../../components/internal/Voucher';\nimport { VoucherDetail } from '../../../internal/Voucher/types';\n\nimport { useCoreContext } from '../../../../core/Context/CoreProvider';\nimport { OxxoVoucherResultProps } from '../../types';\nimport './OxxoVoucherResult.scss';\nimport useImage from '../../../../core/Context/useImage';\nimport { extractCommonPropsForVoucher } from '../../../internal/Voucher/utils';\n\nconst OxxoVoucherResult = (props: OxxoVoucherResultProps) => {\n const { i18n, loadingContext } = useCoreContext();\n const getImage = useImage();\n const { alternativeReference, reference, expiresAt, merchantReference, downloadUrl } = props;\n\n const barcodeUrl = `${loadingContext}utility/v1/barcode.png?data=${reference}&type=code128c&clientKey=${props.clientKey}`;\n\n const voucherDetails: VoucherDetail[] = [\n ...(expiresAt\n ? [\n {\n label: i18n.get('voucher.expirationDate'),\n value: i18n.date(expiresAt)\n }\n ]\n : []),\n ...(merchantReference\n ? [\n {\n label: i18n.get('voucher.shopperReference'),\n value: merchantReference\n }\n ]\n : []),\n ...(alternativeReference\n ? [\n {\n label: i18n.get('voucher.alternativeReference'),\n value: alternativeReference\n }\n ]\n : [])\n ];\n\n return (\n <Voucher\n {...extractCommonPropsForVoucher({ props, i18n, introKey: 'voucher.introduction', getImage: getImage() })}\n barcode={barcodeUrl}\n copyBtn\n downloadUrl={downloadUrl}\n voucherDetails={voucherDetails}\n />\n );\n};\n\nexport default OxxoVoucherResult;\n"],"names":["OxxoVoucherResult","props","i18n","loadingContext","useCoreContext","getImage","useImage","alternativeReference","reference","expiresAt","merchantReference","downloadUrl","barcodeUrl","clientKey","voucherDetails","label","get","value","date","h","Voucher","extractCommonPropsForVoucher","introKey","barcode","copyBtn"],"mappings":"+UAUA,MAAMA,EAAqBC,IACvB,MAAMC,KAAEA,EAAIC,eAAEA,GAAmBC,IAC3BC,EAAWC,KACXC,qBAAEA,EAAoBC,UAAEA,EAASC,UAAEA,EAASC,kBAAEA,EAAiBC,YAAEA,GAAgBV,EAEjFW,EAAa,GAAGT,gCAA6CK,6BAAqCP,EAAMY,YAExGC,EAAkC,IAChCL,EACE,CACI,CACIM,MAAOb,EAAKc,IAAI,0BAChBC,MAAOf,EAAKgB,KAAKT,KAGzB,MACFC,EACE,CACI,CACIK,MAAOb,EAAKc,IAAI,4BAChBC,MAAOP,IAGf,MACFH,EACE,CACI,CACIQ,MAAOb,EAAKc,IAAI,gCAChBC,MAAOV,IAGf,IAGV,OACIY,EAACC,EAAAA,IACOC,EAA6B,CAAEpB,QAAOC,OAAMoB,SAAU,uBAAwBjB,SAAUA,MAC5FkB,QAASX,EACTY,SAAAA,EACAb,YAAaA,EACbG,eAAgBA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Paypal.js","sources":["../../../../src/components/PayPal/Paypal.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport PaypalComponent from './components/PaypalComponent';\nimport defaultProps from './defaultProps';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport AdyenCheckoutError from '../../core/Errors/AdyenCheckoutError';\nimport { ERRORS } from './constants';\nimport { TxVariants } from '../tx-variants';\nimport { formatPaypalOrderContactToAdyenFormat } from './utils/format-paypal-order-contact-to-adyen-format';\n\nimport type { ICore } from '../../core/types';\nimport type { PaymentAction } from '../../types/global-types';\nimport type { Intent, PayPalConfiguration } from './types';\n\nimport './Paypal.scss';\nimport { SendAnalyticsObject } from '../../core/Analytics/types';\n\nclass PaypalElement extends UIElement<PayPalConfiguration> {\n public static type = TxVariants.paypal;\n public static subtype = 'sdk';\n\n public paymentData: string = null;\n\n private resolve = null;\n private reject = null;\n\n protected static defaultProps = defaultProps;\n\n constructor(checkout: ICore, props?: PayPalConfiguration) {\n super(checkout, props);\n this.handleSubmit = this.handleSubmit.bind(this);\n this.handleOnShippingAddressChange = this.handleOnShippingAddressChange.bind(this);\n this.handleOnShippingOptionsChange = this.handleOnShippingOptionsChange.bind(this);\n }\n\n formatProps(props: PayPalConfiguration): PayPalConfiguration {\n const merchantId = props.configuration?.merchantId;\n const intentFromConfig = props.configuration?.intent;\n const isZeroAuth = props.amount?.value === 0;\n const intent: Intent = isZeroAuth ? 'tokenize' : props.intent || intentFromConfig;\n const vault = intent === 'tokenize' || props.vault;\n\n const displayContinueToReviewPageButton = props.userAction === 'continue';\n\n return {\n ...props,\n commit: displayContinueToReviewPageButton ? false : props.commit,\n vault,\n configuration: {\n intent,\n merchantId\n }\n };\n }\n\n protected submitAnalytics(analyticsObj: SendAnalyticsObject) {\n // Analytics will need to know about this.props.isExpress & this.props.expressPage\n super.submitAnalytics({ ...analyticsObj }, this.props);\n }\n\n public submit = () => {\n this.handleError(new AdyenCheckoutError('IMPLEMENTATION_ERROR', ERRORS.SUBMIT_NOT_SUPPORTED));\n };\n\n /**\n * Updates the paymentData value. It must be used in the PayPal Express flow, when patching the amount\n * @param paymentData - Payment data value\n */\n public updatePaymentData(paymentData: string): void {\n if (!paymentData) console.warn('PayPal - Updating payment data with an invalid value');\n this.paymentData = paymentData;\n }\n\n /**\n * Formats the component data output\n */\n protected formatData() {\n const { isExpress, userAction } = this.props;\n\n return {\n paymentMethod: {\n type: PaypalElement.type,\n userAction,\n subtype: isExpress ? 'express' : PaypalElement.subtype\n }\n };\n }\n\n public handleAction = (action: PaymentAction) => {\n return this.updateWithAction(action);\n };\n\n public updateWithAction = (action: PaymentAction) => {\n if (action.paymentMethodType !== this.type) throw new Error('Invalid Action');\n\n if (action.paymentData) {\n this.paymentData = action.paymentData;\n }\n\n if (action.sdkData && action.sdkData.token) {\n this.onActionHandled({ componentType: this.type, actionDescription: 'sdk-loaded', originalAction: action });\n this.handleResolve(action.sdkData.token);\n } else {\n this.handleReject(ERRORS.NO_TOKEN_PROVIDED);\n }\n\n return null;\n };\n\n /**\n * Dropin Validation\n *\n * @remarks\n * Paypal does not require any specific Dropin validation\n */\n get isValid() {\n return true;\n }\n\n private handleOnApprove = (data: any, actions: any): Promise<void> | void => {\n const { onAuthorized } = this.props;\n const state = { data: { details: data, paymentData: this.paymentData } };\n\n if (!onAuthorized) {\n this.handleAdditionalDetails(state);\n return;\n }\n\n return actions.order\n .get()\n .then((paypalOrder: any) => {\n const billingAddress = formatPaypalOrderContactToAdyenFormat(paypalOrder?.payer);\n const deliveryAddress = formatPaypalOrderContactToAdyenFormat(paypalOrder?.purchase_units?.[0].shipping, true);\n\n this.setState({\n authorizedEvent: paypalOrder,\n ...(billingAddress && { billingAddress }),\n ...(deliveryAddress && { deliveryAddress })\n });\n\n return new Promise<void>((resolve, reject) =>\n onAuthorized(\n {\n authorizedEvent: paypalOrder,\n ...(billingAddress && { billingAddress }),\n ...(deliveryAddress && { deliveryAddress })\n },\n { resolve, reject }\n )\n );\n })\n .then(() => this.handleAdditionalDetails(state))\n .catch(error => this.handleError(new AdyenCheckoutError('ERROR', 'Something went wrong while parsing PayPal Order', { cause: error })));\n };\n\n handleResolve(token: string) {\n if (!this.resolve) return this.handleError(new AdyenCheckoutError('ERROR', ERRORS.WRONG_INSTANCE));\n this.resolve(token);\n }\n\n handleReject(errorMessage: string) {\n if (!this.reject) return this.handleError(new AdyenCheckoutError('ERROR', ERRORS.WRONG_INSTANCE));\n this.reject(new Error(errorMessage));\n }\n\n private handleSubmit(): Promise<void> {\n super.submit();\n\n return new Promise((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n }\n\n /**\n * If the merchant provides the 'onShippingAddressChange' callback, then this method is used as a wrapper to it, in order\n * to expose to the merchant the 'component' instance. The merchant needs the 'component' in order to manipulate the\n * paymentData\n *\n * @param data - PayPal data\n * @param actions - PayPal actions.\n */\n private handleOnShippingAddressChange(data: any, actions: any): Promise<void> {\n return this.props.onShippingAddressChange(data, actions, this);\n }\n\n /**\n * If the merchant provides the 'onShippingOptionsChange' callback, then this method is used as a wrapper to it, in order\n * to expose to the merchant the 'component' instance. The merchant needs the 'component' in order to manipulate the\n * paymentData\n *\n * @param data - PayPal data\n * @param actions - PayPal actions.\n */\n private handleOnShippingOptionsChange(data: any, actions: any): Promise<void> {\n return this.props.onShippingOptionsChange(data, actions, this);\n }\n\n render() {\n if (!this.props.showPayButton) return null;\n\n const { onShippingAddressChange, onShippingOptionsChange, ...rest } = this.props;\n\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <PaypalComponent\n ref={ref => {\n this.componentRef = ref;\n }}\n {...rest}\n {...(onShippingAddressChange && { onShippingAddressChange: this.handleOnShippingAddressChange })}\n {...(onShippingOptionsChange && { onShippingOptionsChange: this.handleOnShippingOptionsChange })}\n onCancel={() => this.handleError(new AdyenCheckoutError('CANCEL'))}\n onChange={this.setState}\n onApprove={this.handleOnApprove}\n onError={error => {\n this.handleError(new AdyenCheckoutError('ERROR', error.toString(), { cause: error }));\n }}\n onScriptLoadFailure={error => this.handleError(error)}\n onSubmit={this.handleSubmit}\n />\n </CoreProvider>\n );\n }\n}\n\nexport default PaypalElement;\n"],"names":["PaypalElement","UIElement","formatProps","props","merchantId","configuration","intentFromConfig","intent","amount","value","vault","displayContinueToReviewPageButton","userAction","commit","submitAnalytics","analyticsObj","super","this","updatePaymentData","paymentData","console","warn","formatData","isExpress","paymentMethod","type","subtype","isValid","handleResolve","token","resolve","handleError","AdyenCheckoutError","ERRORS","WRONG_INSTANCE","handleReject","errorMessage","reject","Error","handleSubmit","submit","Promise","handleOnShippingAddressChange","data","actions","onShippingAddressChange","handleOnShippingOptionsChange","onShippingOptionsChange","render","showPayButton","rest","h","CoreProvider","i18n","loadingContext","resources","PaypalComponent","ref","componentRef","onCancel","onChange","setState","onApprove","handleOnApprove","onError","error","toString","cause","onScriptLoadFailure","onSubmit","constructor","checkout","_define_property","SUBMIT_NOT_SUPPORTED","handleAction","action","updateWithAction","paymentMethodType","sdkData","onActionHandled","componentType","actionDescription","originalAction","NO_TOKEN_PROVIDED","onAuthorized","state","details","order","get","then","paypalOrder","billingAddress","formatPaypalOrderContactToAdyenFormat","payer","deliveryAddress","purchase_units","shipping","authorizedEvent","handleAdditionalDetails","catch","bind","TxVariants","paypal","defaultProps"],"mappings":"2oBAiBA,MAAMA,UAAsBC,EAkBxBC,WAAAA,CAAYC,GACR,MAAMC,EAAaD,EAAME,eAAeD,WAClCE,EAAmBH,EAAME,eAAeE,OAExCA,EADqC,IAAxBJ,EAAMK,QAAQC,MACG,WAAaN,EAAMI,QAAUD,EAC3DI,EAAmB,aAAXH,GAAyBJ,EAAMO,MAEvCC,EAAyD,aAArBR,EA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E1C,KAAM,CAAE2C,QAAS3C,EAAMxB,YAAaF,KAAKE,cAEzD,GAAKiE,EAKL,OAAOxC,EAAQ2C,MACVC,MACAC,MAAMC,IACH,MAAMC,EAAiBC,EAAsCF,GAAaG,OACpEC,EAAkBF,EAAsCF,GAAaK,iBAAiB,GAAGC,UAAU,GAQzG,OANA/E,KAAK4C,SAAS,CACVoC,gBAAiBP,KACbC,GAAkB,CAAEA,qBACpBG,GAAmB,CAAEA,qBAGtB,IAAIrD,SAAc,CAACX,EAASO,IAC/B+C,EACI,CACIa,gBAAiBP,KACbC,GAAkB,CAAEA,qBACpBG,GAAmB,CAAEA,oBAE7B,CAAEhE,UAASO,YAAO,IAI7BoD,MAAK,IAAMxE,KAAKiF,wBAAwBb,KACxCc,OAAMlC,GAAShD,KAAKc,YAAY,IAAIC,EAAmB,QAAS,kDAAmD,CAAEmC,MAAOF,OA5B7HhD,KAAKiF,wBAAwBb,EA4BsG,IA1HvIpE,KAAKsB,aAAetB,KAAKsB,aAAa6D,KAAKnF,MAC3CA,KAAKyB,8BAAgCzB,KAAKyB,8BAA8B0D,KAAKnF,MAC7EA,KAAK6B,8BAAgC7B,KAAK6B,8BAA8BsD,KAAKnF,KACjF,EAfAuD,EADExE,EACYyB,OAAO4E,EAAWC,QAChC9B,EAFExE,EAEY0B,UAAU,OAOxB8C,EATExE,EASeuG,eAAeA"}
1
+ {"version":3,"file":"Paypal.js","sources":["../../../../src/components/PayPal/Paypal.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport PaypalComponent from './components/PaypalComponent';\nimport defaultProps from './defaultProps';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport AdyenCheckoutError from '../../core/Errors/AdyenCheckoutError';\nimport { ERRORS } from './constants';\nimport { TxVariants } from '../tx-variants';\nimport { formatPaypalOrderContactToAdyenFormat } from './utils/format-paypal-order-contact-to-adyen-format';\n\nimport type { ICore } from '../../core/types';\nimport type { PaymentAction } from '../../types/global-types';\nimport type { Intent, PayPalConfiguration } from './types';\n\nimport './Paypal.scss';\nimport { SendAnalyticsObject } from '../../core/Analytics/types';\n\nclass PaypalElement extends UIElement<PayPalConfiguration> {\n public static type = TxVariants.paypal;\n public static subtype = 'sdk';\n\n public paymentData: string = null;\n\n private resolve = null;\n private reject = null;\n\n protected static defaultProps = defaultProps;\n\n constructor(checkout: ICore, props?: PayPalConfiguration) {\n super(checkout, props);\n this.handleSubmit = this.handleSubmit.bind(this);\n this.handleOnShippingAddressChange = this.handleOnShippingAddressChange.bind(this);\n this.handleOnShippingOptionsChange = this.handleOnShippingOptionsChange.bind(this);\n }\n\n formatProps(props: PayPalConfiguration): PayPalConfiguration {\n const merchantId = props.configuration?.merchantId;\n const intentFromConfig = props.configuration?.intent;\n const isZeroAuth = props.amount?.value === 0;\n const intent: Intent = isZeroAuth ? 'tokenize' : props.intent || intentFromConfig;\n const vault = intent === 'tokenize' || props.vault;\n\n const displayContinueToReviewPageButton = props.userAction === 'continue';\n\n return {\n ...props,\n commit: displayContinueToReviewPageButton ? false : props.commit,\n vault,\n configuration: {\n intent,\n merchantId\n }\n };\n }\n\n protected submitAnalytics(analyticsObj: SendAnalyticsObject) {\n // Analytics will need to know about this.props.isExpress & this.props.expressPage\n super.submitAnalytics({ ...analyticsObj }, this.props);\n }\n\n public submit = () => {\n this.handleError(new AdyenCheckoutError('IMPLEMENTATION_ERROR', ERRORS.SUBMIT_NOT_SUPPORTED));\n };\n\n /**\n * Updates the paymentData value. It must be used in the PayPal Express flow, when patching the amount\n * @param paymentData - Payment data value\n */\n public updatePaymentData(paymentData: string): void {\n if (!paymentData) console.warn('PayPal - Updating payment data with an invalid value');\n this.paymentData = paymentData;\n }\n\n /**\n * Formats the component data output\n */\n protected formatData() {\n const { isExpress, userAction } = this.props;\n\n return {\n paymentMethod: {\n type: PaypalElement.type,\n userAction,\n subtype: isExpress ? 'express' : PaypalElement.subtype\n }\n };\n }\n\n public handleAction = (action: PaymentAction) => {\n return this.updateWithAction(action);\n };\n\n public updateWithAction = (action: PaymentAction) => {\n if (action.paymentMethodType !== this.type) throw new Error('Invalid Action');\n\n if (action.paymentData) {\n this.paymentData = action.paymentData;\n }\n\n if (action.sdkData && action.sdkData.token) {\n this.onActionHandled({ componentType: this.type, actionDescription: 'sdk-loaded', originalAction: action });\n this.handleResolve(action.sdkData.token);\n } else {\n this.handleReject(ERRORS.NO_TOKEN_PROVIDED);\n }\n\n return null;\n };\n\n /**\n * Dropin Validation\n *\n * @remarks\n * Paypal does not require any specific Dropin validation\n */\n get isValid() {\n return true;\n }\n\n private handleOnApprove = (data: any, actions: any): Promise<void> | void => {\n const { onAuthorized } = this.props;\n const state = { data: { details: data, paymentData: this.paymentData } };\n\n if (!onAuthorized) {\n this.handleAdditionalDetails(state);\n return;\n }\n\n return actions.order\n .get()\n .then((paypalOrder: any) => {\n const billingAddress = formatPaypalOrderContactToAdyenFormat(paypalOrder?.payer);\n const deliveryAddress = formatPaypalOrderContactToAdyenFormat(paypalOrder?.purchase_units?.[0].shipping, true);\n\n this.setState({\n authorizedEvent: paypalOrder,\n ...(billingAddress && { billingAddress }),\n ...(deliveryAddress && { deliveryAddress })\n });\n\n return new Promise<void>((resolve, reject) =>\n onAuthorized(\n {\n authorizedEvent: paypalOrder,\n ...(billingAddress && { billingAddress }),\n ...(deliveryAddress && { deliveryAddress })\n },\n { resolve, reject }\n )\n );\n })\n .then(() => this.handleAdditionalDetails(state))\n .catch(error => this.handleError(new AdyenCheckoutError('ERROR', 'Something went wrong while parsing PayPal Order', { cause: error })));\n };\n\n handleResolve(token: string) {\n if (!this.resolve) return this.handleError(new AdyenCheckoutError('ERROR', ERRORS.WRONG_INSTANCE));\n this.resolve(token);\n }\n\n handleReject(errorMessage: string) {\n if (!this.reject) return this.handleError(new AdyenCheckoutError('ERROR', ERRORS.WRONG_INSTANCE));\n this.reject(new Error(errorMessage));\n }\n\n private handleSubmit(): Promise<void> {\n super.submit();\n\n return new Promise((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n }\n\n /**\n * If the merchant provides the 'onShippingAddressChange' callback, then this method is used as a wrapper to it, in order\n * to expose to the merchant the 'component' instance. The merchant needs the 'component' in order to manipulate the\n * paymentData\n *\n * @param data - PayPal data\n * @param actions - PayPal actions.\n */\n private handleOnShippingAddressChange(data: any, actions: any): Promise<void> {\n return this.props.onShippingAddressChange(data, actions, this);\n }\n\n /**\n * If the merchant provides the 'onShippingOptionsChange' callback, then this method is used as a wrapper to it, in order\n * to expose to the merchant the 'component' instance. The merchant needs the 'component' in order to manipulate the\n * paymentData\n *\n * @param data - PayPal data\n * @param actions - PayPal actions.\n */\n private handleOnShippingOptionsChange(data: any, actions: any): Promise<void> {\n return this.props.onShippingOptionsChange(data, actions, this);\n }\n\n render() {\n if (!this.props.showPayButton) return null;\n\n const { onShippingAddressChange, onShippingOptionsChange, ...rest } = this.props;\n\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <PaypalComponent\n ref={ref => {\n this.componentRef = ref;\n }}\n {...rest}\n {...(onShippingAddressChange && { onShippingAddressChange: this.handleOnShippingAddressChange })}\n {...(onShippingOptionsChange && { onShippingOptionsChange: this.handleOnShippingOptionsChange })}\n onCancel={() => this.handleError(new AdyenCheckoutError('CANCEL'))}\n onChange={this.setState}\n onApprove={this.handleOnApprove}\n onError={error => {\n this.handleError(new AdyenCheckoutError('ERROR', error.toString(), { cause: error }));\n }}\n onScriptLoadFailure={error => this.handleError(error)}\n onSubmit={this.handleSubmit}\n />\n </CoreProvider>\n );\n }\n}\n\nexport default PaypalElement;\n"],"names":["PaypalElement","UIElement","formatProps","props","merchantId","configuration","intentFromConfig","intent","amount","value","vault","displayContinueToReviewPageButton","userAction","commit","submitAnalytics","analyticsObj","super","this","updatePaymentData","paymentData","console","warn","formatData","isExpress","paymentMethod","type","subtype","isValid","handleResolve","token","resolve","handleError","AdyenCheckoutError","ERRORS","WRONG_INSTANCE","handleReject","errorMessage","reject","Error","handleSubmit","submit","Promise","handleOnShippingAddressChange","data","actions","onShippingAddressChange","handleOnShippingOptionsChange","onShippingOptionsChange","render","showPayButton","rest","h","CoreProvider","i18n","loadingContext","resources","PaypalComponent","ref","componentRef","onCancel","onChange","setState","onApprove","handleOnApprove","onError","error","toString","cause","onScriptLoadFailure","onSubmit","constructor","checkout","_define_property","SUBMIT_NOT_SUPPORTED","handleAction","action","updateWithAction","paymentMethodType","sdkData","onActionHandled","componentType","actionDescription","originalAction","NO_TOKEN_PROVIDED","onAuthorized","state","details","order","get","then","paypalOrder","billingAddress","formatPaypalOrderContactToAdyenFormat","payer","deliveryAddress","purchase_units","shipping","authorizedEvent","handleAdditionalDetails","catch","bind","TxVariants","paypal","defaultProps"],"mappings":"2oBAiBA,MAAMA,UAAsBC,EAkBxBC,WAAAA,CAAYC,GACR,MAAMC,EAAaD,EAAME,eAAeD,WAClCE,EAAmBH,EAAME,eAAeE,OAExCA,EADqC,IAAxBJ,EAAMK,QAAQC,MACG,WAAaN,EAAMI,QAAUD,EAC3DI,EAAmB,aAAXH,GAAyBJ,EAAMO,MAEvCC,EAAyD,aAArBR,EAAMS,WAEhD,MAAO,IACAT,EACHU,QAAQF,GAA4CR,EAAMU,OAC1DH,QACAL,cAAe,CACXE,SACAH,cAGZ,CAEUU,eAAAA,CAAgBC,GAEtBC,MAAMF,gBAAgB,IAAKC,GAAgBE,KAAKd,MACpD,CAUOe,iBAAAA,CAAkBC,GAChBA,GAAaC,QAAQC,KAAK,wDAC/BJ,KAAKE,YAAcA,CACvB,CAKA,UAAAG,GACI,MAAMC,UAAEA,EAASX,WAAEA,GAAeK,KAAKd,MAEvC,MAAO,CACHqB,cAAe,CACXC,KAAMzB,EAAcyB,KACpBb,aACAc,QAASH,EAAY,UAAYvB,EAAc0B,SAG3D,CA6BA,WAAIC,GACA,OAAO,CACX,CAsCAC,aAAAA,CAAcC,GACV,IAAKZ,KAAKa,QAAS,OAAOb,KAAKc,YAAY,IAAIC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AS,kDAAmD,CAAEmC,MAAOF,OA5B7HhD,KAAKiF,wBAAwBb,EA4BsG,IA1HvIpE,KAAKsB,aAAetB,KAAKsB,aAAa6D,KAAKnF,MAC3CA,KAAKyB,8BAAgCzB,KAAKyB,8BAA8B0D,KAAKnF,MAC7EA,KAAK6B,8BAAgC7B,KAAK6B,8BAA8BsD,KAAKnF,KACjF,EAfAuD,EADExE,EACYyB,OAAO4E,EAAWC,QAChC9B,EAFExE,EAEY0B,UAAU,OAOxB8C,EATExE,EASeuG,eAAeA"}
@@ -1,2 +1,2 @@
1
- import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import{CoreProvider as r}from"../../core/Context/CoreProvider.js";import o from"./components/RedirectShopper/RedirectShopper.js";import s from"../internal/RedirectButton/RedirectButton.js";import{TxVariants as n}from"../tx-variants.js";import i from"../../utils/browserInfo.js";function p(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class a extends e{formatData(){return{paymentMethod:{type:this.type},browserInfo:this.browserInfo}}get isValid(){return!0}get browserInfo(){return i()}render(){return this.props.url&&this.props.method?t(o,{url:this.props.url,...this.props,onActionHandled:this.onActionHandled}):this.props.showPayButton?t(r,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(s,{...this.props,showPayButton:this.props.showPayButton,name:this.displayName,onSubmit:this.submit,payButton:this.payButton,ref:t=>{this.componentRef=t}})):null}}p(a,"type",n.redirect),p(a,"defaultProps",{type:a.type});export{a as default};
1
+ import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as r}from"../internal/UIElement/UIElement.js";import{CoreProvider as e}from"../../core/Context/CoreProvider.js";import o from"./components/RedirectShopper/RedirectShopper.js";import s from"../internal/RedirectButton/RedirectButton.js";import{TxVariants as n}from"../tx-variants.js";import i from"../../utils/browserInfo.js";import{ANALYTICS_EVENT as p,ANALYTICS_ERROR_TYPE as a,ANALYTICS_ERROR_CODE as c}from"../../core/Analytics/constants.js";function m(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}class d extends r{formatData(){return{paymentMethod:{type:this.type},browserInfo:this.browserInfo}}get isValid(){return!0}get browserInfo(){return i()}render(){return this.props.url&&this.props.method?t(o,{url:this.props.url,...this.props,onActionHandled:this.onActionHandled,onRedirectError:this.handleRedirectError}):this.props.showPayButton?t(e,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(s,{...this.props,showPayButton:this.props.showPayButton,name:this.displayName,onSubmit:this.submit,payButton:this.payButton,ref:t=>{this.componentRef=t}})):null}constructor(...t){super(...t),m(this,"handleRedirectError",(()=>{super.submitAnalytics({component:this.props.paymentMethodType,type:p.error,errorType:a.redirect,code:c.redirect})}))}}m(d,"type",n.redirect),m(d,"defaultProps",{type:d.type});export{d as default};
2
2
  //# sourceMappingURL=Redirect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Redirect.js","sources":["../../../../src/components/Redirect/Redirect.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport RedirectShopper from './components/RedirectShopper';\nimport RedirectButton from '../internal/RedirectButton';\nimport { TxVariants } from '../tx-variants';\nimport { RedirectConfiguration } from './types';\nimport collectBrowserInfo from '../../utils/browserInfo';\n\nclass RedirectElement extends UIElement<RedirectConfiguration> {\n public static type = TxVariants.redirect;\n\n public static defaultProps = {\n type: RedirectElement.type\n };\n\n formatData() {\n return {\n paymentMethod: {\n type: this.type\n },\n browserInfo: this.browserInfo\n };\n }\n\n get isValid() {\n return true;\n }\n\n get browserInfo() {\n return collectBrowserInfo();\n }\n\n render() {\n if (this.props.url && this.props.method) {\n return <RedirectShopper url={this.props.url} {...this.props} onActionHandled={this.onActionHandled} />;\n }\n\n if (this.props.showPayButton) {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <RedirectButton\n {...this.props}\n showPayButton={this.props.showPayButton}\n name={this.displayName}\n onSubmit={this.submit}\n payButton={this.payButton}\n ref={ref => {\n this.componentRef = ref;\n }}\n />\n </CoreProvider>\n );\n }\n\n return null;\n }\n}\n\nexport default RedirectElement;\n"],"names":["RedirectElement","UIElement","formatData","paymentMethod","type","this","browserInfo","isValid","collectBrowserInfo","render","props","url","method","h","RedirectShopper","onActionHandled","showPayButton","CoreProvider","i18n","loadingContext","resources","RedirectButton","name","displayName","onSubmit","submit","payButton","ref","componentRef","_define_property","TxVariants","redirect","defaultProps"],"mappings":"khBASA,MAAMA,UAAwBC,EAO1BC,UAAAA,GACI,MAAO,CACHC,cAAe,CACXC,KAAMC,KAAKD,MAEfE,YAAaD,KAAKC,YAE1B,CAEA,WAAIC,GACA,OAAO,CACX,CAEA,eAAID,GACA,OAAOE,GACX,CAEAC,MAAAA,GACI,OAAIJ,KAAKK,MAAMC,KAAON,KAAKK,MAAME,OACtBC,EAACC,EAAAA,CAAgBH,IAAKN,KAAKK,MAAMC,OAASN,KAAKK,MAAOK,gBAAiBV,KAAKU,kBAGnFV,KAAKK,MAAMM,cAEPH,EAACI,EAAAA,CAAaC,KAAMb,KAAKK,MAAMQ,KAAMC,eAAgBd,KAAKK,MAAMS,eAAgBC,UAAWf,KAAKe,WAC5FP,EAACQ,EAAAA,IACOhB,KAAKK,MACTM,cAAeX,KAAKK,MAAMM,cAC1BM,KAAMjB,KAAKkB,YACXC,SAAUnB,KAAKoB,OACfC,UAAWrB,KAAKqB,UAChBC,IAAKA,IACDtB,KAAKuB,aAAeD,CAAAA,KAOjC,IACX,EA9CAE,EADE7B,EACYI,OAAO0B,EAAWC,UAEhCF,EAHE7B,EAGYgC,eAAe,CACzB5B,KAAMJ,EAAgBI"}
1
+ {"version":3,"file":"Redirect.js","sources":["../../../../src/components/Redirect/Redirect.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport RedirectShopper from './components/RedirectShopper';\nimport RedirectButton from '../internal/RedirectButton';\nimport { TxVariants } from '../tx-variants';\nimport { RedirectConfiguration } from './types';\nimport collectBrowserInfo from '../../utils/browserInfo';\nimport { ANALYTICS_ERROR_CODE, ANALYTICS_ERROR_TYPE, ANALYTICS_EVENT } from '../../core/Analytics/constants';\n\nclass RedirectElement extends UIElement<RedirectConfiguration> {\n public static type = TxVariants.redirect;\n\n public static defaultProps = {\n type: RedirectElement.type\n };\n\n formatData() {\n return {\n paymentMethod: {\n type: this.type\n },\n browserInfo: this.browserInfo\n };\n }\n\n private handleRedirectError = () => {\n super.submitAnalytics({\n component: this.props.paymentMethodType,\n type: ANALYTICS_EVENT.error,\n errorType: ANALYTICS_ERROR_TYPE.redirect,\n code: ANALYTICS_ERROR_CODE.redirect\n });\n };\n\n get isValid() {\n return true;\n }\n\n get browserInfo() {\n return collectBrowserInfo();\n }\n\n render() {\n if (this.props.url && this.props.method) {\n return (\n <RedirectShopper\n url={this.props.url}\n {...this.props}\n onActionHandled={this.onActionHandled}\n onRedirectError={this.handleRedirectError}\n />\n );\n }\n\n if (this.props.showPayButton) {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <RedirectButton\n {...this.props}\n showPayButton={this.props.showPayButton}\n name={this.displayName}\n onSubmit={this.submit}\n payButton={this.payButton}\n ref={ref => {\n this.componentRef = ref;\n }}\n />\n </CoreProvider>\n );\n }\n\n return null;\n }\n}\n\nexport default RedirectElement;\n"],"names":["RedirectElement","UIElement","formatData","paymentMethod","type","this","browserInfo","isValid","collectBrowserInfo","render","props","url","method","h","RedirectShopper","onActionHandled","onRedirectError","handleRedirectError","showPayButton","CoreProvider","i18n","loadingContext","resources","RedirectButton","name","displayName","onSubmit","submit","payButton","ref","componentRef","super","args","_define_property","submitAnalytics","component","paymentMethodType","ANALYTICS_EVENT","error","errorType","ANALYTICS_ERROR_TYPE","redirect","code","ANALYTICS_ERROR_CODE","TxVariants","defaultProps"],"mappings":"0oBAUA,MAAMA,UAAwBC,EAO1BC,UAAAA,GACI,MAAO,CACHC,cAAe,CACXC,KAAMC,KAAKD,MAEfE,YAAaD,KAAKC,YAE1B,CAWA,WAAIC,GACA,OAAO,CACX,CAEA,eAAID,GACA,OAAOE,GACX,CAEAC,MAAAA,GACI,OAAIJ,KAAKK,MAAMC,KAAON,KAAKK,MAAME,OAEzBC,EAACC,EAAAA,CACGH,IAAKN,KAAKK,MAAMC,OACZN,KAAKK,MACTK,gBAAiBV,KAAKU,gBACtBC,gBAAiBX,KAAKY,sBAK9BZ,KAAKK,MAAMQ,cAEPL,EAACM,EAAAA,CAAaC,KAAMf,KAAKK,MAAMU,KAAMC,eAAgBhB,KAAKK,MAAMW,eAAgBC,UAAWjB,KAAKiB,WAC5FT,EAACU,EAAAA,IACOlB,KAAKK,MACTQ,cAAeb,KAAKK,MAAMQ,cAC1BM,KAAMnB,KAAKoB,YACXC,SAAUrB,KAAKsB,OACfC,UAAWvB,KAAKuB,UAChBC,IAAKA,IACDxB,KAAKyB,aAAeD,CAAAA,KAOjC,IACX,mBA/CAE,SAAAC,GAAAC,EAAA5B,KAAQY,uBAAsB,KAC1Bc,MAAMG,gBAAgB,CAClBC,UAAW9B,KAAKK,MAAM0B,kBACtBhC,KAAMiC,EAAgBC,MACtBC,UAAWC,EAAqBC,SAChCC,KAAMC,EAAqBF,UAC/B,KArBJR,EADEjC,EACYI,OAAOwC,EAAWH,UAEhCR,EAHEjC,EAGY6C,eAAe,CACzBzC,KAAMJ,EAAgBI"}
@@ -1,2 +1,2 @@
1
- import{Component as t,createElement as e}from"../../../../external/preact/dist/preact.js";import o from"../../../../utils/detectInIframeInSameOrigin.js";function r(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}class s extends t{componentDidMount(){new Promise(((t,e)=>{this.props.beforeRedirect(t,e,{url:this.props.url,method:this.props.method,...this.props.data?{data:this.props.data}:{}})})).then((()=>{this.props.onActionHandled?.({componentType:this.props.paymentMethodType,actionDescription:"performing-redirect"}),this.postForm?this.postForm.submit():this.props.redirectFromTopWhenInIframe&&o()?window.top.location.assign?.(this.props.url):window.location.assign(this.props.url)})).catch((()=>{}))}render({url:t,method:r,data:s={}}){return"POST"===r?e("form",{method:"post",action:t,style:{display:"none"},ref:t=>{this.postForm=t},...this.props.redirectFromTopWhenInIframe&&o()&&{target:"_top"}},Object.keys(s).map((t=>e("input",{type:"hidden",name:t,key:t,value:s[t]})))):null}constructor(...t){super(...t),r(this,"postForm",void 0)}}r(s,"defaultProps",{beforeRedirect:t=>t(),method:"GET"});export{s as default};
1
+ import{Component as e,createElement as t}from"../../../../external/preact/dist/preact.js";import r from"../../../../utils/detectInIframeInSameOrigin.js";function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class s extends e{componentDidMount(){new Promise(((e,t)=>{this.props.beforeRedirect(e,t,{url:this.props.url,method:this.props.method,...this.props.data?{data:this.props.data}:{}})})).then((()=>{this.props.onActionHandled?.({componentType:this.props.paymentMethodType,actionDescription:"performing-redirect"}),this.postForm?this.postForm.submit():this.props.redirectFromTopWhenInIframe&&r()?window.top.location.assign?.(this.props.url):window.location.assign(this.props.url)})).catch((()=>{this.props.onRedirectError()}))}render({url:e,method:o,data:s={}}){return"POST"===o?t("form",{method:"post","data-testid":"redirect-shopper-form",action:e,style:{display:"none"},ref:e=>{this.postForm=e},...this.props.redirectFromTopWhenInIframe&&r()&&{target:"_top"}},Object.keys(s).map((e=>t("input",{type:"hidden",name:e,key:e,value:s[e]})))):null}constructor(...e){super(...e),o(this,"postForm",void 0)}}o(s,"defaultProps",{beforeRedirect:e=>e(),onRedirectError:()=>{},method:"GET"});export{s as default};
2
2
  //# sourceMappingURL=RedirectShopper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RedirectShopper.js","sources":["../../../../../../src/components/Redirect/components/RedirectShopper/RedirectShopper.tsx"],"sourcesContent":["import { Component, h } from 'preact';\nimport detectInIframeInSameOrigin from '../../../../utils/detectInIframeInSameOrigin';\nimport { ActionHandledReturnObject } from '../../../../types/global-types';\n\ninterface RedirectShopperProps {\n beforeRedirect: (resolve, reject, url) => Promise<void>;\n url: string;\n method: 'GET' | 'POST';\n data?: any;\n redirectFromTopWhenInIframe?: boolean;\n paymentMethodType?: string;\n onActionHandled?: (rtnObj: ActionHandledReturnObject) => void;\n}\n\nclass RedirectShopper extends Component<RedirectShopperProps> {\n private postForm;\n public static defaultProps = {\n beforeRedirect: resolve => resolve(),\n method: 'GET'\n };\n\n componentDidMount() {\n const doRedirect = () => {\n // call callback\n this.props.onActionHandled?.({\n componentType: this.props.paymentMethodType,\n actionDescription: 'performing-redirect'\n });\n\n // perform redirect\n if (this.postForm) {\n this.postForm.submit();\n } else {\n if (this.props.redirectFromTopWhenInIframe && detectInIframeInSameOrigin()) {\n // if in an iframe and the config prop allows it - try to redirect from the top level window\n window.top.location.assign?.(this.props.url);\n } else {\n window.location.assign(this.props.url);\n }\n }\n };\n\n const dispatchEvent = new Promise(\n (resolve, reject) =>\n void this.props.beforeRedirect(resolve, reject, {\n url: this.props.url,\n method: this.props.method,\n ...(this.props.data ? { data: this.props.data } : {})\n })\n );\n\n dispatchEvent.then(doRedirect).catch(() => {});\n }\n\n render({ url, method, data = {} }) {\n if (method === 'POST') {\n return (\n <form\n method=\"post\"\n action={url}\n style={{ display: 'none' }}\n ref={ref => {\n this.postForm = ref;\n }}\n {...(this.props.redirectFromTopWhenInIframe && detectInIframeInSameOrigin() && { target: '_top' })}\n >\n {Object.keys(data).map(key => (\n <input type=\"hidden\" name={key} key={key} value={data[key]} />\n ))}\n </form>\n );\n }\n\n return null;\n }\n}\n\nexport default RedirectShopper;\n"],"names":["RedirectShopper","Component","componentDidMount","Promise","resolve","reject","this","props","beforeRedirect","url","method","data","then","onActionHandled","componentType","paymentMethodType","actionDescription","postForm","submit","redirectFromTopWhenInIframe","detectInIframeInSameOrigin","window","top","location","assign","catch","render","h","form","action","style","display","ref","target","Object","keys","map","key","input","type","name","value","_define_property","defaultProps"],"mappings":"iRAcA,MAAMA,UAAwBC,EAO1BC,iBAAAA,GAqB0B,IAAIC,SACtB,CAACC,EAASC,KACDC,KAAKC,MAAMC,eAAeJ,EAASC,EAAQ,CAC5CI,IAAKH,KAAKC,MAAME,IAChBC,OAAQJ,KAAKC,MAAMG,UACfJ,KAAKC,MAAMI,KAAO,CAAEA,KAAML,KAAKC,MAAMI,MAAS,CAAE,GACxD,IAGMC,MA7BK,KAEfN,KAAKC,MAAMM,kBAAkB,CACzBC,cAAeR,KAAKC,MAAMQ,kBAC1BC,kBAAmB,wBAInBV,KAAKW,SACLX,KAAKW,SAASC,SAEVZ,KAAKC,MAAMY,6BAA+BC,IAE1CC,OAAOC,IAAIC,SAASC,SAASlB,KAAKC,MAAME,KAExCY,OAAOE,SAASC,OAAOlB,KAAKC,MAAME,IAE1C,IAY2BgB,OAAM,QACzC,CAEAC,MAAAA,EAAOjB,IAAEA,EAAGC,OAAEA,EAAMC,KAAEA,EAAO,CAAE,IAC3B,MAAe,SAAXD,EAEIiB,EAACC,OAAAA,CACGlB,OAAO,OACPmB,OAAQpB,EACRqB,MAAO,CAAEC,QAAS,QAClBC,IAAKA,IACD1B,KAAKW,SAAWe,CAAAA,KAEf1B,KAAKC,MAAMY,6BAA+BC,KAAgC,CAAEa,OAAQ,SAExFC,OAAOC,KAAKxB,GAAMyB,KAAIC,GACnBV,EAACW,QAAAA,CAAMC,KAAK,SAASC,KAAMH,EAAKA,IAAKA,EAAKI,MAAO9B,EAAK0B,QAM/D,IACX,+BA3DAK,EAAApC,KAAQW,gBAAR,IACAyB,EAFE1C,EAEY2C,eAAe,CACzBnC,eAAgBJ,GAAWA,IAC3BM,OAAQ"}
1
+ {"version":3,"file":"RedirectShopper.js","sources":["../../../../../../src/components/Redirect/components/RedirectShopper/RedirectShopper.tsx"],"sourcesContent":["import { Component, h } from 'preact';\nimport detectInIframeInSameOrigin from '../../../../utils/detectInIframeInSameOrigin';\nimport { ActionHandledReturnObject } from '../../../../types/global-types';\n\ninterface RedirectShopperProps {\n beforeRedirect: (resolve, reject, url) => Promise<void>;\n url: string;\n method: 'GET' | 'POST';\n data?: any;\n redirectFromTopWhenInIframe?: boolean;\n paymentMethodType?: string;\n onActionHandled?: (rtnObj: ActionHandledReturnObject) => void;\n onRedirectError?: () => void;\n}\n\nclass RedirectShopper extends Component<RedirectShopperProps> {\n private postForm;\n public static defaultProps = {\n beforeRedirect: resolve => resolve(),\n onRedirectError: () => {},\n method: 'GET'\n };\n\n componentDidMount() {\n const doRedirect = () => {\n // call callback\n this.props.onActionHandled?.({\n componentType: this.props.paymentMethodType,\n actionDescription: 'performing-redirect'\n });\n\n // perform redirect\n if (this.postForm) {\n this.postForm.submit();\n } else {\n if (this.props.redirectFromTopWhenInIframe && detectInIframeInSameOrigin()) {\n // if in an iframe and the config prop allows it - try to redirect from the top level window\n window.top.location.assign?.(this.props.url);\n } else {\n window.location.assign(this.props.url);\n }\n }\n };\n\n const dispatchEvent = new Promise(\n (resolve, reject) =>\n void this.props.beforeRedirect(resolve, reject, {\n url: this.props.url,\n method: this.props.method,\n ...(this.props.data ? { data: this.props.data } : {})\n })\n );\n\n dispatchEvent.then(doRedirect).catch(() => {\n this.props.onRedirectError();\n });\n }\n\n render({ url, method, data = {} }) {\n if (method === 'POST') {\n return (\n <form\n method=\"post\"\n data-testid=\"redirect-shopper-form\"\n action={url}\n style={{ display: 'none' }}\n ref={ref => {\n this.postForm = ref;\n }}\n {...(this.props.redirectFromTopWhenInIframe && detectInIframeInSameOrigin() && { target: '_top' })}\n >\n {Object.keys(data).map(key => (\n <input type=\"hidden\" name={key} key={key} value={data[key]} />\n ))}\n </form>\n );\n }\n\n return null;\n }\n}\n\nexport default RedirectShopper;\n"],"names":["RedirectShopper","Component","componentDidMount","Promise","resolve","reject","this","props","beforeRedirect","url","method","data","then","onActionHandled","componentType","paymentMethodType","actionDescription","postForm","submit","redirectFromTopWhenInIframe","detectInIframeInSameOrigin","window","top","location","assign","catch","onRedirectError","render","h","form","data-testid","action","style","display","ref","target","Object","keys","map","key","input","type","name","value","super","args","_define_property","defaultProps"],"mappings":"iRAeA,MAAMA,UAAwBC,EAQ1BC,iBAAAA,GAqB0B,IAAIC,SACtB,CAACC,EAASC,KACDC,KAAKC,MAAMC,eAAeJ,EAASC,EAAQ,CAC5CI,IAAKH,KAAKC,MAAME,IAChBC,OAAQJ,KAAKC,MAAMG,UACfJ,KAAKC,MAAMI,KAAO,CAAEA,KAAML,KAAKC,MAAMI,MAAS,CAAE,GACxD,IAGMC,MA7BK,KAEfN,KAAKC,MAAMM,kBAAkB,CACzBC,cAAeR,KAAKC,MAAMQ,kBAC1BC,kBAAmB,wBAInBV,KAAKW,SACLX,KAAKW,SAASC,SAEVZ,KAAKC,MAAMY,6BAA+BC,IAE1CC,OAAOC,IAAIC,SAASC,SAASlB,KAAKC,MAAME,KAExCY,OAAOE,SAASC,OAAOlB,KAAKC,MAAME,IAE1C,IAY2BgB,OAAM,KACjCnB,KAAKC,MAAMmB,iBAAe,GAElC,CAEAC,MAAAA,EAAOlB,IAAEA,EAAGC,OAAEA,EAAMC,KAAEA,EAAO,CAAE,IAC3B,MAAe,SAAXD,EAEIkB,EAACC,OAAAA,CACGnB,OAAO,OACPoB,cAAY,wBACZC,OAAQtB,EACRuB,MAAO,CAAEC,QAAS,QAClBC,IAAKA,IACD5B,KAAKW,SAAWiB,CAAAA,KAEf5B,KAAKC,MAAMY,6BAA+BC,KAAgC,CAAEe,OAAQ,SAExFC,OAAOC,KAAK1B,GAAM2B,KAAIC,GACnBX,EAACY,QAAAA,CAAMC,KAAK,SAASC,KAAMH,EAAKA,IAAKA,EAAKI,MAAOhC,EAAK4B,QAM/D,IACX,mBA/DAK,SAAAC,GAAAC,EAAAxC,KAAQW,gBAAR,IACA6B,EAFE9C,EAEY+C,eAAe,CACzBvC,eAAgBJ,GAAWA,IAC3BsB,gBAAiB,OACjBhB,OAAQ"}
@@ -1,2 +1,2 @@
1
- import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import o from"./components/Challenge/PrepareChallenge3DS2.js";import{THREEDS2_ERROR as r,THREEDS2_CHALLENGE_ERROR as s,THREEDS2_FULL as n,DEFAULT_CHALLENGE_WINDOW_SIZE as i,THREEDS2_CHALLENGE as a}from"./constants.js";import{existy as p}from"../../utils/commonUtils.js";import{hasOwnProperty as l}from"../../utils/hasOwnProperty.js";import{TxVariants as m}from"../tx-variants.js";import c,{API_ERROR as u}from"../../core/Errors/AdyenCheckoutError.js";import{Analytics3DS2Errors as h,ANALYTICS_API_ERROR as y,ANALYTICS_RENDERED_STR as d,Analytics3DS2Events as A}from"../../core/Analytics/constants.js";import{CoreProvider as f}from"../../core/Context/CoreProvider.js";function C(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}class D extends e{onComplete(t){t&&super.onComplete(t),this.unmount()}render(){if(!p(this.props.paymentData)){const t=l(this.props,"isMDFlow")?"paymentData":"authorisationToken";return this.props.onError(new c(u,`No ${t} received. 3DS2 Challenge cannot proceed`)),this.submitAnalytics({type:r,code:h.ACTION_IS_MISSING_PAYMENT_DATA,errorType:y,message:`${s}: Missing 'paymentData' property from threeDS2 action`}),null}return t(f,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(o,{...this.props,onComplete:this.onComplete,onSubmitAnalytics:this.submitAnalytics,isMDFlow:this.props.paymentData.length<15,onActionHandled:this.onActionHandled}))}constructor(...t){super(...t),C(this,"submitAnalytics",(t=>{t.type!==d&&super.submitAnalytics(t)})),C(this,"onActionHandled",(t=>{this.submitAnalytics({type:n,message:t.actionDescription,subtype:A.CHALLENGE_IFRAME_LOADED}),super.onActionHandled(t)}))}}C(D,"type",m.threeDS2Challenge),C(D,"defaultProps",{dataKey:"threeDSResult",size:i,type:a});export{D as default};
1
+ import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import o from"./components/Challenge/PrepareChallenge3DS2.js";import{THREEDS2_ERROR as r,THREEDS2_CHALLENGE_ERROR as s,THREEDS2_FULL as n,DEFAULT_CHALLENGE_WINDOW_SIZE as i,THREEDS2_CHALLENGE as a}from"./constants.js";import{existy as p}from"../../utils/commonUtils.js";import{hasOwnProperty as l}from"../../utils/hasOwnProperty.js";import{TxVariants as m}from"../tx-variants.js";import c,{API_ERROR as u}from"../../core/Errors/AdyenCheckoutError.js";import{Analytics3DS2Errors as h,ANALYTICS_ERROR_TYPE as y,ANALYTICS_RENDERED_STR as d,Analytics3DS2Events as A}from"../../core/Analytics/constants.js";import{CoreProvider as f}from"../../core/Context/CoreProvider.js";function C(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}class D extends e{onComplete(t){t&&super.onComplete(t),this.unmount()}render(){if(!p(this.props.paymentData)){const t=l(this.props,"isMDFlow")?"paymentData":"authorisationToken";return this.props.onError(new c(u,`No ${t} received. 3DS2 Challenge cannot proceed`)),this.submitAnalytics({type:r,code:h.ACTION_IS_MISSING_PAYMENT_DATA,errorType:y.apiError,message:`${s}: Missing 'paymentData' property from threeDS2 action`}),null}return t(f,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(o,{...this.props,onComplete:this.onComplete,onSubmitAnalytics:this.submitAnalytics,isMDFlow:this.props.paymentData.length<15,onActionHandled:this.onActionHandled}))}constructor(...t){super(...t),C(this,"submitAnalytics",(t=>{t.type!==d&&super.submitAnalytics(t)})),C(this,"onActionHandled",(t=>{this.submitAnalytics({type:n,message:t.actionDescription,subtype:A.CHALLENGE_IFRAME_LOADED}),super.onActionHandled(t)}))}}C(D,"type",m.threeDS2Challenge),C(D,"defaultProps",{dataKey:"threeDSResult",size:i,type:a});export{D as default};
2
2
  //# sourceMappingURL=ThreeDS2Challenge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThreeDS2Challenge.js","sources":["../../../../src/components/ThreeDS2/ThreeDS2Challenge.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport PrepareChallenge from './components/Challenge';\nimport { DEFAULT_CHALLENGE_WINDOW_SIZE, THREEDS2_CHALLENGE, THREEDS2_CHALLENGE_ERROR, THREEDS2_ERROR, THREEDS2_FULL } from './constants';\nimport { existy } from '../../utils/commonUtils';\nimport { hasOwnProperty } from '../../utils/hasOwnProperty';\nimport { TxVariants } from '../tx-variants';\nimport { ThreeDS2ChallengeConfiguration } from './types';\nimport AdyenCheckoutError, { API_ERROR } from '../../core/Errors/AdyenCheckoutError';\nimport { ANALYTICS_API_ERROR, Analytics3DS2Errors, ANALYTICS_RENDERED_STR, Analytics3DS2Events } from '../../core/Analytics/constants';\nimport { SendAnalyticsObject } from '../../core/Analytics/types';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport { ActionHandledReturnObject } from '../../types/global-types';\n\nclass ThreeDS2Challenge extends UIElement<ThreeDS2ChallengeConfiguration> {\n public static type = TxVariants.threeDS2Challenge;\n\n public static defaultProps = {\n dataKey: 'threeDSResult',\n size: DEFAULT_CHALLENGE_WINDOW_SIZE,\n type: THREEDS2_CHALLENGE\n };\n\n protected submitAnalytics = (aObj: SendAnalyticsObject) => {\n if (aObj.type === ANALYTICS_RENDERED_STR) return; // suppress the rendered event (it will have the same timestamp as the \"creq sent\" event)\n\n super.submitAnalytics(aObj);\n };\n\n protected onActionHandled = (rtnObj: ActionHandledReturnObject) => {\n this.submitAnalytics({\n type: THREEDS2_FULL,\n message: rtnObj.actionDescription,\n subtype: Analytics3DS2Events.CHALLENGE_IFRAME_LOADED\n });\n\n super.onActionHandled(rtnObj);\n };\n\n onComplete(state) {\n /**\n * Equals a call to onAdditionalDetails (as set in actionTypes.ts) for the regular, \"native\" flow.\n * However, if the action to create this component came from the 3DS2InMDFlow process it will instead equal a call to the onComplete callback\n * (as defined in the 3DS2InMDFlow and passed in as a config prop).\n */\n if (state) super.onComplete(state);\n this.unmount(); // re. fixing issue around back to back challenge calls\n }\n\n render() {\n // existy used because threeds2InMDFlow will send empty string for paymentData and we should be allowed to proceed with this\n if (!existy(this.props.paymentData)) {\n /**\n * The presence of props.isMDFlow indicates the action to create this component came from the threeds2InMDFlow process which passes (an empty) paymentsData.\n * The regular, \"native\" flow uses the authorisationToken from the 3DS2 action, which actionTypes.ts assigns to a property called paymentData\n */\n const dataTypeForError = hasOwnProperty(this.props, 'isMDFlow') ? 'paymentData' : 'authorisationToken';\n\n this.props.onError(new AdyenCheckoutError(API_ERROR, `No ${dataTypeForError} received. 3DS2 Challenge cannot proceed`));\n\n this.submitAnalytics({\n type: THREEDS2_ERROR,\n code: Analytics3DS2Errors.ACTION_IS_MISSING_PAYMENT_DATA,\n errorType: ANALYTICS_API_ERROR,\n message: `${THREEDS2_CHALLENGE_ERROR}: Missing 'paymentData' property from threeDS2 action`\n });\n\n return null;\n }\n\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <PrepareChallenge\n {...this.props}\n onComplete={this.onComplete}\n onSubmitAnalytics={this.submitAnalytics}\n isMDFlow={this.props.paymentData.length < 15}\n onActionHandled={this.onActionHandled}\n />\n </CoreProvider>\n );\n }\n}\n\nexport default ThreeDS2Challenge;\n"],"names":["ThreeDS2Challenge","UIElement","onComplete","state","super","this","unmount","render","existy","props","paymentData","dataTypeForError","hasOwnProperty","onError","AdyenCheckoutError","API_ERROR","submitAnalytics","type","THREEDS2_ERROR","code","Analytics3DS2Errors","ACTION_IS_MISSING_PAYMENT_DATA","errorType","ANALYTICS_API_ERROR","message","THREEDS2_CHALLENGE_ERROR","h","CoreProvider","i18n","loadingContext","resources","PrepareChallenge","onSubmitAnalytics","isMDFlow","length","onActionHandled","_define_property","aObj","ANALYTICS_RENDERED_STR","rtnObj","THREEDS2_FULL","actionDescription","subtype","Analytics3DS2Events","CHALLENGE_IFRAME_LOADED","TxVariants","threeDS2Challenge","defaultProps","dataKey","size","DEFAULT_CHALLENGE_WINDOW_SIZE","THREEDS2_CHALLENGE"],"mappings":"u5BAcA,MAAMA,UAA0BC,EAyB5BC,UAAAA,CAAWC,GAMHA,GAAOC,MAAMF,WAAWC,GAC5BE,KAAKC,SACT,CAEAC,MAAAA,GAEI,IAAKC,EAAOH,KAAKI,MAAMC,aAAc,CAKjC,MAAMC,EAAmBC,EAAeP,KAAKI,MAAO,YAAc,cAAgB,qBAWlF,OATAJ,KAAKI,MAAMI,QAAQ,IAAIC,EAAmBC,EAAW,MAAMJ,8CAE3DN,KAAKW,gBAAgB,CACjBC,KAAMC,EACNC,KAAMC,EAAoBC,+BAC1BC,UAAWC,EACXC,QAAS,GAAGC,2DAGT,IACX,CAEA,OACIC,EAACC,EAAAA,CAAaC,KAAMvB,KAAKI,MAAMmB,KAAMC,eAAgBxB,KAAKI,MAAMoB,eAAgBC,UAAWzB,KAAKyB,WAC5FJ,EAACK,EAAAA,IACO1B,KAAKI,MACTP,WAAYG,KAAKH,WACjB8B,kBAAmB3B,KAAKW,gBACxBiB,SAAU5B,KAAKI,MAAMC,YAAYwB,OAAS,GAC1CC,gBAAiB9B,KAAK8B,kBAItC,+BA1DAC,EAAA/B,KAAUW,mBAAmBqB,IACrBA,EAAKpB,OAASqB,GAElBlC,MAAMY,gBAAgBqB,EAAAA,IAG1BD,EAAA/B,KAAU8B,mBAAmBI,IACzBlC,KAAKW,gBAAgB,CACjBC,KAAMuB,EACNhB,QAASe,EAAOE,kBAChBC,QAASC,EAAoBC,0BAGjCxC,MAAM+B,gBAAgBI,EAAAA,KArB1BH,EADEpC,EACYiB,OAAO4B,EAAWC,mBAEhCV,EAHEpC,EAGY+C,eAAe,CACzBC,QAAS,gBACTC,KAAMC,EACNjC,KAAMkC"}
1
+ {"version":3,"file":"ThreeDS2Challenge.js","sources":["../../../../src/components/ThreeDS2/ThreeDS2Challenge.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport PrepareChallenge from './components/Challenge';\nimport { DEFAULT_CHALLENGE_WINDOW_SIZE, THREEDS2_CHALLENGE, THREEDS2_CHALLENGE_ERROR, THREEDS2_ERROR, THREEDS2_FULL } from './constants';\nimport { existy } from '../../utils/commonUtils';\nimport { hasOwnProperty } from '../../utils/hasOwnProperty';\nimport { TxVariants } from '../tx-variants';\nimport { ThreeDS2ChallengeConfiguration } from './types';\nimport AdyenCheckoutError, { API_ERROR } from '../../core/Errors/AdyenCheckoutError';\nimport { ANALYTICS_ERROR_TYPE, Analytics3DS2Errors, ANALYTICS_RENDERED_STR, Analytics3DS2Events } from '../../core/Analytics/constants';\nimport { SendAnalyticsObject } from '../../core/Analytics/types';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport { ActionHandledReturnObject } from '../../types/global-types';\n\nclass ThreeDS2Challenge extends UIElement<ThreeDS2ChallengeConfiguration> {\n public static type = TxVariants.threeDS2Challenge;\n\n public static defaultProps = {\n dataKey: 'threeDSResult',\n size: DEFAULT_CHALLENGE_WINDOW_SIZE,\n type: THREEDS2_CHALLENGE\n };\n\n protected submitAnalytics = (aObj: SendAnalyticsObject) => {\n if (aObj.type === ANALYTICS_RENDERED_STR) return; // suppress the rendered event (it will have the same timestamp as the \"creq sent\" event)\n\n super.submitAnalytics(aObj);\n };\n\n protected onActionHandled = (rtnObj: ActionHandledReturnObject) => {\n this.submitAnalytics({\n type: THREEDS2_FULL,\n message: rtnObj.actionDescription,\n subtype: Analytics3DS2Events.CHALLENGE_IFRAME_LOADED\n });\n\n super.onActionHandled(rtnObj);\n };\n\n onComplete(state) {\n /**\n * Equals a call to onAdditionalDetails (as set in actionTypes.ts) for the regular, \"native\" flow.\n * However, if the action to create this component came from the 3DS2InMDFlow process it will instead equal a call to the onComplete callback\n * (as defined in the 3DS2InMDFlow and passed in as a config prop).\n */\n if (state) super.onComplete(state);\n this.unmount(); // re. fixing issue around back to back challenge calls\n }\n\n render() {\n // existy used because threeds2InMDFlow will send empty string for paymentData and we should be allowed to proceed with this\n if (!existy(this.props.paymentData)) {\n /**\n * The presence of props.isMDFlow indicates the action to create this component came from the threeds2InMDFlow process which passes (an empty) paymentsData.\n * The regular, \"native\" flow uses the authorisationToken from the 3DS2 action, which actionTypes.ts assigns to a property called paymentData\n */\n const dataTypeForError = hasOwnProperty(this.props, 'isMDFlow') ? 'paymentData' : 'authorisationToken';\n\n this.props.onError(new AdyenCheckoutError(API_ERROR, `No ${dataTypeForError} received. 3DS2 Challenge cannot proceed`));\n\n this.submitAnalytics({\n type: THREEDS2_ERROR,\n code: Analytics3DS2Errors.ACTION_IS_MISSING_PAYMENT_DATA,\n errorType: ANALYTICS_ERROR_TYPE.apiError,\n message: `${THREEDS2_CHALLENGE_ERROR}: Missing 'paymentData' property from threeDS2 action`\n });\n\n return null;\n }\n\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <PrepareChallenge\n {...this.props}\n onComplete={this.onComplete}\n onSubmitAnalytics={this.submitAnalytics}\n isMDFlow={this.props.paymentData.length < 15}\n onActionHandled={this.onActionHandled}\n />\n </CoreProvider>\n );\n }\n}\n\nexport default ThreeDS2Challenge;\n"],"names":["ThreeDS2Challenge","UIElement","onComplete","state","super","this","unmount","render","existy","props","paymentData","dataTypeForError","hasOwnProperty","onError","AdyenCheckoutError","API_ERROR","submitAnalytics","type","THREEDS2_ERROR","code","Analytics3DS2Errors","ACTION_IS_MISSING_PAYMENT_DATA","errorType","ANALYTICS_ERROR_TYPE","apiError","message","THREEDS2_CHALLENGE_ERROR","h","CoreProvider","i18n","loadingContext","resources","PrepareChallenge","onSubmitAnalytics","isMDFlow","length","onActionHandled","args","_define_property","aObj","ANALYTICS_RENDERED_STR","rtnObj","THREEDS2_FULL","actionDescription","subtype","Analytics3DS2Events","CHALLENGE_IFRAME_LOADED","TxVariants","threeDS2Challenge","defaultProps","dataKey","size","DEFAULT_CHALLENGE_WINDOW_SIZE","THREEDS2_CHALLENGE"],"mappings":"w5BAcA,MAAMA,UAA0BC,EAyB5BC,UAAAA,CAAWC,GAMHA,GAAOC,MAAMF,WAAWC,GAC5BE,KAAKC,SACT,CAEAC,MAAAA,GAEI,IAAKC,EAAOH,KAAKI,MAAMC,aAAc,CAKjC,MAAMC,EAAmBC,EAAeP,KAAKI,MAAO,YAAc,cAAgB,qBAWlF,OATAJ,KAAKI,MAAMI,QAAQ,IAAIC,EAAmBC,EAAW,MAAMJ,8CAE3DN,KAAKW,gBAAgB,CACjBC,KAAMC,EACNC,KAAMC,EAAoBC,+BAC1BC,UAAWC,EAAqBC,SAChCC,QAAS,GAAGC,2DAGT,IACX,CAEA,OACIC,EAACC,EAAAA,CAAaC,KAAMxB,KAAKI,MAAMoB,KAAMC,eAAgBzB,KAAKI,MAAMqB,eAAgBC,UAAW1B,KAAK0B,WAC5FJ,EAACK,EAAAA,IACO3B,KAAKI,MACTP,WAAYG,KAAKH,WACjB+B,kBAAmB5B,KAAKW,gBACxBkB,SAAU7B,KAAKI,MAAMC,YAAYyB,OAAS,GAC1CC,gBAAiB/B,KAAK+B,kBAItC,mBA1DAhC,SAAAiC,GAAAC,EAAAjC,KAAUW,mBAAmBuB,IACrBA,EAAKtB,OAASuB,GAElBpC,MAAMY,gBAAgBuB,EAAAA,IAG1BD,EAAAjC,KAAU+B,mBAAmBK,IACzBpC,KAAKW,gBAAgB,CACjBC,KAAMyB,EACNjB,QAASgB,EAAOE,kBAChBC,QAASC,EAAoBC,0BAGjC1C,MAAMgC,gBAAgBK,EAAAA,KArB1BH,EADEtC,EACYiB,OAAO8B,EAAWC,mBAEhCV,EAHEtC,EAGYiD,eAAe,CACzBC,QAAS,gBACTC,KAAMC,EACNnC,KAAMoC"}
@@ -1,2 +1,2 @@
1
- import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import r from"./components/DeviceFingerprint/PrepareFingerprint3DS2.js";import n from"./callSubmit3DS2Fingerprint.js";import{existy as i}from"../../utils/commonUtils.js";import{TxVariants as s}from"../tx-variants.js";import o,{API_ERROR as p}from"../../core/Errors/AdyenCheckoutError.js";import{Analytics3DS2Errors as a,ANALYTICS_API_ERROR as m,ANALYTICS_RENDERED_STR as l,Analytics3DS2Events as c}from"../../core/Analytics/constants.js";import{THREEDS2_ERROR as u,THREEDS2_FINGERPRINT_ERROR as y,THREEDS2_FULL as d,THREEDS2_FINGERPRINT as h}from"./constants.js";function A(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class D extends e{onComplete(t){super.onComplete(t),this.unmount()}render(){return i(this.props.paymentData)?t(r,{...this.props,onComplete:this.props.isMDFlow?this.onComplete:this.callSubmit3DS2Fingerprint,onSubmitAnalytics:this.submitAnalytics,isMDFlow:this.props.paymentData.length<15,onActionHandled:this.onActionHandled}):(this.props.onError(new o(p,"No paymentData received. 3DS2 Fingerprint cannot proceed")),this.submitAnalytics({type:u,code:a.ACTION_IS_MISSING_PAYMENT_DATA,errorType:m,message:`${y}: Missing 'paymentData' property from threeDS2 action`}),null)}constructor(...t){super(...t),A(this,"callSubmit3DS2Fingerprint",n.bind(this)),A(this,"submitAnalytics",(t=>{t.type!==l&&super.submitAnalytics(t)})),A(this,"onActionHandled",(t=>{this.submitAnalytics({type:d,message:t.actionDescription,subtype:c.FINGERPRINT_IFRAME_LOADED}),super.onActionHandled(t)}))}}A(D,"type",s.threeDS2Fingerprint),A(D,"defaultProps",{dataKey:"fingerprintResult",type:h});export{D as default};
1
+ import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import r from"./components/DeviceFingerprint/PrepareFingerprint3DS2.js";import i from"./callSubmit3DS2Fingerprint.js";import{existy as n}from"../../utils/commonUtils.js";import{TxVariants as o}from"../tx-variants.js";import s,{API_ERROR as p}from"../../core/Errors/AdyenCheckoutError.js";import{Analytics3DS2Errors as a,ANALYTICS_ERROR_TYPE as m,ANALYTICS_RENDERED_STR as l,Analytics3DS2Events as c}from"../../core/Analytics/constants.js";import{THREEDS2_ERROR as u,THREEDS2_FINGERPRINT_ERROR as y,THREEDS2_FULL as d,THREEDS2_FINGERPRINT as h}from"./constants.js";function A(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class D extends e{onComplete(t){super.onComplete(t),this.unmount()}render(){return n(this.props.paymentData)?t(r,{...this.props,onComplete:this.props.isMDFlow?this.onComplete:this.callSubmit3DS2Fingerprint,onSubmitAnalytics:this.submitAnalytics,isMDFlow:this.props.paymentData.length<15,onActionHandled:this.onActionHandled}):(this.props.onError(new s(p,"No paymentData received. 3DS2 Fingerprint cannot proceed")),this.submitAnalytics({type:u,code:a.ACTION_IS_MISSING_PAYMENT_DATA,errorType:m.apiError,message:`${y}: Missing 'paymentData' property from threeDS2 action`}),null)}constructor(...t){super(...t),A(this,"callSubmit3DS2Fingerprint",i.bind(this)),A(this,"submitAnalytics",(t=>{t.type!==l&&super.submitAnalytics(t)})),A(this,"onActionHandled",(t=>{this.submitAnalytics({type:d,message:t.actionDescription,subtype:c.FINGERPRINT_IFRAME_LOADED}),super.onActionHandled(t)}))}}A(D,"type",o.threeDS2Fingerprint),A(D,"defaultProps",{dataKey:"fingerprintResult",type:h});export{D as default};
2
2
  //# sourceMappingURL=ThreeDS2DeviceFingerprint.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThreeDS2DeviceFingerprint.js","sources":["../../../../src/components/ThreeDS2/ThreeDS2DeviceFingerprint.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport PrepareFingerprint from './components/DeviceFingerprint';\nimport callSubmit3DS2Fingerprint from './callSubmit3DS2Fingerprint';\nimport { existy } from '../../utils/commonUtils';\nimport { TxVariants } from '../tx-variants';\nimport { ThreeDS2DeviceFingerprintConfiguration } from './types';\nimport AdyenCheckoutError, { API_ERROR } from '../../core/Errors/AdyenCheckoutError';\nimport { ANALYTICS_API_ERROR, Analytics3DS2Errors, ANALYTICS_RENDERED_STR, Analytics3DS2Events } from '../../core/Analytics/constants';\nimport { SendAnalyticsObject } from '../../core/Analytics/types';\nimport { THREEDS2_ERROR, THREEDS2_FINGERPRINT, THREEDS2_FINGERPRINT_ERROR, THREEDS2_FULL } from './constants';\nimport { ActionHandledReturnObject } from '../../types/global-types';\n\nclass ThreeDS2DeviceFingerprint extends UIElement<ThreeDS2DeviceFingerprintConfiguration> {\n public static type = TxVariants.threeDS2Fingerprint;\n\n public static defaultProps = {\n dataKey: 'fingerprintResult',\n type: THREEDS2_FINGERPRINT\n };\n\n private callSubmit3DS2Fingerprint = callSubmit3DS2Fingerprint.bind(this); // New 3DS2 flow\n\n protected submitAnalytics = (aObj: SendAnalyticsObject) => {\n if (aObj.type === ANALYTICS_RENDERED_STR) return; // suppress the rendered event (it will have the same timestamp as the \"threeDSMethodData sent\" event)\n\n super.submitAnalytics(aObj);\n };\n\n protected onActionHandled = (rtnObj: ActionHandledReturnObject) => {\n this.submitAnalytics({\n type: THREEDS2_FULL,\n message: rtnObj.actionDescription,\n subtype: Analytics3DS2Events.FINGERPRINT_IFRAME_LOADED\n });\n super.onActionHandled(rtnObj);\n };\n\n onComplete(state) {\n super.onComplete(state);\n this.unmount(); // re. fixing issue around back to back fingerprinting calls\n }\n\n render() {\n /**\n * In the regular components (aka \"native\") flow we can't proceed because something has gone wrong with the payment if paymentData is missing from the threeDS2 action.\n * In the MDFlow the paymentData is always present (albeit an empty string, which is why we use 'existy' since we should be allowed to proceed with this)\n */\n if (!existy(this.props.paymentData)) {\n this.props.onError(new AdyenCheckoutError(API_ERROR, `No paymentData received. 3DS2 Fingerprint cannot proceed`));\n\n // TODO - check logs to see if this *ever* happens\n this.submitAnalytics({\n type: THREEDS2_ERROR,\n code: Analytics3DS2Errors.ACTION_IS_MISSING_PAYMENT_DATA,\n errorType: ANALYTICS_API_ERROR,\n message: `${THREEDS2_FINGERPRINT_ERROR}: Missing 'paymentData' property from threeDS2 action`\n });\n\n return null;\n }\n\n /**\n * this.props.isMDFlow indicates the action to create this component came from the 3DS2InMDFlow process and upon completion should call the\n * passed onComplete callback (as defined in the 3DS2InMDFlow) instead of the /submitThreeDS2Fingerprint endpoint for the regular, \"native\" flow\n */\n return (\n <PrepareFingerprint\n {...this.props}\n onComplete={this.props.isMDFlow ? this.onComplete : this.callSubmit3DS2Fingerprint}\n onSubmitAnalytics={this.submitAnalytics}\n isMDFlow={this.props.paymentData.length < 15}\n onActionHandled={this.onActionHandled}\n />\n );\n }\n}\n\nexport default ThreeDS2DeviceFingerprint;\n"],"names":["ThreeDS2DeviceFingerprint","UIElement","onComplete","state","super","this","unmount","render","existy","props","paymentData","h","PrepareFingerprint","isMDFlow","callSubmit3DS2Fingerprint","onSubmitAnalytics","submitAnalytics","length","onActionHandled","onError","AdyenCheckoutError","API_ERROR","type","THREEDS2_ERROR","code","Analytics3DS2Errors","ACTION_IS_MISSING_PAYMENT_DATA","errorType","ANALYTICS_API_ERROR","message","THREEDS2_FINGERPRINT_ERROR","_define_property","bind","aObj","ANALYTICS_RENDERED_STR","rtnObj","THREEDS2_FULL","actionDescription","subtype","Analytics3DS2Events","FINGERPRINT_IFRAME_LOADED","TxVariants","threeDS2Fingerprint","defaultProps","dataKey","THREEDS2_FINGERPRINT"],"mappings":"+yBAaA,MAAMA,UAAkCC,EAyBpCC,UAAAA,CAAWC,GACPC,MAAMF,WAAWC,GACjBE,KAAKC,SACT,CAEAC,MAAAA,GAKI,OAAKC,EAAOH,KAAKI,MAAMC,aAmBnBC,EAACC,EAAAA,IACOP,KAAKI,MACTP,WAAYG,KAAKI,MAAMI,SAAWR,KAAKH,WAAaG,KAAKS,0BACzDC,kBAAmBV,KAAKW,gBACxBH,SAAUR,KAAKI,MAAMC,YAAYO,OAAS,GAC1CC,gBAAiBb,KAAKa,mBAvB1Bb,KAAKI,MAAMU,QAAQ,IAAIC,EAAmBC,EAAW,6DAGrDhB,KAAKW,gBAAgB,CACjBM,KAAMC,EACNC,KAAMC,EAAoBC,+BAC1BC,UAAWC,EACXC,QAAS,GAAGC,2DAGT,KAgBf,+BAtDAC,EAAA1B,KAAQS,4BAA4BA,EAA0BkB,KAAK3B,OAEnE0B,EAAA1B,KAAUW,mBAAmBiB,IACrBA,EAAKX,OAASY,GAElB9B,MAAMY,gBAAgBiB,EAAAA,IAG1BF,EAAA1B,KAAUa,mBAAmBiB,IACzB9B,KAAKW,gBAAgB,CACjBM,KAAMc,EACNP,QAASM,EAAOE,kBAChBC,QAASC,EAAoBC,4BAEjCpC,MAAMc,gBAAgBiB,EAAAA,KArB1BJ,EADE/B,EACYsB,OAAOmB,EAAWC,qBAEhCX,EAHE/B,EAGY2C,eAAe,CACzBC,QAAS,oBACTtB,KAAMuB"}
1
+ {"version":3,"file":"ThreeDS2DeviceFingerprint.js","sources":["../../../../src/components/ThreeDS2/ThreeDS2DeviceFingerprint.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport PrepareFingerprint from './components/DeviceFingerprint';\nimport callSubmit3DS2Fingerprint from './callSubmit3DS2Fingerprint';\nimport { existy } from '../../utils/commonUtils';\nimport { TxVariants } from '../tx-variants';\nimport { ThreeDS2DeviceFingerprintConfiguration } from './types';\nimport AdyenCheckoutError, { API_ERROR } from '../../core/Errors/AdyenCheckoutError';\nimport { ANALYTICS_ERROR_TYPE, Analytics3DS2Errors, ANALYTICS_RENDERED_STR, Analytics3DS2Events } from '../../core/Analytics/constants';\nimport { SendAnalyticsObject } from '../../core/Analytics/types';\nimport { THREEDS2_ERROR, THREEDS2_FINGERPRINT, THREEDS2_FINGERPRINT_ERROR, THREEDS2_FULL } from './constants';\nimport { ActionHandledReturnObject } from '../../types/global-types';\n\nclass ThreeDS2DeviceFingerprint extends UIElement<ThreeDS2DeviceFingerprintConfiguration> {\n public static type = TxVariants.threeDS2Fingerprint;\n\n public static defaultProps = {\n dataKey: 'fingerprintResult',\n type: THREEDS2_FINGERPRINT\n };\n\n private callSubmit3DS2Fingerprint = callSubmit3DS2Fingerprint.bind(this); // New 3DS2 flow\n\n protected submitAnalytics = (aObj: SendAnalyticsObject) => {\n if (aObj.type === ANALYTICS_RENDERED_STR) return; // suppress the rendered event (it will have the same timestamp as the \"threeDSMethodData sent\" event)\n\n super.submitAnalytics(aObj);\n };\n\n protected onActionHandled = (rtnObj: ActionHandledReturnObject) => {\n this.submitAnalytics({\n type: THREEDS2_FULL,\n message: rtnObj.actionDescription,\n subtype: Analytics3DS2Events.FINGERPRINT_IFRAME_LOADED\n });\n super.onActionHandled(rtnObj);\n };\n\n onComplete(state) {\n super.onComplete(state);\n this.unmount(); // re. fixing issue around back to back fingerprinting calls\n }\n\n render() {\n /**\n * In the regular components (aka \"native\") flow we can't proceed because something has gone wrong with the payment if paymentData is missing from the threeDS2 action.\n * In the MDFlow the paymentData is always present (albeit an empty string, which is why we use 'existy' since we should be allowed to proceed with this)\n */\n if (!existy(this.props.paymentData)) {\n this.props.onError(new AdyenCheckoutError(API_ERROR, `No paymentData received. 3DS2 Fingerprint cannot proceed`));\n\n // TODO - check logs to see if this *ever* happens\n this.submitAnalytics({\n type: THREEDS2_ERROR,\n code: Analytics3DS2Errors.ACTION_IS_MISSING_PAYMENT_DATA,\n errorType: ANALYTICS_ERROR_TYPE.apiError,\n message: `${THREEDS2_FINGERPRINT_ERROR}: Missing 'paymentData' property from threeDS2 action`\n });\n\n return null;\n }\n\n /**\n * this.props.isMDFlow indicates the action to create this component came from the 3DS2InMDFlow process and upon completion should call the\n * passed onComplete callback (as defined in the 3DS2InMDFlow) instead of the /submitThreeDS2Fingerprint endpoint for the regular, \"native\" flow\n */\n return (\n <PrepareFingerprint\n {...this.props}\n onComplete={this.props.isMDFlow ? this.onComplete : this.callSubmit3DS2Fingerprint}\n onSubmitAnalytics={this.submitAnalytics}\n isMDFlow={this.props.paymentData.length < 15}\n onActionHandled={this.onActionHandled}\n />\n );\n }\n}\n\nexport default ThreeDS2DeviceFingerprint;\n"],"names":["ThreeDS2DeviceFingerprint","UIElement","onComplete","state","super","this","unmount","render","existy","props","paymentData","h","PrepareFingerprint","isMDFlow","callSubmit3DS2Fingerprint","onSubmitAnalytics","submitAnalytics","length","onActionHandled","onError","AdyenCheckoutError","API_ERROR","type","THREEDS2_ERROR","code","Analytics3DS2Errors","ACTION_IS_MISSING_PAYMENT_DATA","errorType","ANALYTICS_ERROR_TYPE","apiError","message","THREEDS2_FINGERPRINT_ERROR","args","_define_property","bind","aObj","ANALYTICS_RENDERED_STR","rtnObj","THREEDS2_FULL","actionDescription","subtype","Analytics3DS2Events","FINGERPRINT_IFRAME_LOADED","TxVariants","threeDS2Fingerprint","defaultProps","dataKey","THREEDS2_FINGERPRINT"],"mappings":"gzBAaA,MAAMA,UAAkCC,EAyBpCC,UAAAA,CAAWC,GACPC,MAAMF,WAAWC,GACjBE,KAAKC,SACT,CAEAC,MAAAA,GAKI,OAAKC,EAAOH,KAAKI,MAAMC,aAmBnBC,EAACC,EAAAA,IACOP,KAAKI,MACTP,WAAYG,KAAKI,MAAMI,SAAWR,KAAKH,WAAaG,KAAKS,0BACzDC,kBAAmBV,KAAKW,gBACxBH,SAAUR,KAAKI,MAAMC,YAAYO,OAAS,GAC1CC,gBAAiBb,KAAKa,mBAvB1Bb,KAAKI,MAAMU,QAAQ,IAAIC,EAAmBC,EAAW,6DAGrDhB,KAAKW,gBAAgB,CACjBM,KAAMC,EACNC,KAAMC,EAAoBC,+BAC1BC,UAAWC,EAAqBC,SAChCC,QAAS,GAAGC,2DAGT,KAgBf,mBAtDA3B,SAAA4B,GAAAC,EAAA5B,KAAQS,4BAA4BA,EAA0BoB,KAAK7B,OAEnE4B,EAAA5B,KAAUW,mBAAmBmB,IACrBA,EAAKb,OAASc,GAElBhC,MAAMY,gBAAgBmB,EAAAA,IAG1BF,EAAA5B,KAAUa,mBAAmBmB,IACzBhC,KAAKW,gBAAgB,CACjBM,KAAMgB,EACNR,QAASO,EAAOE,kBAChBC,QAASC,EAAoBC,4BAEjCtC,MAAMc,gBAAgBmB,EAAAA,KArB1BJ,EADEjC,EACYsB,OAAOqB,EAAWC,qBAEhCX,EAHEjC,EAGY6C,eAAe,CACzBC,QAAS,oBACTxB,KAAMyB"}
@@ -1,2 +1,2 @@
1
- import{httpPost as e}from"../../core/Services/http.js";import{pick as t}from"../../utils/commonUtils.js";import{THREEDS2_ERROR as o,THREEDS2_FINGERPRINT_SUBMIT as n}from"./constants.js";import{Analytics3DS2Errors as i,ANALYTICS_API_ERROR as r,ANALYTICS_SDK_ERROR as s}from"../../core/Analytics/constants.js";function a({data:a}){e({path:`v1/submitThreeDS2Fingerprint?token=${this.props.clientKey}`,loadingContext:this.props.loadingContext,errorLevel:"fatal"},{...a}).then((e=>{let a;if("completed"===e.type){const{details:t}=e;return e.details?this.onComplete({data:{details:t}}):(console.debug('Handled Error::callSubmit3DS2Fingerprint::FAILED:: no details object in a response indicating either a "frictionless" flow, or a "refused" response. resData=',e),a={type:o,code:i.NO_DETAILS_FOR_FRICTIONLESS_OR_REFUSED,errorType:r,message:`${n}: no details object in a response indicating either a "frictionless" flow, or a "refused" response`},void this.submitAnalytics(a))}if(!e.action)return console.debug('Handled Error::callSubmit3DS2Fingerprint::FAILED:: no action object in a response indicating a "challenge". resData=',e),a={type:o,code:i.NO_ACTION_FOR_CHALLENGE,errorType:r,message:`${n}: no action object in a response indicating a "challenge" flow`},void this.submitAnalytics(a);const c=this.props.elementRef??this;return c?"threeDS2"===e.action?.type?c.handleAction(e.action,t("challengeWindowSize").from(this.props)):"redirect"===e.action?.type?c.handleAction(e.action):void 0:(console.debug("Handled Error::callSubmit3DS2Fingerprint::FAILED:: no actionHandler"),a={type:o,code:i.NO_COMPONENT_FOR_ACTION,errorType:s,message:`${n}: no component defined to handle the action response`},void this.submitAnalytics(a))})).catch((e=>{this.handleError(e)}))}export{a as default};
1
+ import{httpPost as e}from"../../core/Services/http.js";import{pick as t}from"../../utils/commonUtils.js";import{THREEDS2_ERROR as o,THREEDS2_FINGERPRINT_SUBMIT as i}from"./constants.js";import{Analytics3DS2Errors as n,ANALYTICS_ERROR_TYPE as r}from"../../core/Analytics/constants.js";function s({data:s}){e({path:`v1/submitThreeDS2Fingerprint?token=${this.props.clientKey}`,loadingContext:this.props.loadingContext,errorLevel:"fatal"},{...s}).then((e=>{let s;if("completed"===e.type){const{details:t}=e;return e.details?this.onComplete({data:{details:t}}):(console.debug('Handled Error::callSubmit3DS2Fingerprint::FAILED:: no details object in a response indicating either a "frictionless" flow, or a "refused" response. resData=',e),s={type:o,code:n.NO_DETAILS_FOR_FRICTIONLESS_OR_REFUSED,errorType:r.apiError,message:`${i}: no details object in a response indicating either a "frictionless" flow, or a "refused" response`},void this.submitAnalytics(s))}if(!e.action)return console.debug('Handled Error::callSubmit3DS2Fingerprint::FAILED:: no action object in a response indicating a "challenge". resData=',e),s={type:o,code:n.NO_ACTION_FOR_CHALLENGE,errorType:r.apiError,message:`${i}: no action object in a response indicating a "challenge" flow`},void this.submitAnalytics(s);const a=this.props.elementRef??this;return a?"threeDS2"===e.action?.type?a.handleAction(e.action,t("challengeWindowSize").from(this.props)):"redirect"===e.action?.type?a.handleAction(e.action):void 0:(console.debug("Handled Error::callSubmit3DS2Fingerprint::FAILED:: no actionHandler"),s={type:o,code:n.NO_COMPONENT_FOR_ACTION,errorType:r.sdkError,message:`${i}: no component defined to handle the action response`},void this.submitAnalytics(s))})).catch((e=>{this.handleError(e)}))}export{s as default};
2
2
  //# sourceMappingURL=callSubmit3DS2Fingerprint.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"callSubmit3DS2Fingerprint.js","sources":["../../../../src/components/ThreeDS2/callSubmit3DS2Fingerprint.ts"],"sourcesContent":["import { httpPost } from '../../core/Services/http';\nimport { pick } from '../../utils/commonUtils';\nimport { ThreeDS2FingerprintResponse } from './types';\nimport AdyenCheckoutError from '../../core/Errors/AdyenCheckoutError';\nimport { THREEDS2_ERROR, THREEDS2_FINGERPRINT_SUBMIT } from './constants';\nimport { ANALYTICS_API_ERROR, Analytics3DS2Errors, ANALYTICS_SDK_ERROR } from '../../core/Analytics/constants';\nimport { SendAnalyticsObject } from '../../core/Analytics/types';\n\n/**\n * ThreeDS2DeviceFingerprint, onComplete, calls a new, internal, endpoint which\n * behaves like the /details endpoint but doesn't require the same credentials\n */\nexport default function callSubmit3DS2Fingerprint({ data }): void {\n httpPost<ThreeDS2FingerprintResponse>(\n {\n path: `v1/submitThreeDS2Fingerprint?token=${this.props.clientKey}`,\n loadingContext: this.props.loadingContext,\n errorLevel: 'fatal'\n },\n {\n ...data\n }\n )\n .then(resData => {\n let analyticsErrorObject: SendAnalyticsObject;\n\n /**\n * Frictionless (no challenge) flow OR \"refused\" flow\n */\n if (resData.type === 'completed') {\n const { details } = resData;\n\n if (!resData.details) {\n console.debug(\n 'Handled Error::callSubmit3DS2Fingerprint::FAILED:: no details object in a response indicating either a \"frictionless\" flow, or a \"refused\" response. resData=',\n resData\n );\n\n analyticsErrorObject = {\n type: THREEDS2_ERROR,\n code: Analytics3DS2Errors.NO_DETAILS_FOR_FRICTIONLESS_OR_REFUSED,\n errorType: ANALYTICS_API_ERROR,\n message: `${THREEDS2_FINGERPRINT_SUBMIT}: no details object in a response indicating either a \"frictionless\" flow, or a \"refused\" response`\n };\n\n this.submitAnalytics(analyticsErrorObject);\n return;\n }\n\n return this.onComplete({ data: { details } });\n }\n\n /**\n * If we don't have a type: \"completed\", then we expect an action, because we must be in a Challenge or Redirect flow\n */\n if (!resData.action) {\n console.debug(\n 'Handled Error::callSubmit3DS2Fingerprint::FAILED:: no action object in a response indicating a \"challenge\". resData=',\n resData\n );\n\n analyticsErrorObject = {\n type: THREEDS2_ERROR,\n code: Analytics3DS2Errors.NO_ACTION_FOR_CHALLENGE,\n errorType: ANALYTICS_API_ERROR,\n message: `${THREEDS2_FINGERPRINT_SUBMIT}: no action object in a response indicating a \"challenge\" flow`\n };\n this.submitAnalytics(analyticsErrorObject);\n return;\n }\n\n // elementRef exists when the fingerprint component is created from the Dropin\n const actionHandler = this.props.elementRef ?? this;\n\n /**\n * We have an action but do we have a way to handle it?\n * TODO - check logs: do we ever *not* have an actionHandler?\n */\n if (!actionHandler) {\n console.debug('Handled Error::callSubmit3DS2Fingerprint::FAILED:: no actionHandler');\n\n analyticsErrorObject = {\n type: THREEDS2_ERROR,\n code: Analytics3DS2Errors.NO_COMPONENT_FOR_ACTION,\n errorType: ANALYTICS_SDK_ERROR,\n message: `${THREEDS2_FINGERPRINT_SUBMIT}: no component defined to handle the action response`\n };\n this.submitAnalytics(analyticsErrorObject);\n return;\n }\n\n /**\n * Challenge flow\n */\n if (resData.action?.type === 'threeDS2') {\n // Ensure challengeWindowSize is propagated if there was a (merchant defined) handleAction call proceeding this one that had it set as an option\n return actionHandler.handleAction(resData.action, pick('challengeWindowSize').from(this.props));\n }\n\n /**\n * Redirect flow (usecase: we thought we could do 3DS2 but it turns out we can't)\n * TODO - check logs: does this ever happen, anymore?\n */\n if (resData.action?.type === 'redirect') {\n return actionHandler.handleAction(resData.action);\n }\n })\n .catch((error: AdyenCheckoutError) => {\n this.handleError(error);\n });\n}\n"],"names":["callSubmit3DS2Fingerprint","data","httpPost","path","this","props","clientKey","loadingContext","errorLevel","then","resData","analyticsErrorObject","type","details","onComplete","console","debug","THREEDS2_ERROR","code","Analytics3DS2Errors","NO_DETAILS_FOR_FRICTIONLESS_OR_REFUSED","errorType","ANALYTICS_API_ERROR","message","THREEDS2_FINGERPRINT_SUBMIT","submitAnalytics","action","NO_ACTION_FOR_CHALLENGE","actionHandler","elementRef","handleAction","pick","from","NO_COMPONENT_FOR_ACTION","ANALYTICS_SDK_ERROR","catch","error","handleError"],"mappings":"oTAYe,SAASA,GAA0BC,KAAEA,IAChDC,EACI,CACIC,KAAM,sCAAsCC,KAAKC,MAAMC,YACvDC,eAAgBH,KAAKC,MAAME,eAC3BC,WAAY,SAEhB,IACOP,IAGNQ,MAAKC,IACF,IAAIC,EAKJ,GAAqB,cAAjBD,EAAQE,KAAsB,CAC9B,MAAMC,QAAEA,GAAYH,EAEpB,OAAKA,EAAQG,QAiBNT,KAAKU,WAAW,CAAEb,KAAM,CAAEY,cAhB7BE,QAAQC,MACJ,gKACAN,GAGJC,EAAuB,CACnBC,KAAMK,EACNC,KAAMC,EAAoBC,uCAC1BC,UAAWC,EACXC,QAAS,GAAGC,4GAGhBpB,KAAKqB,gBAAgBd,GAK7B,CAKA,IAAKD,EAAQgB,OAaT,OAZAX,QAAQC,MACJ,uHACAN,GAGJC,EAAuB,CACnBC,KAAMK,EACNC,KAAMC,EAAoBQ,wBAC1BN,UAAWC,EACXC,QAAS,GAAGC,wEAEhBpB,KAAKqB,gBAAgBd,GAKzB,MAAMiB,EAAgBxB,KAAKC,MAAMwB,YAAczB,KAM/C,OAAKwB,EAgBwB,aAAzBlB,EAAQgB,QAAQd,KAETgB,EAAcE,aAAapB,EAAQgB,OAAQK,EAAK,uBAAuBC,KAAK5B,KAAKC,QAO/D,aAAzBK,EAAQgB,QAAQd,KACTgB,EAAcE,aAAapB,EAAQgB,aAD9C,GAxBIX,QAAQC,MAAM,uEAEdL,EAAuB,CACnBC,KAAMK,EACNC,KAAMC,EAAoBc,wBAC1BZ,UAAWa,EACXX,QAAS,GAAGC,8DAEhBpB,KAAKqB,gBAAgBd,GAkBzB,IAEHwB,OAAOC,IACJhC,KAAKiC,YAAYD,EAAAA,GAE7B"}
1
+ {"version":3,"file":"callSubmit3DS2Fingerprint.js","sources":["../../../../src/components/ThreeDS2/callSubmit3DS2Fingerprint.ts"],"sourcesContent":["import { httpPost } from '../../core/Services/http';\nimport { pick } from '../../utils/commonUtils';\nimport { ThreeDS2FingerprintResponse } from './types';\nimport AdyenCheckoutError from '../../core/Errors/AdyenCheckoutError';\nimport { THREEDS2_ERROR, THREEDS2_FINGERPRINT_SUBMIT } from './constants';\nimport { ANALYTICS_ERROR_TYPE, Analytics3DS2Errors } from '../../core/Analytics/constants';\nimport { SendAnalyticsObject } from '../../core/Analytics/types';\n\n/**\n * ThreeDS2DeviceFingerprint, onComplete, calls a new, internal, endpoint which\n * behaves like the /details endpoint but doesn't require the same credentials\n */\nexport default function callSubmit3DS2Fingerprint({ data }): void {\n httpPost<ThreeDS2FingerprintResponse>(\n {\n path: `v1/submitThreeDS2Fingerprint?token=${this.props.clientKey}`,\n loadingContext: this.props.loadingContext,\n errorLevel: 'fatal'\n },\n {\n ...data\n }\n )\n .then(resData => {\n let analyticsErrorObject: SendAnalyticsObject;\n\n /**\n * Frictionless (no challenge) flow OR \"refused\" flow\n */\n if (resData.type === 'completed') {\n const { details } = resData;\n\n if (!resData.details) {\n console.debug(\n 'Handled Error::callSubmit3DS2Fingerprint::FAILED:: no details object in a response indicating either a \"frictionless\" flow, or a \"refused\" response. resData=',\n resData\n );\n\n analyticsErrorObject = {\n type: THREEDS2_ERROR,\n code: Analytics3DS2Errors.NO_DETAILS_FOR_FRICTIONLESS_OR_REFUSED,\n errorType: ANALYTICS_ERROR_TYPE.apiError,\n message: `${THREEDS2_FINGERPRINT_SUBMIT}: no details object in a response indicating either a \"frictionless\" flow, or a \"refused\" response`\n };\n\n this.submitAnalytics(analyticsErrorObject);\n return;\n }\n\n return this.onComplete({ data: { details } });\n }\n\n /**\n * If we don't have a type: \"completed\", then we expect an action, because we must be in a Challenge or Redirect flow\n */\n if (!resData.action) {\n console.debug(\n 'Handled Error::callSubmit3DS2Fingerprint::FAILED:: no action object in a response indicating a \"challenge\". resData=',\n resData\n );\n\n analyticsErrorObject = {\n type: THREEDS2_ERROR,\n code: Analytics3DS2Errors.NO_ACTION_FOR_CHALLENGE,\n errorType: ANALYTICS_ERROR_TYPE.apiError,\n message: `${THREEDS2_FINGERPRINT_SUBMIT}: no action object in a response indicating a \"challenge\" flow`\n };\n this.submitAnalytics(analyticsErrorObject);\n return;\n }\n\n // elementRef exists when the fingerprint component is created from the Dropin\n const actionHandler = this.props.elementRef ?? this;\n\n /**\n * We have an action but do we have a way to handle it?\n * TODO - check logs: do we ever *not* have an actionHandler?\n */\n if (!actionHandler) {\n console.debug('Handled Error::callSubmit3DS2Fingerprint::FAILED:: no actionHandler');\n\n analyticsErrorObject = {\n type: THREEDS2_ERROR,\n code: Analytics3DS2Errors.NO_COMPONENT_FOR_ACTION,\n errorType: ANALYTICS_ERROR_TYPE.sdkError,\n message: `${THREEDS2_FINGERPRINT_SUBMIT}: no component defined to handle the action response`\n };\n this.submitAnalytics(analyticsErrorObject);\n return;\n }\n\n /**\n * Challenge flow\n */\n if (resData.action?.type === 'threeDS2') {\n // Ensure challengeWindowSize is propagated if there was a (merchant defined) handleAction call proceeding this one that had it set as an option\n return actionHandler.handleAction(resData.action, pick('challengeWindowSize').from(this.props));\n }\n\n /**\n * Redirect flow (usecase: we thought we could do 3DS2 but it turns out we can't)\n * TODO - check logs: does this ever happen, anymore?\n */\n if (resData.action?.type === 'redirect') {\n return actionHandler.handleAction(resData.action);\n }\n })\n .catch((error: AdyenCheckoutError) => {\n this.handleError(error);\n });\n}\n"],"names":["callSubmit3DS2Fingerprint","data","httpPost","path","this","props","clientKey","loadingContext","errorLevel","then","resData","analyticsErrorObject","type","details","onComplete","console","debug","THREEDS2_ERROR","code","Analytics3DS2Errors","NO_DETAILS_FOR_FRICTIONLESS_OR_REFUSED","errorType","ANALYTICS_ERROR_TYPE","apiError","message","THREEDS2_FINGERPRINT_SUBMIT","submitAnalytics","action","NO_ACTION_FOR_CHALLENGE","actionHandler","elementRef","handleAction","pick","from","NO_COMPONENT_FOR_ACTION","sdkError","catch","error","handleError"],"mappings":"4RAYe,SAASA,GAA0BC,KAAEA,IAChDC,EACI,CACIC,KAAM,sCAAsCC,KAAKC,MAAMC,YACvDC,eAAgBH,KAAKC,MAAME,eAC3BC,WAAY,SAEhB,IACOP,IAGNQ,MAAKC,IACF,IAAIC,EAKJ,GAAqB,cAAjBD,EAAQE,KAAsB,CAC9B,MAAMC,QAAEA,GAAYH,EAEpB,OAAKA,EAAQG,QAiBNT,KAAKU,WAAW,CAAEb,KAAM,CAAEY,cAhB7BE,QAAQC,MACJ,gKACAN,GAGJC,EAAuB,CACnBC,KAAMK,EACNC,KAAMC,EAAoBC,uCAC1BC,UAAWC,EAAqBC,SAChCC,QAAS,GAAGC,4GAGhBrB,KAAKsB,gBAAgBf,GAK7B,CAKA,IAAKD,EAAQiB,OAaT,OAZAZ,QAAQC,MACJ,uHACAN,GAGJC,EAAuB,CACnBC,KAAMK,EACNC,KAAMC,EAAoBS,wBAC1BP,UAAWC,EAAqBC,SAChCC,QAAS,GAAGC,wEAEhBrB,KAAKsB,gBAAgBf,GAKzB,MAAMkB,EAAgBzB,KAAKC,MAAMyB,YAAc1B,KAM/C,OAAKyB,EAgBwB,aAAzBnB,EAAQiB,QAAQf,KAETiB,EAAcE,aAAarB,EAAQiB,OAAQK,EAAK,uBAAuBC,KAAK7B,KAAKC,QAO/D,aAAzBK,EAAQiB,QAAQf,KACTiB,EAAcE,aAAarB,EAAQiB,aAD9C,GAxBIZ,QAAQC,MAAM,uEAEdL,EAAuB,CACnBC,KAAMK,EACNC,KAAMC,EAAoBe,wBAC1Bb,UAAWC,EAAqBa,SAChCX,QAAS,GAAGC,8DAEhBrB,KAAKsB,gBAAgBf,GAkBzB,IAEHyB,OAAOC,IACJjC,KAAKkC,YAAYD,EAAAA,GAE7B"}
@@ -1,2 +1,2 @@
1
- import{Component as e,createElement as r}from"../../../../external/preact/dist/preact.js";import t from"./DoChallenge3DS2.js";import{isErrorObject as s,createOldChallengeResolveData as o,createChallengeResolveData as n,prepareChallengeData as i}from"../utils.js";import a from"../../../internal/Img/Img.js";import{hasOwnProperty as l}from"../../../../utils/hasOwnProperty.js";import p from"../../../../core/Context/useImage.js";import c,{ERROR as h}from"../../../../core/Errors/AdyenCheckoutError.js";import{THREEDS2_ERROR as u,THREEDS2_CHALLENGE_ERROR as m,MISSING_TOKEN_IN_ACTION_MSG as d,THREEDS2_FULL as g,THREEDS2_NUM as S,THREEDS2_CHALLENGE as _}from"../../constants.js";import{isValidHttpUrl as D}from"../../../../utils/isValidURL.js";import{Analytics3DS2Errors as C,ANALYTICS_API_ERROR as E,ANALYTICS_NETWORK_ERROR as I,Analytics3DS2Events as f}from"../../../../core/Analytics/constants.js";function T(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}class y extends e{componentDidMount(){if(!s(this.state.challengeData)){const e="test"===this.props.environment&&this.props._environmentUrls?.api?.includes("http://localhost:8080"),{acsURL:r}=this.state.challengeData;if(!D(r,e)){this.setError({errorInfo:`${C.TOKEN_IS_MISSING_ACSURL}: ${this.props.i18n.get("err.gen.9102")}`},!0);const e={type:u,code:C.TOKEN_IS_MISSING_ACSURL,errorType:E,message:`${m}: Decoded token is missing a valid acsURL property`};return this.props.onSubmitAnalytics(e),void console.debug("### PrepareChallenge3DS2::exiting:: no valid acsURL")}const{acsTransID:t,messageVersion:s,threeDSServerTransID:o}=this.state.challengeData.cReqData;if(!t||!s||!o)return this.setError({errorInfo:`${C.TOKEN_IS_MISSING_OTHER_PROPS}: ${this.props.i18n.get("err.gen.9102")}`},!0),this.props.onSubmitAnalytics({type:u,code:C.TOKEN_IS_MISSING_OTHER_PROPS,errorType:E,message:`${m}: Decoded token is missing one or more of the following properties (acsTransID | messageVersion | threeDSServerTransID)`}),void console.debug("### PrepareChallenge3DS2::exiting:: missing one or more of the following properties (acsTransID | messageVersion | threeDSServerTransID)");this.setState({status:"performingChallenge"})}else{const e=this.state.challengeData.error,r=e.indexOf(d)>-1?C.ACTION_IS_MISSING_TOKEN:C.TOKEN_DECODE_OR_PARSING_FAILED;this.setError({errorInfo:e.indexOf(d)>-1?`${C.ACTION_IS_MISSING_TOKEN}: ${this.props.i18n.get("err.gen.9102")}`:`${C.TOKEN_DECODE_OR_PARSING_FAILED}: ${this.props.i18n.get("err.gen.9102")}`},!0),this.props.onSubmitAnalytics({type:u,code:r,errorType:E,message:`${m}: ${e}`}),console.debug("### PrepareChallenge3DS2::exiting:: no challengeData")}}setStatusComplete(e,r=null){this.setState({status:"complete"},(()=>{const t=(this.props.isMDFlow?o:n)(this.props.dataKey,e.transStatus,this.props.paymentData);let s;r&&console.debug("### PrepareChallenge3DS2::errorCodeObject::",r);const i=r||e;if(i.errorCode){const e={code:"timeout"===i.errorCode?C.THREEDS2_TIMEOUT:C.NO_TRANSSTATUS,errorType:"timeout"===i.errorCode?I:E};s={type:u,message:i.message,...e},this.props.onSubmitAnalytics(s)}let a;switch(e?.transStatus){case"Y":a="success";break;case"N":a="failed";break;case"U":a=r?"timeout":"cancelled"}e?.errorCode&&(a="noTransStatus"),s={type:g,message:`${S} challenge has completed`,subtype:f.CHALLENGE_COMPLETED,result:a},this.props.onSubmitAnalytics(s),this.props.onComplete(t)}))}setError(e,r){this.setState({status:"error",errorInfo:e.errorInfo}),r&&this.props.onError(new c(h,e.errorInfo,{cause:e.errorObj}))}render(e,{challengeData:s}){const o=p();return"performingChallenge"===this.state.status?r(t,{onCompleteChallenge:e=>{let r=null;if(l(e.result,"errorCode")&&e.result.errorCode.length&&(r={errorCode:e.result.errorCode,message:`${m}: ${e.result.errorDescription?e.result.errorDescription:"no transStatus could be retrieved"}`},this.props.isMDFlow&&this.props.onError(new c(h,`${m}: ${e.result.errorDescription?e.result.errorDescription:"no transStatus could be retrieved"}`,{cause:e.result.errorCode}))),!e.result)return this.setError({errorInfo:`${m}: ${this.props.i18n.get("3ds.chal.805",{values:{result:'"result"'}})}`,errorObj:e},!0),this.props.onSubmitAnalytics({type:u,code:C.CHALLENGE_RESOLVED_WITHOUT_RESULT_PROP,errorType:E,message:`${m}: challenge resolved without a "result" object`}),void console.debug('### PrepareChallenge3DS2::exiting:: challenge resolved without a "result" object');this.setStatusComplete(e.result,r)},onErrorChallenge:e=>{if(l(e,"errorCode")){const r={errorCode:e.errorCode,message:`${_}: ${e.errorCode}`};return this.props.isMDFlow&&this.props.onError(new c(h,`${m}: '3DS2 challenge timed out'`,{cause:e.errorCode})),void this.setStatusComplete(e.result,r)}},...s,onActionHandled:this.props.onActionHandled,onFormSubmit:this.onFormSubmit}):"error"===this.state.status?r("div",{className:"adyen-checkout__threeds2-challenge-error"},r(a,{className:"adyen-checkout__status__icon adyen-checkout__status__icon--error",src:o({imageFolder:"components/"})("error"),alt:""}),r("div",{className:"adyen-checkout__status__text"},this.state.errorInfo?this.state.errorInfo:this.props.i18n.get("error.message.unknown"))):null}constructor(e){if(super(e),T(this,"onFormSubmit",(e=>{this.props.onSubmitAnalytics({type:g,message:e,subtype:f.CHALLENGE_DATA_SENT})})),this.props.token){const e=i({token:this.props.token,size:this.props.challengeWindowSize||this.props.size});this.state={status:"init",challengeData:e}}else this.state={challengeData:{success:!1,error:d}},console.debug(`${m}: ${d}`)}}T(y,"defaultProps",{onComplete:()=>{},onError:()=>{},isMDFlow:!1});export{y as default};
1
+ import{Component as e,createElement as r}from"../../../../external/preact/dist/preact.js";import t from"./DoChallenge3DS2.js";import{isErrorObject as s,createOldChallengeResolveData as o,createChallengeResolveData as n,prepareChallengeData as i}from"../utils.js";import a from"../../../internal/Img/Img.js";import{hasOwnProperty as l}from"../../../../utils/hasOwnProperty.js";import p from"../../../../core/Context/useImage.js";import c,{ERROR as h}from"../../../../core/Errors/AdyenCheckoutError.js";import{THREEDS2_ERROR as u,THREEDS2_CHALLENGE_ERROR as m,MISSING_TOKEN_IN_ACTION_MSG as d,THREEDS2_FULL as g,THREEDS2_NUM as S,THREEDS2_CHALLENGE as _}from"../../constants.js";import{isValidHttpUrl as E}from"../../../../utils/isValidURL.js";import{Analytics3DS2Errors as D,ANALYTICS_ERROR_TYPE as C,Analytics3DS2Events as I}from"../../../../core/Analytics/constants.js";function f(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}class T extends e{componentDidMount(){if(!s(this.state.challengeData)){const e="test"===this.props.environment&&this.props._environmentUrls?.api?.includes("http://localhost:8080"),{acsURL:r}=this.state.challengeData;if(!E(r,e)){this.setError({errorInfo:`${D.TOKEN_IS_MISSING_ACSURL}: ${this.props.i18n.get("err.gen.9102")}`},!0);const e={type:u,code:D.TOKEN_IS_MISSING_ACSURL,errorType:C.apiError,message:`${m}: Decoded token is missing a valid acsURL property`};return this.props.onSubmitAnalytics(e),void console.debug("### PrepareChallenge3DS2::exiting:: no valid acsURL")}const{acsTransID:t,messageVersion:s,threeDSServerTransID:o}=this.state.challengeData.cReqData;if(!t||!s||!o)return this.setError({errorInfo:`${D.TOKEN_IS_MISSING_OTHER_PROPS}: ${this.props.i18n.get("err.gen.9102")}`},!0),this.props.onSubmitAnalytics({type:u,code:D.TOKEN_IS_MISSING_OTHER_PROPS,errorType:C.apiError,message:`${m}: Decoded token is missing one or more of the following properties (acsTransID | messageVersion | threeDSServerTransID)`}),void console.debug("### PrepareChallenge3DS2::exiting:: missing one or more of the following properties (acsTransID | messageVersion | threeDSServerTransID)");this.setState({status:"performingChallenge"})}else{const e=this.state.challengeData.error,r=e.indexOf(d)>-1?D.ACTION_IS_MISSING_TOKEN:D.TOKEN_DECODE_OR_PARSING_FAILED;this.setError({errorInfo:e.indexOf(d)>-1?`${D.ACTION_IS_MISSING_TOKEN}: ${this.props.i18n.get("err.gen.9102")}`:`${D.TOKEN_DECODE_OR_PARSING_FAILED}: ${this.props.i18n.get("err.gen.9102")}`},!0),this.props.onSubmitAnalytics({type:u,code:r,errorType:C.apiError,message:`${m}: ${e}`}),console.debug("### PrepareChallenge3DS2::exiting:: no challengeData")}}setStatusComplete(e,r=null){this.setState({status:"complete"},(()=>{const t=(this.props.isMDFlow?o:n)(this.props.dataKey,e.transStatus,this.props.paymentData);let s;r&&console.debug("### PrepareChallenge3DS2::errorCodeObject::",r);const i=r||e;if(i.errorCode){const e={code:"timeout"===i.errorCode?D.THREEDS2_TIMEOUT:D.NO_TRANSSTATUS,errorType:"timeout"===i.errorCode?C.network:C.apiError};s={type:u,message:i.message,...e},this.props.onSubmitAnalytics(s)}let a;switch(e?.transStatus){case"Y":a="success";break;case"N":a="failed";break;case"U":a=r?"timeout":"cancelled"}e?.errorCode&&(a="noTransStatus"),s={type:g,message:`${S} challenge has completed`,subtype:I.CHALLENGE_COMPLETED,result:a},this.props.onSubmitAnalytics(s),this.props.onComplete(t)}))}setError(e,r){this.setState({status:"error",errorInfo:e.errorInfo}),r&&this.props.onError(new c(h,e.errorInfo,{cause:e.errorObj}))}render(e,{challengeData:s}){const o=p();return"performingChallenge"===this.state.status?r(t,{onCompleteChallenge:e=>{let r=null;if(l(e.result,"errorCode")&&e.result.errorCode.length&&(r={errorCode:e.result.errorCode,message:`${m}: ${e.result.errorDescription?e.result.errorDescription:"no transStatus could be retrieved"}`},this.props.isMDFlow&&this.props.onError(new c(h,`${m}: ${e.result.errorDescription?e.result.errorDescription:"no transStatus could be retrieved"}`,{cause:e.result.errorCode}))),!e.result)return this.setError({errorInfo:`${m}: ${this.props.i18n.get("3ds.chal.805",{values:{result:'"result"'}})}`,errorObj:e},!0),this.props.onSubmitAnalytics({type:u,code:D.CHALLENGE_RESOLVED_WITHOUT_RESULT_PROP,errorType:C.apiError,message:`${m}: challenge resolved without a "result" object`}),void console.debug('### PrepareChallenge3DS2::exiting:: challenge resolved without a "result" object');this.setStatusComplete(e.result,r)},onErrorChallenge:e=>{if(l(e,"errorCode")){const r={errorCode:e.errorCode,message:`${_}: ${e.errorCode}`};return this.props.isMDFlow&&this.props.onError(new c(h,`${m}: '3DS2 challenge timed out'`,{cause:e.errorCode})),void this.setStatusComplete(e.result,r)}},...s,onActionHandled:this.props.onActionHandled,onFormSubmit:this.onFormSubmit}):"error"===this.state.status?r("div",{className:"adyen-checkout__threeds2-challenge-error"},r(a,{className:"adyen-checkout__status__icon adyen-checkout__status__icon--error",src:o({imageFolder:"components/"})("error"),alt:""}),r("div",{className:"adyen-checkout__status__text"},this.state.errorInfo?this.state.errorInfo:this.props.i18n.get("error.message.unknown"))):null}constructor(e){if(super(e),f(this,"onFormSubmit",(e=>{this.props.onSubmitAnalytics({type:g,message:e,subtype:I.CHALLENGE_DATA_SENT})})),this.props.token){const e=i({token:this.props.token,size:this.props.challengeWindowSize||this.props.size});this.state={status:"init",challengeData:e}}else this.state={challengeData:{success:!1,error:d}},console.debug(`${m}: ${d}`)}}f(T,"defaultProps",{onComplete:()=>{},onError:()=>{},isMDFlow:!1});export{T as default};
2
2
  //# sourceMappingURL=PrepareChallenge3DS2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PrepareChallenge3DS2.js","sources":["../../../../../../src/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.tsx"],"sourcesContent":["import { Component, h } from 'preact';\nimport DoChallenge3DS2 from './DoChallenge3DS2';\nimport { createChallengeResolveData, prepareChallengeData, createOldChallengeResolveData, isErrorObject } from '../utils';\nimport { PrepareChallenge3DS2Props, PrepareChallenge3DS2State, StatusErrorInfoObject } from './types';\nimport { ChallengeData, ResultObject, ThreeDS2FlowObject, ErrorCodeObject } from '../../types';\nimport '../../ThreeDS2.scss';\nimport Img from '../../../internal/Img';\nimport './challenge.scss';\nimport { hasOwnProperty } from '../../../../utils/hasOwnProperty';\nimport useImage from '../../../../core/Context/useImage';\nimport AdyenCheckoutError, { ERROR } from '../../../../core/Errors/AdyenCheckoutError';\nimport { SendAnalyticsObject } from '../../../../core/Analytics/types';\nimport {\n THREEDS2_CHALLENGE,\n THREEDS2_CHALLENGE_ERROR,\n THREEDS2_FULL,\n THREEDS2_NUM,\n MISSING_TOKEN_IN_ACTION_MSG,\n THREEDS2_ERROR\n} from '../../constants';\nimport { isValidHttpUrl } from '../../../../utils/isValidURL';\nimport { ANALYTICS_API_ERROR, ANALYTICS_NETWORK_ERROR, Analytics3DS2Errors, Analytics3DS2Events } from '../../../../core/Analytics/constants';\nimport { ErrorObject } from '../../../../core/Errors/types';\n\nclass PrepareChallenge3DS2 extends Component<PrepareChallenge3DS2Props, PrepareChallenge3DS2State> {\n public static defaultProps = {\n onComplete: () => {},\n onError: () => {},\n isMDFlow: false\n };\n\n constructor(props) {\n super(props);\n\n if (this.props.token) {\n const challengeData: ChallengeData | ErrorObject = prepareChallengeData({\n token: this.props.token,\n size: this.props.challengeWindowSize || this.props.size // TODO confirm that this.props.size is legacy and can be removed\n });\n\n this.state = {\n status: 'init',\n challengeData: challengeData as ChallengeData\n };\n } else {\n // Will be picked up in componentDidMount\n this.state = { challengeData: { success: false, error: MISSING_TOKEN_IN_ACTION_MSG } };\n\n console.debug(`${THREEDS2_CHALLENGE_ERROR}: ${MISSING_TOKEN_IN_ACTION_MSG}`);\n }\n }\n\n public onFormSubmit = (msg: string) => {\n this.props.onSubmitAnalytics({\n type: THREEDS2_FULL,\n message: msg,\n subtype: Analytics3DS2Events.CHALLENGE_DATA_SENT\n });\n };\n\n componentDidMount() {\n const hasChallengeData = !isErrorObject(this.state.challengeData);\n\n if (hasChallengeData) {\n const shouldAllowHttpDomains =\n /** Allow http urls if in development and testing against localhost:8080 */\n (process.env.NODE_ENV === 'development' && process.env.__CLIENT_ENV__?.indexOf('localhost:8080') > -1) ||\n /**\n * Allows the checkoutshopper demo on localhost:8080 to work -\n * requires a configuration in localhost of environment: 'test', _environmentUrls: {api: 'http://localhost:8080/'}\n */\n (this.props.environment === 'test' && this.props._environmentUrls?.api?.includes('http://localhost:8080'));\n\n /**\n * Check the structure of the created challengeData\n */\n const { acsURL } = this.state.challengeData as ChallengeData;\n const hasValidAcsURL = isValidHttpUrl(acsURL, shouldAllowHttpDomains);\n\n // Only render component if we have an acsURL.\n if (!hasValidAcsURL) {\n // Set UI error & call onError callback\n this.setError(\n {\n errorInfo: `${Analytics3DS2Errors.TOKEN_IS_MISSING_ACSURL}: ${this.props.i18n.get('err.gen.9102')}` //\n },\n true\n );\n\n // Send error to analytics endpoint // TODO - check logs to see if this *ever* happens\n const errorCodeObject: SendAnalyticsObject = {\n type: THREEDS2_ERROR,\n code: Analytics3DS2Errors.TOKEN_IS_MISSING_ACSURL,\n errorType: ANALYTICS_API_ERROR,\n message: `${THREEDS2_CHALLENGE_ERROR}: Decoded token is missing a valid acsURL property`\n // metadata: { acsURL } // NEW TODO - check acsURL isn't secret\n };\n this.props.onSubmitAnalytics(errorCodeObject);\n\n console.debug('### PrepareChallenge3DS2::exiting:: no valid acsURL');\n return;\n }\n\n const { acsTransID, messageVersion, threeDSServerTransID } = (this.state.challengeData as ChallengeData).cReqData;\n\n // Only render component if we have a acsTransID, messageVersion & threeDSServerTransID\n if (!acsTransID || !messageVersion || !threeDSServerTransID) {\n // Set UI error & call onError callback\n this.setError(\n {\n errorInfo: `${Analytics3DS2Errors.TOKEN_IS_MISSING_OTHER_PROPS}: ${this.props.i18n.get('err.gen.9102')}`\n // errorObj: this.state.challengeData // TODO Decide if we want to expose this data\n },\n true\n );\n\n // Send error to analytics endpoint // TODO - check logs to see if this *ever* happens\n this.props.onSubmitAnalytics({\n type: THREEDS2_ERROR,\n code: Analytics3DS2Errors.TOKEN_IS_MISSING_OTHER_PROPS,\n errorType: ANALYTICS_API_ERROR,\n message: `${THREEDS2_CHALLENGE_ERROR}: Decoded token is missing one or more of the following properties (acsTransID | messageVersion | threeDSServerTransID)`\n } as SendAnalyticsObject);\n\n console.debug(\n '### PrepareChallenge3DS2::exiting:: missing one or more of the following properties (acsTransID | messageVersion | threeDSServerTransID)'\n );\n return;\n }\n\n // Proceed to allow component to render\n this.setState({ status: 'performingChallenge' });\n //\n } else {\n const errorMsg: string = (this.state.challengeData as ErrorObject).error;\n\n const errorCode =\n errorMsg.indexOf(MISSING_TOKEN_IN_ACTION_MSG) > -1\n ? Analytics3DS2Errors.ACTION_IS_MISSING_TOKEN\n : Analytics3DS2Errors.TOKEN_DECODE_OR_PARSING_FAILED;\n\n // Set UI error & call onError callback\n this.setError(\n {\n errorInfo:\n errorMsg.indexOf(MISSING_TOKEN_IN_ACTION_MSG) > -1\n ? `${Analytics3DS2Errors.ACTION_IS_MISSING_TOKEN}: ${this.props.i18n.get('err.gen.9102')}`\n : `${Analytics3DS2Errors.TOKEN_DECODE_OR_PARSING_FAILED}: ${this.props.i18n.get('err.gen.9102')}`\n // errorObj: this.state.challengeData // TODO Decide if we want to expose this data\n },\n true\n );\n\n // Send error to analytics endpoint // TODO - check logs to see if the base64 decoding errors *ever* happen\n this.props.onSubmitAnalytics({\n type: THREEDS2_ERROR,\n code: errorCode,\n errorType: ANALYTICS_API_ERROR,\n message: `${THREEDS2_CHALLENGE_ERROR}: ${errorMsg}` // can be: 'Missing \"token\" property from threeDS2 action', 'not base64', 'malformed URI sequence' or 'Could not JSON parse token'\n });\n\n console.debug('### PrepareChallenge3DS2::exiting:: no challengeData');\n }\n }\n\n setStatusComplete(resultObj: ResultObject, errorCodeObject: ErrorCodeObject = null) {\n this.setState({ status: 'complete' }, () => {\n /**\n * Create the data in the way that the /details endpoint expects.\n * This is different for the flow triggered by the threeds2InMDFlow process than for the new, v67, 'threeDS2' action\n */\n const resolveDataFunction = this.props.isMDFlow ? createOldChallengeResolveData : createChallengeResolveData;\n const data = resolveDataFunction(this.props.dataKey, resultObj.transStatus, this.props.paymentData);\n\n if (errorCodeObject) {\n console.debug('### PrepareChallenge3DS2::errorCodeObject::', errorCodeObject);\n }\n\n let analyticsObject: SendAnalyticsObject;\n\n /** Are we in an \"error\" i.e. timeout or no transStatus, scenario? If so, submit analytics about it */\n const finalResObject = errorCodeObject ? errorCodeObject : resultObj;\n if (finalResObject.errorCode) {\n const errorTypeAndCode = {\n code: finalResObject.errorCode === 'timeout' ? Analytics3DS2Errors.THREEDS2_TIMEOUT : Analytics3DS2Errors.NO_TRANSSTATUS,\n errorType: finalResObject.errorCode === 'timeout' ? ANALYTICS_NETWORK_ERROR : ANALYTICS_API_ERROR\n };\n\n // Challenge process has timed out,\n // or, It's an error reported by the backend 'cos no transStatus could be retrieved // TODO - check logs to see if this *ever* happens\n analyticsObject = {\n type: THREEDS2_ERROR,\n message: (finalResObject as ErrorCodeObject).message,\n ...errorTypeAndCode\n };\n\n // Send error to analytics endpoint\n this.props.onSubmitAnalytics(analyticsObject);\n }\n\n /** Calculate \"result\" for analytics */\n let result: string;\n\n switch (resultObj?.transStatus) {\n case 'Y':\n result = 'success';\n break;\n case 'N':\n result = 'failed';\n break;\n case 'U':\n result = !errorCodeObject ? 'cancelled' : 'timeout';\n break;\n default:\n }\n if (resultObj?.errorCode) {\n result = 'noTransStatus';\n }\n\n /** Create log object - the process is completed, one way or another */\n analyticsObject = {\n type: THREEDS2_FULL,\n message: `${THREEDS2_NUM} challenge has completed`,\n subtype: Analytics3DS2Events.CHALLENGE_COMPLETED,\n result\n };\n\n // Send log to analytics endpoint\n this.props.onSubmitAnalytics(analyticsObject);\n\n /**\n * Equals call to onAdditionalDetails (except for in 3DS2InMDFlow)\n */\n this.props.onComplete(data);\n });\n }\n\n /**\n * Display error in the UI,\n * and, optionally, decide whether to send any of these errors to the merchant defined onError callback\n *\n * @param errorInfoObj -\n * @param isFatal -\n */\n setError(errorInfoObj: StatusErrorInfoObject, isFatal: boolean) {\n this.setState({ status: 'error', errorInfo: errorInfoObj.errorInfo });\n\n // Decide whether to call this.props.onError\n if (isFatal) {\n this.props.onError(new AdyenCheckoutError(ERROR, errorInfoObj.errorInfo, { cause: errorInfoObj.errorObj }));\n }\n }\n\n render(_, { challengeData }) {\n const getImage = useImage();\n if (this.state.status === 'performingChallenge') {\n return (\n <DoChallenge3DS2\n onCompleteChallenge={(challenge: ThreeDS2FlowObject) => {\n let errorCodeObject: ErrorCodeObject = null;\n\n // Challenge has resulted in an error (no transStatus could be retrieved) - but we still treat this as a valid scenario\n if (hasOwnProperty(challenge.result, 'errorCode') && challenge.result.errorCode.length) {\n // Tell the merchant there's been an error\n errorCodeObject = {\n errorCode: challenge.result.errorCode,\n message: `${THREEDS2_CHALLENGE_ERROR}: ${\n challenge.result.errorDescription ? challenge.result.errorDescription : 'no transStatus could be retrieved'\n }`\n };\n\n /**\n * NOTE: we can now use this.props.isMDFlow to decide if we want to send any of these errors to the onError handler\n * - this is problematic in the regular flow since merchants tend to treat any calls to their onError handler as 'fatal',\n * but in the MDFlow we control what the onError handler does.\n */\n if (this.props.isMDFlow) {\n this.props.onError(\n new AdyenCheckoutError(\n ERROR,\n `${THREEDS2_CHALLENGE_ERROR}: ${\n challenge.result.errorDescription\n ? challenge.result.errorDescription\n : 'no transStatus could be retrieved'\n }`,\n { cause: challenge.result.errorCode }\n )\n );\n }\n }\n\n /**\n * An object has been returned, parsed & accepted as legit (according to the rules in getProcessMessageHandler),\n * but the result prop on that object is missing\n */\n if (!challenge.result) {\n this.setError(\n {\n errorInfo: `${THREEDS2_CHALLENGE_ERROR}: ${this.props.i18n.get('3ds.chal.805', {\n values: { result: '\"result\"' }\n })}`,\n errorObj: challenge as unknown as ErrorObject\n },\n true\n );\n\n // Send error to analytics endpoint\n this.props.onSubmitAnalytics({\n type: THREEDS2_ERROR,\n code: Analytics3DS2Errors.CHALLENGE_RESOLVED_WITHOUT_RESULT_PROP,\n errorType: ANALYTICS_API_ERROR,\n message: `${THREEDS2_CHALLENGE_ERROR}: challenge resolved without a \"result\" object`\n });\n\n console.debug('### PrepareChallenge3DS2::exiting:: challenge resolved without a \"result\" object');\n\n return;\n }\n\n // Proceed with call to onAdditionalDetails (except for in 3DS2InMDFlow)\n this.setStatusComplete(challenge.result, errorCodeObject);\n }}\n onErrorChallenge={(challenge: ThreeDS2FlowObject) => {\n /**\n * Called when challenge times-out (which is still a valid scenario)...\n */\n if (hasOwnProperty(challenge, 'errorCode')) {\n const timeoutObject: ErrorCodeObject = {\n errorCode: challenge.errorCode,\n message: `${THREEDS2_CHALLENGE}: ${challenge.errorCode}`\n };\n\n // see comment in onCompleteChallenge code block\n if (this.props.isMDFlow) {\n this.props.onError(\n new AdyenCheckoutError(ERROR, `${THREEDS2_CHALLENGE_ERROR}: '3DS2 challenge timed out'`, {\n cause: challenge.errorCode\n })\n );\n }\n\n this.setStatusComplete(challenge.result, timeoutObject);\n return;\n }\n }}\n {...challengeData}\n onActionHandled={this.props.onActionHandled}\n onFormSubmit={this.onFormSubmit}\n />\n );\n }\n\n if (this.state.status === 'error') {\n return (\n <div className=\"adyen-checkout__threeds2-challenge-error\">\n <Img\n className=\"adyen-checkout__status__icon adyen-checkout__status__icon--error\"\n src={getImage({\n imageFolder: 'components/'\n })('error')}\n alt={''}\n />\n <div className=\"adyen-checkout__status__text\">\n {this.state.errorInfo ? this.state.errorInfo : this.props.i18n.get('error.message.unknown')}\n </div>\n </div>\n );\n }\n\n return null;\n }\n}\n\nexport default PrepareChallenge3DS2;\n"],"names":["PrepareChallenge3DS2","Component","componentDidMount","isErrorObject","this","state","challengeData","shouldAllowHttpDomains","props","environment","_environmentUrls","api","includes","acsURL","isValidHttpUrl","setError","errorInfo","Analytics3DS2Errors","TOKEN_IS_MISSING_ACSURL","i18n","get","errorCodeObject","type","THREEDS2_ERROR","code","errorType","ANALYTICS_API_ERROR","message","THREEDS2_CHALLENGE_ERROR","onSubmitAnalytics","console","debug","acsTransID","messageVersion","threeDSServerTransID","cReqData","TOKEN_IS_MISSING_OTHER_PROPS","setState","status","errorMsg","error","errorCode","indexOf","MISSING_TOKEN_IN_ACTION_MSG","ACTION_IS_MISSING_TOKEN","TOKEN_DECODE_OR_PARSING_FAILED","setStatusComplete","resultObj","data","isMDFlow","createOldChallengeResolveData","createChallengeResolveData","dataKey","transStatus","paymentData","analyticsObject","finalResObject","errorTypeAndCode","THREEDS2_TIMEOUT","NO_TRANSSTATUS","ANALYTICS_NETWORK_ERROR","result","THREEDS2_FULL","THREEDS2_NUM","subtype","Analytics3DS2Events","CHALLENGE_COMPLETED","onComplete","errorInfoObj","isFatal","onError","AdyenCheckoutError","ERROR","cause","errorObj","render","_","getImage","useImage","h","DoChallenge3DS2","onCompleteChallenge","challenge","hasOwnProperty","length","errorDescription","values","CHALLENGE_RESOLVED_WITHOUT_RESULT_PROP","onErrorChallenge","timeoutObject","THREEDS2_CHALLENGE","onActionHandled","onFormSubmit","div","className","Img","src","imageFolder","alt","constructor","super","_define_property","msg","CHALLENGE_DATA_SENT","token","prepareChallengeData","size","challengeWindowSize","success","defaultProps"],"mappings":"2/BAwBA,MAAMA,UAA6BC,EAoC/BC,iBAAAA,GAGI,IAF0BC,EAAcC,KAAKC,MAAMC,eAE7B,CAClB,MAAMC,EAO0B,SAA3BH,KAAKI,MAAMC,aAA0BL,KAAKI,MAAME,kBAAkBC,KAAKC,SAAS,0BAK/EC,OAAEA,GAAWT,KAAKC,MAAMC,cAI9B,IAHuBQ,EAAeD,EAAQN,GAGzB,CAEjBH,KAAKW,SACD,CACIC,UAAW,GAAGC,EAAoBC,4BAA4Bd,KAAKI,MAAMW,KAAKC,IAAI,oBAEtF,GAIJ,MAAMC,EAAuC,CACzCC,KAAMC,EACNC,KAAMP,EAAoBC,wBAC1BO,UAAWC,EACXC,QAAS,GAAGC,uDAMhB,OAHAxB,KAAKI,MAAMqB,kBAAkBR,QAE7BS,QAAQC,MAAM,sDAElB,CAEA,MAAMC,WAAEA,EAAUC,eAAEA,EAAcC,qBAAEA,GAA0B9B,KAAKC,MAAMC,cAAgC6B,SAGzG,IAAKH,IAAeC,IAAmBC,EAqBnC,OAnBA9B,KAAKW,SACD,CACIC,UAAW,GAAGC,EAAoBmB,iCAAiChC,KAAKI,MAAMW,KAAKC,IAAI,oBAG3F,GAIJhB,KAAKI,MAAMqB,kBAAkB,CACzBP,KAAMC,EACNC,KAAMP,EAAoBmB,6BAC1BX,UAAWC,EACXC,QAAS,GAAGC,kIAGhBE,QAAQC,MACJ,4IAMR3B,KAAKiC,SAAS,CAAEC,OAAQ,4BAErB,CACH,MAAMC,EAAmBnC,KAAMC,MAAMC,cAA8BkC,MAE7DC,EACFF,EAASG,QAAQC,IAAgC,EAC3C1B,EAAoB2B,wBACpB3B,EAAoB4B,+BAG9BzC,KAAKW,SACD,CACIC,UACIuB,EAASG,QAAQC,IAAgC,EAC3C,GAAG1B,EAAoB2B,4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,MAAOS,EAAUzC,kBAK7BrC,KAAK0C,kBAAkBoC,EAAUrB,OAAQ4B,EAE7C,MAEAnF,EACJqF,gBAAiBvF,KAAKI,MAAMmF,gBAC5BC,aAAcxF,KAAKwF,eAKL,UAAtBxF,KAAKC,MAAMiC,OAEPyC,EAACc,MAAAA,CAAIC,UAAU,4CACXf,EAACgB,EAAAA,CACGD,UAAU,mEACVE,IAAKnB,EAAS,CACVoB,YAAa,eADZpB,CAEF,SACHqB,IAAK,KAETnB,EAACc,MAAAA,CAAIC,UAAU,gCACV1F,KAAKC,MAAMW,UAAYZ,KAAKC,MAAMW,UAAYZ,KAAKI,MAAMW,KAAKC,IAAI,2BAM5E,IACX,CAnVA+E,WAAAA,CAAY3F,GAGR,GAFA4F,MAAM5F,GAoBV6F,EAAAjG,KAAOwF,gBAAgBU,IACnBlG,KAAKI,MAAMqB,kBAAkB,CACzBP,KAAMwC,EACNnC,QAAS2E,EACTtC,QAASC,EAAoBsC,qBACjC,IAvBInG,KAAKI,MAAMgG,MAAO,CAClB,MAAMlG,EAA6CmG,EAAqB,CACpED,MAAOpG,KAAKI,MAAMgG,MAClBE,KAAMtG,KAAKI,MAAMmG,qBAAuBvG,KAAKI,MAAMkG,OAGvDtG,KAAKC,MAAQ,CACTiC,OAAQ,OACRhC,cAAeA,QAInBF,KAAKC,MAAQ,CAAEC,cAAe,CAAEsG,SAAS,EAAOpE,MAAOG,IAEvDb,QAAQC,MAAM,GAAGH,MAA6Be,IAEtD,EAzBA0D,EADErG,EACY6G,eAAe,CACzB1C,WAAY,OACZG,QAAS,OACTrB,UAAU"}
1
+ {"version":3,"file":"PrepareChallenge3DS2.js","sources":["../../../../../../src/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.tsx"],"sourcesContent":["import { Component, h } from 'preact';\nimport DoChallenge3DS2 from './DoChallenge3DS2';\nimport { createChallengeResolveData, prepareChallengeData, createOldChallengeResolveData, isErrorObject } from '../utils';\nimport { PrepareChallenge3DS2Props, PrepareChallenge3DS2State, StatusErrorInfoObject } from './types';\nimport { ChallengeData, ResultObject, ThreeDS2FlowObject, ErrorCodeObject } from '../../types';\nimport '../../ThreeDS2.scss';\nimport Img from '../../../internal/Img';\nimport './challenge.scss';\nimport { hasOwnProperty } from '../../../../utils/hasOwnProperty';\nimport useImage from '../../../../core/Context/useImage';\nimport AdyenCheckoutError, { ERROR } from '../../../../core/Errors/AdyenCheckoutError';\nimport { SendAnalyticsObject } from '../../../../core/Analytics/types';\nimport {\n THREEDS2_CHALLENGE,\n THREEDS2_CHALLENGE_ERROR,\n THREEDS2_FULL,\n THREEDS2_NUM,\n MISSING_TOKEN_IN_ACTION_MSG,\n THREEDS2_ERROR\n} from '../../constants';\nimport { isValidHttpUrl } from '../../../../utils/isValidURL';\nimport { ANALYTICS_ERROR_TYPE, Analytics3DS2Errors, Analytics3DS2Events } from '../../../../core/Analytics/constants';\nimport { ErrorObject } from '../../../../core/Errors/types';\n\nclass PrepareChallenge3DS2 extends Component<PrepareChallenge3DS2Props, PrepareChallenge3DS2State> {\n public static defaultProps = {\n onComplete: () => {},\n onError: () => {},\n isMDFlow: false\n };\n\n constructor(props) {\n super(props);\n\n if (this.props.token) {\n const challengeData: ChallengeData | ErrorObject = prepareChallengeData({\n token: this.props.token,\n size: this.props.challengeWindowSize || this.props.size // TODO confirm that this.props.size is legacy and can be removed\n });\n\n this.state = {\n status: 'init',\n challengeData: challengeData as ChallengeData\n };\n } else {\n // Will be picked up in componentDidMount\n this.state = { challengeData: { success: false, error: MISSING_TOKEN_IN_ACTION_MSG } };\n\n console.debug(`${THREEDS2_CHALLENGE_ERROR}: ${MISSING_TOKEN_IN_ACTION_MSG}`);\n }\n }\n\n public onFormSubmit = (msg: string) => {\n this.props.onSubmitAnalytics({\n type: THREEDS2_FULL,\n message: msg,\n subtype: Analytics3DS2Events.CHALLENGE_DATA_SENT\n });\n };\n\n componentDidMount() {\n const hasChallengeData = !isErrorObject(this.state.challengeData);\n\n if (hasChallengeData) {\n const shouldAllowHttpDomains =\n /** Allow http urls if in development and testing against localhost:8080 */\n (process.env.NODE_ENV === 'development' && process.env.__CLIENT_ENV__?.indexOf('localhost:8080') > -1) ||\n /**\n * Allows the checkoutshopper demo on localhost:8080 to work -\n * requires a configuration in localhost of environment: 'test', _environmentUrls: {api: 'http://localhost:8080/'}\n */\n (this.props.environment === 'test' && this.props._environmentUrls?.api?.includes('http://localhost:8080'));\n\n /**\n * Check the structure of the created challengeData\n */\n const { acsURL } = this.state.challengeData as ChallengeData;\n const hasValidAcsURL = isValidHttpUrl(acsURL, shouldAllowHttpDomains);\n\n // Only render component if we have an acsURL.\n if (!hasValidAcsURL) {\n // Set UI error & call onError callback\n this.setError(\n {\n errorInfo: `${Analytics3DS2Errors.TOKEN_IS_MISSING_ACSURL}: ${this.props.i18n.get('err.gen.9102')}` //\n },\n true\n );\n\n // Send error to analytics endpoint // TODO - check logs to see if this *ever* happens\n const errorCodeObject: SendAnalyticsObject = {\n type: THREEDS2_ERROR,\n code: Analytics3DS2Errors.TOKEN_IS_MISSING_ACSURL,\n errorType: ANALYTICS_ERROR_TYPE.apiError,\n message: `${THREEDS2_CHALLENGE_ERROR}: Decoded token is missing a valid acsURL property`\n // metadata: { acsURL } // NEW TODO - check acsURL isn't secret\n };\n this.props.onSubmitAnalytics(errorCodeObject);\n\n console.debug('### PrepareChallenge3DS2::exiting:: no valid acsURL');\n return;\n }\n\n const { acsTransID, messageVersion, threeDSServerTransID } = (this.state.challengeData as ChallengeData).cReqData;\n\n // Only render component if we have a acsTransID, messageVersion & threeDSServerTransID\n if (!acsTransID || !messageVersion || !threeDSServerTransID) {\n // Set UI error & call onError callback\n this.setError(\n {\n errorInfo: `${Analytics3DS2Errors.TOKEN_IS_MISSING_OTHER_PROPS}: ${this.props.i18n.get('err.gen.9102')}`\n // errorObj: this.state.challengeData // TODO Decide if we want to expose this data\n },\n true\n );\n\n // Send error to analytics endpoint // TODO - check logs to see if this *ever* happens\n this.props.onSubmitAnalytics({\n type: THREEDS2_ERROR,\n code: Analytics3DS2Errors.TOKEN_IS_MISSING_OTHER_PROPS,\n errorType: ANALYTICS_ERROR_TYPE.apiError,\n message: `${THREEDS2_CHALLENGE_ERROR}: Decoded token is missing one or more of the following properties (acsTransID | messageVersion | threeDSServerTransID)`\n } as SendAnalyticsObject);\n\n console.debug(\n '### PrepareChallenge3DS2::exiting:: missing one or more of the following properties (acsTransID | messageVersion | threeDSServerTransID)'\n );\n return;\n }\n\n // Proceed to allow component to render\n this.setState({ status: 'performingChallenge' });\n //\n } else {\n const errorMsg: string = (this.state.challengeData as ErrorObject).error;\n\n const errorCode =\n errorMsg.indexOf(MISSING_TOKEN_IN_ACTION_MSG) > -1\n ? Analytics3DS2Errors.ACTION_IS_MISSING_TOKEN\n : Analytics3DS2Errors.TOKEN_DECODE_OR_PARSING_FAILED;\n\n // Set UI error & call onError callback\n this.setError(\n {\n errorInfo:\n errorMsg.indexOf(MISSING_TOKEN_IN_ACTION_MSG) > -1\n ? `${Analytics3DS2Errors.ACTION_IS_MISSING_TOKEN}: ${this.props.i18n.get('err.gen.9102')}`\n : `${Analytics3DS2Errors.TOKEN_DECODE_OR_PARSING_FAILED}: ${this.props.i18n.get('err.gen.9102')}`\n // errorObj: this.state.challengeData // TODO Decide if we want to expose this data\n },\n true\n );\n\n // Send error to analytics endpoint // TODO - check logs to see if the base64 decoding errors *ever* happen\n this.props.onSubmitAnalytics({\n type: THREEDS2_ERROR,\n code: errorCode,\n errorType: ANALYTICS_ERROR_TYPE.apiError,\n message: `${THREEDS2_CHALLENGE_ERROR}: ${errorMsg}` // can be: 'Missing \"token\" property from threeDS2 action', 'not base64', 'malformed URI sequence' or 'Could not JSON parse token'\n });\n\n console.debug('### PrepareChallenge3DS2::exiting:: no challengeData');\n }\n }\n\n setStatusComplete(resultObj: ResultObject, errorCodeObject: ErrorCodeObject = null) {\n this.setState({ status: 'complete' }, () => {\n /**\n * Create the data in the way that the /details endpoint expects.\n * This is different for the flow triggered by the threeds2InMDFlow process than for the new, v67, 'threeDS2' action\n */\n const resolveDataFunction = this.props.isMDFlow ? createOldChallengeResolveData : createChallengeResolveData;\n const data = resolveDataFunction(this.props.dataKey, resultObj.transStatus, this.props.paymentData);\n\n if (errorCodeObject) {\n console.debug('### PrepareChallenge3DS2::errorCodeObject::', errorCodeObject);\n }\n\n let analyticsObject: SendAnalyticsObject;\n\n /** Are we in an \"error\" i.e. timeout or no transStatus, scenario? If so, submit analytics about it */\n const finalResObject = errorCodeObject ? errorCodeObject : resultObj;\n if (finalResObject.errorCode) {\n const errorTypeAndCode = {\n code: finalResObject.errorCode === 'timeout' ? Analytics3DS2Errors.THREEDS2_TIMEOUT : Analytics3DS2Errors.NO_TRANSSTATUS,\n errorType: finalResObject.errorCode === 'timeout' ? ANALYTICS_ERROR_TYPE.network : ANALYTICS_ERROR_TYPE.apiError\n };\n\n // Challenge process has timed out,\n // or, It's an error reported by the backend 'cos no transStatus could be retrieved // TODO - check logs to see if this *ever* happens\n analyticsObject = {\n type: THREEDS2_ERROR,\n message: (finalResObject as ErrorCodeObject).message,\n ...errorTypeAndCode\n };\n\n // Send error to analytics endpoint\n this.props.onSubmitAnalytics(analyticsObject);\n }\n\n /** Calculate \"result\" for analytics */\n let result: string;\n\n switch (resultObj?.transStatus) {\n case 'Y':\n result = 'success';\n break;\n case 'N':\n result = 'failed';\n break;\n case 'U':\n result = !errorCodeObject ? 'cancelled' : 'timeout';\n break;\n default:\n }\n if (resultObj?.errorCode) {\n result = 'noTransStatus';\n }\n\n /** Create log object - the process is completed, one way or another */\n analyticsObject = {\n type: THREEDS2_FULL,\n message: `${THREEDS2_NUM} challenge has completed`,\n subtype: Analytics3DS2Events.CHALLENGE_COMPLETED,\n result\n };\n\n // Send log to analytics endpoint\n this.props.onSubmitAnalytics(analyticsObject);\n\n /**\n * Equals call to onAdditionalDetails (except for in 3DS2InMDFlow)\n */\n this.props.onComplete(data);\n });\n }\n\n /**\n * Display error in the UI,\n * and, optionally, decide whether to send any of these errors to the merchant defined onError callback\n *\n * @param errorInfoObj -\n * @param isFatal -\n */\n setError(errorInfoObj: StatusErrorInfoObject, isFatal: boolean) {\n this.setState({ status: 'error', errorInfo: errorInfoObj.errorInfo });\n\n // Decide whether to call this.props.onError\n if (isFatal) {\n this.props.onError(new AdyenCheckoutError(ERROR, errorInfoObj.errorInfo, { cause: errorInfoObj.errorObj }));\n }\n }\n\n render(_, { challengeData }) {\n const getImage = useImage();\n if (this.state.status === 'performingChallenge') {\n return (\n <DoChallenge3DS2\n onCompleteChallenge={(challenge: ThreeDS2FlowObject) => {\n let errorCodeObject: ErrorCodeObject = null;\n\n // Challenge has resulted in an error (no transStatus could be retrieved) - but we still treat this as a valid scenario\n if (hasOwnProperty(challenge.result, 'errorCode') && challenge.result.errorCode.length) {\n // Tell the merchant there's been an error\n errorCodeObject = {\n errorCode: challenge.result.errorCode,\n message: `${THREEDS2_CHALLENGE_ERROR}: ${\n challenge.result.errorDescription ? challenge.result.errorDescription : 'no transStatus could be retrieved'\n }`\n };\n\n /**\n * NOTE: we can now use this.props.isMDFlow to decide if we want to send any of these errors to the onError handler\n * - this is problematic in the regular flow since merchants tend to treat any calls to their onError handler as 'fatal',\n * but in the MDFlow we control what the onError handler does.\n */\n if (this.props.isMDFlow) {\n this.props.onError(\n new AdyenCheckoutError(\n ERROR,\n `${THREEDS2_CHALLENGE_ERROR}: ${\n challenge.result.errorDescription\n ? challenge.result.errorDescription\n : 'no transStatus could be retrieved'\n }`,\n { cause: challenge.result.errorCode }\n )\n );\n }\n }\n\n /**\n * An object has been returned, parsed & accepted as legit (according to the rules in getProcessMessageHandler),\n * but the result prop on that object is missing\n */\n if (!challenge.result) {\n this.setError(\n {\n errorInfo: `${THREEDS2_CHALLENGE_ERROR}: ${this.props.i18n.get('3ds.chal.805', {\n values: { result: '\"result\"' }\n })}`,\n errorObj: challenge as unknown as ErrorObject\n },\n true\n );\n\n // Send error to analytics endpoint\n this.props.onSubmitAnalytics({\n type: THREEDS2_ERROR,\n code: Analytics3DS2Errors.CHALLENGE_RESOLVED_WITHOUT_RESULT_PROP,\n errorType: ANALYTICS_ERROR_TYPE.apiError,\n message: `${THREEDS2_CHALLENGE_ERROR}: challenge resolved without a \"result\" object`\n });\n\n console.debug('### PrepareChallenge3DS2::exiting:: challenge resolved without a \"result\" object');\n\n return;\n }\n\n // Proceed with call to onAdditionalDetails (except for in 3DS2InMDFlow)\n this.setStatusComplete(challenge.result, errorCodeObject);\n }}\n onErrorChallenge={(challenge: ThreeDS2FlowObject) => {\n /**\n * Called when challenge times-out (which is still a valid scenario)...\n */\n if (hasOwnProperty(challenge, 'errorCode')) {\n const timeoutObject: ErrorCodeObject = {\n errorCode: challenge.errorCode,\n message: `${THREEDS2_CHALLENGE}: ${challenge.errorCode}`\n };\n\n // see comment in onCompleteChallenge code block\n if (this.props.isMDFlow) {\n this.props.onError(\n new AdyenCheckoutError(ERROR, `${THREEDS2_CHALLENGE_ERROR}: '3DS2 challenge timed out'`, {\n cause: challenge.errorCode\n })\n );\n }\n\n this.setStatusComplete(challenge.result, timeoutObject);\n return;\n }\n }}\n {...challengeData}\n onActionHandled={this.props.onActionHandled}\n onFormSubmit={this.onFormSubmit}\n />\n );\n }\n\n if (this.state.status === 'error') {\n return (\n <div className=\"adyen-checkout__threeds2-challenge-error\">\n <Img\n className=\"adyen-checkout__status__icon adyen-checkout__status__icon--error\"\n src={getImage({\n imageFolder: 'components/'\n })('error')}\n alt={''}\n />\n <div className=\"adyen-checkout__status__text\">\n {this.state.errorInfo ? this.state.errorInfo : this.props.i18n.get('error.message.unknown')}\n </div>\n </div>\n );\n }\n\n return null;\n }\n}\n\nexport default PrepareChallenge3DS2;\n"],"names":["PrepareChallenge3DS2","Component","componentDidMount","isErrorObject","this","state","challengeData","shouldAllowHttpDomains","props","environment","_environmentUrls","api","includes","acsURL","isValidHttpUrl","setError","errorInfo","Analytics3DS2Errors","TOKEN_IS_MISSING_ACSURL","i18n","get","errorCodeObject","type","THREEDS2_ERROR","code","errorType","ANALYTICS_ERROR_TYPE","apiError","message","THREEDS2_CHALLENGE_ERROR","onSubmitAnalytics","console","debug","acsTransID","messageVersion","threeDSServerTransID","cReqData","TOKEN_IS_MISSING_OTHER_PROPS","setState","status","errorMsg","error","errorCode","indexOf","MISSING_TOKEN_IN_ACTION_MSG","ACTION_IS_MISSING_TOKEN","TOKEN_DECODE_OR_PARSING_FAILED","setStatusComplete","resultObj","data","isMDFlow","createOldChallengeResolveData","createChallengeResolveData","dataKey","transStatus","paymentData","analyticsObject","finalResObject","errorTypeAndCode","THREEDS2_TIMEOUT","NO_TRANSSTATUS","network","result","THREEDS2_FULL","THREEDS2_NUM","subtype","Analytics3DS2Events","CHALLENGE_COMPLETED","onComplete","errorInfoObj","isFatal","onError","AdyenCheckoutError","ERROR","cause","errorObj","render","_","getImage","useImage","h","DoChallenge3DS2","onCompleteChallenge","challenge","hasOwnProperty","length","errorDescription","values","CHALLENGE_RESOLVED_WITHOUT_RESULT_PROP","onErrorChallenge","timeoutObject","THREEDS2_CHALLENGE","onActionHandled","onFormSubmit","div","className","Img","src","imageFolder","alt","constructor","super","_define_property","msg","CHALLENGE_DATA_SENT","token","prepareChallengeData","size","challengeWindowSize","success","defaultProps"],"mappings":"+9BAwBA,MAAMA,UAA6BC,EAoC/BC,iBAAAA,GAGI,IAF0BC,EAAcC,KAAKC,MAAMC,eAE7B,CAClB,MAAMC,EAO0B,SAA3BH,KAAKI,MAAMC,aAA0BL,KAAKI,MAAME,kBAAkBC,KAAKC,SAAS,0BAK/EC,OAAEA,GAAWT,KAAKC,MAAMC,cAI9B,IAHuBQ,EAAeD,EAAQN,GAGzB,CAEjBH,KAAKW,SACD,CACIC,UAAW,GAAGC,EAAoBC,4BAA4Bd,KAAKI,MAAMW,KAAKC,IAAI,oBAEtF,GAIJ,MAAMC,EAAuC,CACzCC,KAAMC,EACNC,KAAMP,EAAoBC,wBAC1BO,UAAWC,EAAqBC,SAChCC,QAAS,GAAGC,uDAMhB,OAHAzB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