@adyen/adyen-web 6.0.0-beta.0 → 6.0.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 (691) hide show
  1. package/README.md +123 -182
  2. package/dist/cjs/adyen.css +15 -11
  3. package/dist/cjs/adyen.css.map +1 -1
  4. package/dist/cjs/index.cjs +2 -2
  5. package/dist/cjs/index.cjs.map +1 -1
  6. package/dist/cjs/index.d.cts +834 -847
  7. package/dist/es/adyen.css +15 -11
  8. package/dist/es/adyen.css.map +1 -1
  9. package/dist/es/components/ANCV/ANCV.js +1 -1
  10. package/dist/es/components/ANCV/ANCV.js.map +1 -1
  11. package/dist/es/components/Ach/Ach.js +1 -1
  12. package/dist/es/components/Ach/Ach.js.map +1 -1
  13. package/dist/es/components/Ach/components/AchInput/AchInput.js +1 -1
  14. package/dist/es/components/Ach/components/AchInput/AchInput.js.map +1 -1
  15. package/dist/es/components/Ach/components/AchInput/components/AchSFInput.js +1 -1
  16. package/dist/es/components/Ach/components/AchInput/components/AchSFInput.js.map +1 -1
  17. package/dist/es/components/AmazonPay/components/AmazonPayButton.js.map +1 -1
  18. package/dist/es/components/AmazonPay/components/AmazonPayComponent.js.map +1 -1
  19. package/dist/es/components/AmazonPay/components/SignOutButton.js.map +1 -1
  20. package/dist/es/components/ApplePay/ApplePayService.js.map +1 -1
  21. package/dist/es/components/ApplePay/components/ApplePayButton.js.map +1 -1
  22. package/dist/es/components/Card/Card.js +1 -1
  23. package/dist/es/components/Card/Card.js.map +1 -1
  24. package/dist/es/components/Card/components/CardInput/CardInput.js +1 -1
  25. package/dist/es/components/Card/components/CardInput/CardInput.js.map +1 -1
  26. package/dist/es/components/Card/components/CardInput/components/CVC.js +1 -1
  27. package/dist/es/components/Card/components/CardInput/components/CVC.js.map +1 -1
  28. package/dist/es/components/Card/components/CardInput/components/CVCHint.js.map +1 -1
  29. package/dist/es/components/Card/components/CardInput/components/CardNumber.js +1 -1
  30. package/dist/es/components/Card/components/CardInput/components/CardNumber.js.map +1 -1
  31. package/dist/es/components/Card/components/CardInput/components/DualBrandingIcon/DualBrandingIcon.js.map +1 -1
  32. package/dist/es/components/Card/components/CardInput/components/ExpirationDate.js +1 -1
  33. package/dist/es/components/Card/components/CardInput/components/ExpirationDate.js.map +1 -1
  34. package/dist/es/components/Card/components/CardInput/components/{IframeLabelAlternative.js → FieldLabelAlternative.js} +1 -1
  35. package/dist/es/components/Card/components/CardInput/components/FieldLabelAlternative.js.map +1 -0
  36. package/dist/es/components/Card/components/CardInput/components/Installments/Installments.js +1 -1
  37. package/dist/es/components/Card/components/CardInput/components/Installments/Installments.js.map +1 -1
  38. package/dist/es/components/Card/components/CardInput/components/KCPAuthentication.js +1 -1
  39. package/dist/es/components/Card/components/CardInput/components/KCPAuthentication.js.map +1 -1
  40. package/dist/es/components/Card/components/CardInput/defaultProps.js +1 -1
  41. package/dist/es/components/Card/components/CardInput/defaultProps.js.map +1 -1
  42. package/dist/es/components/Card/components/CardInput/handlers.js.map +1 -1
  43. package/dist/es/components/Card/components/CardInput/types.js.map +1 -1
  44. package/dist/es/components/Card/components/CardInput/utils.js +1 -1
  45. package/dist/es/components/Card/components/CardInput/utils.js.map +1 -1
  46. package/dist/es/components/CashAppPay/components/CashAppComponent.js.map +1 -1
  47. package/dist/es/components/CustomCard/CustomCard.js +1 -1
  48. package/dist/es/components/CustomCard/CustomCard.js.map +1 -1
  49. package/dist/es/components/CustomCard/CustomCardInput/CustomCardInput.js +1 -1
  50. package/dist/es/components/CustomCard/CustomCardInput/CustomCardInput.js.map +1 -1
  51. package/dist/es/components/Donation/components/CampaignContent.js +1 -1
  52. package/dist/es/components/Donation/components/CampaignContent.js.map +1 -1
  53. package/dist/es/components/Donation/components/DonationComponent.js +1 -1
  54. package/dist/es/components/Donation/components/DonationComponent.js.map +1 -1
  55. package/dist/es/components/Donation/components/FixedAmounts.js +2 -0
  56. package/dist/es/components/Donation/components/FixedAmounts.js.map +1 -0
  57. package/dist/es/components/Donation/components/Roundup.js +2 -0
  58. package/dist/es/components/Donation/components/Roundup.js.map +1 -0
  59. package/dist/es/components/Donation/components/utils.js +2 -0
  60. package/dist/es/components/Donation/components/utils.js.map +1 -0
  61. package/dist/es/components/Dropin/Dropin.js +1 -1
  62. package/dist/es/components/Dropin/Dropin.js.map +1 -1
  63. package/dist/es/components/Dropin/components/DropinComponent.js +1 -1
  64. package/dist/es/components/Dropin/components/DropinComponent.js.map +1 -1
  65. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js +1 -1
  66. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
  67. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodList.js +1 -1
  68. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
  69. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js +1 -1
  70. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js.map +1 -1
  71. package/dist/es/components/Dropin/elements/createElements.js +1 -1
  72. package/dist/es/components/Dropin/elements/createElements.js.map +1 -1
  73. package/dist/es/components/Dropin/elements/filters.js +1 -1
  74. package/dist/es/components/Dropin/elements/filters.js.map +1 -1
  75. package/dist/es/components/Giftcard/Giftcard.js +1 -1
  76. package/dist/es/components/Giftcard/Giftcard.js.map +1 -1
  77. package/dist/es/components/Giftcard/components/GiftcardComponent.js +1 -1
  78. package/dist/es/components/Giftcard/components/GiftcardComponent.js.map +1 -1
  79. package/dist/es/components/Giftcard/components/GiftcardNumberField.js +1 -1
  80. package/dist/es/components/Giftcard/components/GiftcardNumberField.js.map +1 -1
  81. package/dist/es/components/Giftcard/components/GiftcardPinField.js +1 -1
  82. package/dist/es/components/Giftcard/components/GiftcardPinField.js.map +1 -1
  83. package/dist/es/components/GooglePay/GooglePay.js +1 -1
  84. package/dist/es/components/GooglePay/GooglePay.js.map +1 -1
  85. package/dist/es/components/GooglePay/GooglePayService.js.map +1 -1
  86. package/dist/es/components/GooglePay/components/GooglePayButton.js +1 -1
  87. package/dist/es/components/GooglePay/components/GooglePayButton.js.map +1 -1
  88. package/dist/es/components/GooglePay/requests.js.map +1 -1
  89. package/dist/es/components/Klarna/KlarnaPayments.js +1 -1
  90. package/dist/es/components/Klarna/KlarnaPayments.js.map +1 -1
  91. package/dist/es/components/Klarna/components/KlarnaWidget/KlarnaWidget.js +1 -1
  92. package/dist/es/components/Klarna/components/KlarnaWidget/KlarnaWidget.js.map +1 -1
  93. package/dist/es/components/MealVoucherFR/components/MealVoucherExpiryField.js +1 -1
  94. package/dist/es/components/MealVoucherFR/components/MealVoucherExpiryField.js.map +1 -1
  95. package/dist/es/components/Oxxo/Oxxo.js.map +1 -1
  96. package/dist/es/components/PayPal/Paypal.js +1 -1
  97. package/dist/es/components/PayPal/Paypal.js.map +1 -1
  98. package/dist/es/components/Redirect/components/RedirectShopper/RedirectShopper.js +1 -1
  99. package/dist/es/components/Redirect/components/RedirectShopper/RedirectShopper.js.map +1 -1
  100. package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
  101. package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
  102. package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
  103. package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  104. package/dist/es/components/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
  105. package/dist/es/components/ThreeDS2/callSubmit3DS2Fingerprint.js.map +1 -1
  106. package/dist/es/components/ThreeDS2/components/Challenge/DoChallenge3DS2.js.map +1 -1
  107. package/dist/es/components/ThreeDS2/components/DeviceFingerprint/DoFingerprint3DS2.js.map +1 -1
  108. package/dist/es/components/ThreeDS2/components/utils.js +1 -1
  109. package/dist/es/components/ThreeDS2/components/utils.js.map +1 -1
  110. package/dist/es/components/UPI/UPI.js +1 -1
  111. package/dist/es/components/UPI/UPI.js.map +1 -1
  112. package/dist/es/components/UPI/components/UPIComponent/UPIComponent.js +1 -1
  113. package/dist/es/components/UPI/components/UPIComponent/UPIComponent.js.map +1 -1
  114. package/dist/es/components/UPI/components/UPIComponent/constants.js +2 -0
  115. package/dist/es/components/UPI/components/UPIComponent/constants.js.map +1 -0
  116. package/dist/es/components/UPI/components/UPIComponent/useUpiSegmentedControlOptions.js +2 -0
  117. package/dist/es/components/UPI/components/UPIComponent/useUpiSegmentedControlOptions.js.map +1 -0
  118. package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js +2 -0
  119. package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js.map +1 -0
  120. package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js +2 -0
  121. package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js.map +1 -0
  122. package/dist/es/components/UPI/components/VpaInput/VpaInput.js +1 -1
  123. package/dist/es/components/UPI/components/VpaInput/VpaInput.js.map +1 -1
  124. package/dist/es/components/components-name-map.js +1 -1
  125. package/dist/es/components/components-name-map.js.map +1 -1
  126. package/dist/es/components/internal/Address/components/AddressSearch.js +1 -1
  127. package/dist/es/components/internal/Address/components/AddressSearch.js.map +1 -1
  128. package/dist/es/components/internal/Address/components/ReadOnlyAddress.js +1 -1
  129. package/dist/es/components/internal/Address/components/ReadOnlyAddress.js.map +1 -1
  130. package/dist/es/components/internal/Await/Await.js +1 -1
  131. package/dist/es/components/internal/Await/Await.js.map +1 -1
  132. package/dist/es/components/internal/BaseElement/BaseElement.js +1 -1
  133. package/dist/es/components/internal/BaseElement/BaseElement.js.map +1 -1
  134. package/dist/es/components/internal/ClickToPay/ClickToPayComponent.js.map +1 -1
  135. package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPOneTimePasswordInput.js.map +1 -1
  136. package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js.map +1 -1
  137. package/dist/es/components/internal/ClickToPay/components/CtPSection/CtPLogoutLink.js.map +1 -1
  138. package/dist/es/components/internal/ClickToPay/errors/TimeoutError.js +1 -1
  139. package/dist/es/components/internal/ClickToPay/errors/TimeoutError.js.map +1 -1
  140. package/dist/es/components/internal/ClickToPay/services/ClickToPayService.js.map +1 -1
  141. package/dist/es/components/internal/ClickToPay/services/sdks/SrcSdkLoader.js.map +1 -1
  142. package/dist/es/components/internal/Countdown/index.js +1 -1
  143. package/dist/es/components/internal/Countdown/index.js.map +1 -1
  144. package/dist/es/components/internal/DisclaimerMessage/DisclaimerMessage.js +1 -1
  145. package/dist/es/components/internal/DisclaimerMessage/DisclaimerMessage.js.map +1 -1
  146. package/dist/es/components/internal/ExpandButton/ExpandButton.js +2 -0
  147. package/dist/es/components/internal/ExpandButton/ExpandButton.js.map +1 -0
  148. package/dist/es/components/internal/FormFields/ConsentCheckbox/ConsentCheckbox.js +1 -1
  149. package/dist/es/components/internal/FormFields/ConsentCheckbox/ConsentCheckbox.js.map +1 -1
  150. package/dist/es/components/internal/FormFields/Field/Field.js +1 -1
  151. package/dist/es/components/internal/FormFields/Field/Field.js.map +1 -1
  152. package/dist/es/components/internal/FormFields/InputBase.js.map +1 -1
  153. package/dist/es/components/internal/FormFields/RadioGroup/RadioGroup.js +1 -1
  154. package/dist/es/components/internal/FormFields/RadioGroup/RadioGroup.js.map +1 -1
  155. package/dist/es/components/internal/FormFields/Select/Select.js +1 -1
  156. package/dist/es/components/internal/FormFields/Select/Select.js.map +1 -1
  157. package/dist/es/components/internal/FormFields/Select/components/SelectButton.js +1 -1
  158. package/dist/es/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
  159. package/dist/es/components/internal/FormFields/Select/components/SelectList.js.map +1 -1
  160. package/dist/es/components/internal/FormFields/Select/components/SelectListItem.js.map +1 -1
  161. package/dist/es/components/internal/Modal/Modal.js.map +1 -1
  162. package/dist/es/components/internal/QRLoader/QRLoader.js +1 -1
  163. package/dist/es/components/internal/QRLoader/QRLoader.js.map +1 -1
  164. package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js +1 -1
  165. package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
  166. package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js +1 -1
  167. package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js.map +1 -1
  168. package/dist/es/components/internal/SecuredFields/SFP/defaultProps.js +1 -1
  169. package/dist/es/components/internal/SecuredFields/SFP/defaultProps.js.map +1 -1
  170. package/dist/es/components/internal/SecuredFields/binLookup/triggerBinLookUp.js.map +1 -1
  171. package/dist/es/components/internal/SecuredFields/lib/CSF/CSF.js +1 -1
  172. package/dist/es/components/internal/SecuredFields/lib/CSF/CSF.js.map +1 -1
  173. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/configureCallbacks.js +1 -1
  174. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/configureCallbacks.js.map +1 -1
  175. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js +1 -1
  176. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map +1 -1
  177. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.js +1 -1
  178. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.js.map +1 -1
  179. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleIOSTouchEvents.js +1 -1
  180. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleIOSTouchEvents.js.map +1 -1
  181. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleValidation.js +1 -1
  182. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleValidation.js.map +1 -1
  183. package/dist/es/components/internal/SecuredFields/lib/CSF/initCSF.js +1 -1
  184. package/dist/es/components/internal/SecuredFields/lib/CSF/initCSF.js.map +1 -1
  185. package/dist/es/components/internal/SecuredFields/lib/CSF/partials/processBrand.js +1 -1
  186. package/dist/es/components/internal/SecuredFields/lib/CSF/partials/processBrand.js.map +1 -1
  187. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/cardType.js.map +1 -1
  188. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/getCardGroupTypes.js +1 -1
  189. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/getCardGroupTypes.js.map +1 -1
  190. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/iframes/postMessageValidation.js +1 -1
  191. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/iframes/postMessageValidation.js.map +1 -1
  192. package/dist/es/components/internal/SecuredFields/lib/constants.js +1 -1
  193. package/dist/es/components/internal/SecuredFields/lib/constants.js.map +1 -1
  194. package/dist/es/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.js +1 -1
  195. package/dist/es/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.js.map +1 -1
  196. package/dist/es/components/internal/SecuredFields/lib/securedField/SecuredField.js +1 -1
  197. package/dist/es/components/internal/SecuredFields/lib/securedField/SecuredField.js.map +1 -1
  198. package/dist/es/components/internal/SecuredFields/lib/utilities/commonUtils.js +1 -1
  199. package/dist/es/components/internal/SecuredFields/lib/utilities/commonUtils.js.map +1 -1
  200. package/dist/es/components/internal/SecuredFields/lib/utilities/dom.js +1 -1
  201. package/dist/es/components/internal/SecuredFields/lib/utilities/dom.js.map +1 -1
  202. package/dist/es/components/internal/SecuredFields/lib/utilities/logger.js.map +1 -1
  203. package/dist/es/components/internal/SecuredFields/utils.js +1 -1
  204. package/dist/es/components/internal/SecuredFields/utils.js.map +1 -1
  205. package/dist/es/components/internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil.js +1 -1
  206. package/dist/es/components/internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil.js.map +1 -1
  207. package/dist/es/components/internal/UIElement/UIElement.js +1 -1
  208. package/dist/es/components/internal/UIElement/UIElement.js.map +1 -1
  209. package/dist/es/components/tx-variants.js +1 -1
  210. package/dist/es/components/tx-variants.js.map +1 -1
  211. package/dist/es/core/Analytics/Analytics.js +1 -1
  212. package/dist/es/core/Analytics/Analytics.js.map +1 -1
  213. package/dist/es/core/Analytics/analyticsPreProcessor.js +1 -1
  214. package/dist/es/core/Analytics/analyticsPreProcessor.js.map +1 -1
  215. package/dist/es/core/Analytics/utils.js +1 -1
  216. package/dist/es/core/Analytics/utils.js.map +1 -1
  217. package/dist/es/core/Environment/Environment.js +1 -1
  218. package/dist/es/core/Environment/Environment.js.map +1 -1
  219. package/dist/es/core/Environment/constants.js +1 -1
  220. package/dist/es/core/Environment/constants.js.map +1 -1
  221. package/dist/es/core/RiskModule/RiskModule.js +1 -1
  222. package/dist/es/core/RiskModule/RiskModule.js.map +1 -1
  223. package/dist/es/core/RiskModule/components/DeviceFingerprint/GetDeviceFingerprint.js.map +1 -1
  224. package/dist/es/core/Services/analytics/collect-id.js +1 -1
  225. package/dist/es/core/Services/analytics/collect-id.js.map +1 -1
  226. package/dist/es/core/Services/get-translations.js +1 -1
  227. package/dist/es/core/Services/get-translations.js.map +1 -1
  228. package/dist/es/core/Services/http.js.map +1 -1
  229. package/dist/es/core/config.js +1 -1
  230. package/dist/es/core/config.js.map +1 -1
  231. package/dist/es/core/core.js +1 -1
  232. package/dist/es/core/core.js.map +1 -1
  233. package/dist/es/core/utils.js +1 -1
  234. package/dist/es/core/utils.js.map +1 -1
  235. package/dist/es/external/preact/dist/preact.js +1 -1
  236. package/dist/es/external/preact/dist/preact.js.map +1 -1
  237. package/dist/es/external/preact/hooks/dist/hooks.js +1 -1
  238. package/dist/es/external/preact/hooks/dist/hooks.js.map +1 -1
  239. package/dist/es/index.d.ts +834 -847
  240. package/dist/es/language/constants.js +1 -1
  241. package/dist/es/language/constants.js.map +1 -1
  242. package/dist/es/utils/amount-util.js.map +1 -1
  243. package/dist/es/utils/browserInfo.js +1 -1
  244. package/dist/es/utils/browserInfo.js.map +1 -1
  245. package/dist/es/utils/commonUtils.js +2 -0
  246. package/dist/es/utils/commonUtils.js.map +1 -0
  247. package/dist/es/utils/listenerUtils.js +2 -0
  248. package/dist/es/utils/listenerUtils.js.map +1 -0
  249. package/dist/es/utils/regex.js.map +1 -1
  250. package/dist/es-legacy/adyen.css +15 -11
  251. package/dist/es-legacy/adyen.css.map +1 -1
  252. package/dist/es-legacy/components/ANCV/ANCV.js +1 -1
  253. package/dist/es-legacy/components/ANCV/ANCV.js.map +1 -1
  254. package/dist/es-legacy/components/Ach/Ach.js +1 -1
  255. package/dist/es-legacy/components/Ach/Ach.js.map +1 -1
  256. package/dist/es-legacy/components/Ach/components/AchInput/AchInput.js +1 -1
  257. package/dist/es-legacy/components/Ach/components/AchInput/AchInput.js.map +1 -1
  258. package/dist/es-legacy/components/Ach/components/AchInput/components/AchSFInput.js +1 -1
  259. package/dist/es-legacy/components/Ach/components/AchInput/components/AchSFInput.js.map +1 -1
  260. package/dist/es-legacy/components/Address/Address.js +1 -1
  261. package/dist/es-legacy/components/Address/Address.js.map +1 -1
  262. package/dist/es-legacy/components/Affirm/Affirm.js +1 -1
  263. package/dist/es-legacy/components/Affirm/Affirm.js.map +1 -1
  264. package/dist/es-legacy/components/AfterPay/AfterPay.js +1 -1
  265. package/dist/es-legacy/components/AfterPay/AfterPay.js.map +1 -1
  266. package/dist/es-legacy/components/AfterPay/AfterPayB2B.js +1 -1
  267. package/dist/es-legacy/components/AfterPay/AfterPayB2B.js.map +1 -1
  268. package/dist/es-legacy/components/AmazonPay/AmazonPay.js +1 -1
  269. package/dist/es-legacy/components/AmazonPay/AmazonPay.js.map +1 -1
  270. package/dist/es-legacy/components/AmazonPay/components/AmazonPayButton.js +1 -1
  271. package/dist/es-legacy/components/AmazonPay/components/AmazonPayButton.js.map +1 -1
  272. package/dist/es-legacy/components/AmazonPay/components/AmazonPayComponent.js +1 -1
  273. package/dist/es-legacy/components/AmazonPay/components/AmazonPayComponent.js.map +1 -1
  274. package/dist/es-legacy/components/AmazonPay/components/SignOutButton.js.map +1 -1
  275. package/dist/es-legacy/components/AmazonPay/utils.js +1 -1
  276. package/dist/es-legacy/components/AmazonPay/utils.js.map +1 -1
  277. package/dist/es-legacy/components/ApplePay/ApplePay.js +1 -1
  278. package/dist/es-legacy/components/ApplePay/ApplePay.js.map +1 -1
  279. package/dist/es-legacy/components/ApplePay/ApplePayService.js.map +1 -1
  280. package/dist/es-legacy/components/ApplePay/components/ApplePayButton.js.map +1 -1
  281. package/dist/es-legacy/components/Atome/Atome.js +1 -1
  282. package/dist/es-legacy/components/Atome/Atome.js.map +1 -1
  283. package/dist/es-legacy/components/Atome/config.js +1 -1
  284. package/dist/es-legacy/components/Atome/config.js.map +1 -1
  285. package/dist/es-legacy/components/BacsDD/BacsDD.js +1 -1
  286. package/dist/es-legacy/components/BacsDD/BacsDD.js.map +1 -1
  287. package/dist/es-legacy/components/BankTransfer/BankTransfer.js +1 -1
  288. package/dist/es-legacy/components/BankTransfer/BankTransfer.js.map +1 -1
  289. package/dist/es-legacy/components/BillDesk/BillDeskOnline.js +1 -1
  290. package/dist/es-legacy/components/BillDesk/BillDeskOnline.js.map +1 -1
  291. package/dist/es-legacy/components/BillDesk/BillDeskWallet.js +1 -1
  292. package/dist/es-legacy/components/BillDesk/BillDeskWallet.js.map +1 -1
  293. package/dist/es-legacy/components/Blik/Blik.js +1 -1
  294. package/dist/es-legacy/components/Blik/Blik.js.map +1 -1
  295. package/dist/es-legacy/components/Boleto/Boleto.js +1 -1
  296. package/dist/es-legacy/components/Boleto/Boleto.js.map +1 -1
  297. package/dist/es-legacy/components/Boleto/components/BoletoInput/BoletoInput.js +1 -1
  298. package/dist/es-legacy/components/Boleto/components/BoletoInput/BoletoInput.js.map +1 -1
  299. package/dist/es-legacy/components/Card/Bancontact.js +1 -1
  300. package/dist/es-legacy/components/Card/Bancontact.js.map +1 -1
  301. package/dist/es-legacy/components/Card/Card.js +1 -1
  302. package/dist/es-legacy/components/Card/Card.js.map +1 -1
  303. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js +1 -1
  304. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js.map +1 -1
  305. package/dist/es-legacy/components/Card/components/CardInput/components/CVC.js +1 -1
  306. package/dist/es-legacy/components/Card/components/CardInput/components/CVC.js.map +1 -1
  307. package/dist/es-legacy/components/Card/components/CardInput/components/CVCHint.js.map +1 -1
  308. package/dist/es-legacy/components/Card/components/CardInput/components/CardNumber.js +1 -1
  309. package/dist/es-legacy/components/Card/components/CardInput/components/CardNumber.js.map +1 -1
  310. package/dist/es-legacy/components/Card/components/CardInput/components/DualBrandingIcon/DualBrandingIcon.js.map +1 -1
  311. package/dist/es-legacy/components/Card/components/CardInput/components/ExpirationDate.js +1 -1
  312. package/dist/es-legacy/components/Card/components/CardInput/components/ExpirationDate.js.map +1 -1
  313. package/dist/es-legacy/components/Card/components/CardInput/components/FieldLabelAlternative.js +2 -0
  314. package/dist/es-legacy/components/Card/components/CardInput/components/FieldLabelAlternative.js.map +1 -0
  315. package/dist/es-legacy/components/Card/components/CardInput/components/Installments/Installments.js +1 -1
  316. package/dist/es-legacy/components/Card/components/CardInput/components/Installments/Installments.js.map +1 -1
  317. package/dist/es-legacy/components/Card/components/CardInput/components/KCPAuthentication.js +1 -1
  318. package/dist/es-legacy/components/Card/components/CardInput/components/KCPAuthentication.js.map +1 -1
  319. package/dist/es-legacy/components/Card/components/CardInput/components/StoredCardFields.js +1 -1
  320. package/dist/es-legacy/components/Card/components/CardInput/components/StoredCardFields.js.map +1 -1
  321. package/dist/es-legacy/components/Card/components/CardInput/defaultProps.js +1 -1
  322. package/dist/es-legacy/components/Card/components/CardInput/defaultProps.js.map +1 -1
  323. package/dist/es-legacy/components/Card/components/CardInput/handlers.js.map +1 -1
  324. package/dist/es-legacy/components/Card/components/CardInput/types.js.map +1 -1
  325. package/dist/es-legacy/components/Card/components/CardInput/utils.js +1 -1
  326. package/dist/es-legacy/components/Card/components/CardInput/utils.js.map +1 -1
  327. package/dist/es-legacy/components/CashAppPay/CashAppPay.js +1 -1
  328. package/dist/es-legacy/components/CashAppPay/CashAppPay.js.map +1 -1
  329. package/dist/es-legacy/components/CashAppPay/components/CashAppComponent.js.map +1 -1
  330. package/dist/es-legacy/components/ClickToPay/ClickToPay.js +1 -1
  331. package/dist/es-legacy/components/ClickToPay/ClickToPay.js.map +1 -1
  332. package/dist/es-legacy/components/CustomCard/CustomCard.js +1 -1
  333. package/dist/es-legacy/components/CustomCard/CustomCard.js.map +1 -1
  334. package/dist/es-legacy/components/CustomCard/CustomCardInput/CustomCardInput.js +1 -1
  335. package/dist/es-legacy/components/CustomCard/CustomCardInput/CustomCardInput.js.map +1 -1
  336. package/dist/es-legacy/components/Doku/Doku.js +1 -1
  337. package/dist/es-legacy/components/Doku/Doku.js.map +1 -1
  338. package/dist/es-legacy/components/Donation/Donation.js +1 -1
  339. package/dist/es-legacy/components/Donation/Donation.js.map +1 -1
  340. package/dist/es-legacy/components/Donation/components/CampaignContent.js +1 -1
  341. package/dist/es-legacy/components/Donation/components/CampaignContent.js.map +1 -1
  342. package/dist/es-legacy/components/Donation/components/DonationComponent.js +1 -1
  343. package/dist/es-legacy/components/Donation/components/DonationComponent.js.map +1 -1
  344. package/dist/es-legacy/components/Donation/components/FixedAmounts.js +2 -0
  345. package/dist/es-legacy/components/Donation/components/FixedAmounts.js.map +1 -0
  346. package/dist/es-legacy/components/Donation/components/Roundup.js +2 -0
  347. package/dist/es-legacy/components/Donation/components/Roundup.js.map +1 -0
  348. package/dist/es-legacy/components/Donation/components/utils.js +2 -0
  349. package/dist/es-legacy/components/Donation/components/utils.js.map +1 -0
  350. package/dist/es-legacy/components/Dragonpay/Dragonpay.js +1 -1
  351. package/dist/es-legacy/components/Dragonpay/Dragonpay.js.map +1 -1
  352. package/dist/es-legacy/components/Dragonpay/components/DragonpayInput/DragonpayInput.js +1 -1
  353. package/dist/es-legacy/components/Dragonpay/components/DragonpayInput/DragonpayInput.js.map +1 -1
  354. package/dist/es-legacy/components/Dropin/Dropin.js +1 -1
  355. package/dist/es-legacy/components/Dropin/Dropin.js.map +1 -1
  356. package/dist/es-legacy/components/Dropin/components/DropinComponent.js +1 -1
  357. package/dist/es-legacy/components/Dropin/components/DropinComponent.js.map +1 -1
  358. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js +1 -1
  359. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
  360. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js +1 -1
  361. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
  362. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js +1 -1
  363. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js.map +1 -1
  364. package/dist/es-legacy/components/Dropin/elements/createElements.js +1 -1
  365. package/dist/es-legacy/components/Dropin/elements/createElements.js.map +1 -1
  366. package/dist/es-legacy/components/Dropin/elements/createInstantPaymentElements.js +1 -1
  367. package/dist/es-legacy/components/Dropin/elements/createInstantPaymentElements.js.map +1 -1
  368. package/dist/es-legacy/components/Dropin/elements/createStoredElements.js +1 -1
  369. package/dist/es-legacy/components/Dropin/elements/createStoredElements.js.map +1 -1
  370. package/dist/es-legacy/components/Dropin/elements/filters.js +1 -1
  371. package/dist/es-legacy/components/Dropin/elements/filters.js.map +1 -1
  372. package/dist/es-legacy/components/EPS/index.js +1 -1
  373. package/dist/es-legacy/components/EPS/index.js.map +1 -1
  374. package/dist/es-legacy/components/Econtext/Econtext.js +1 -1
  375. package/dist/es-legacy/components/Econtext/Econtext.js.map +1 -1
  376. package/dist/es-legacy/components/FacilyPay/FacilyPay10x.js +1 -1
  377. package/dist/es-legacy/components/FacilyPay/FacilyPay10x.js.map +1 -1
  378. package/dist/es-legacy/components/FacilyPay/FacilyPay12x.js +1 -1
  379. package/dist/es-legacy/components/FacilyPay/FacilyPay12x.js.map +1 -1
  380. package/dist/es-legacy/components/FacilyPay/FacilyPay3x.js +1 -1
  381. package/dist/es-legacy/components/FacilyPay/FacilyPay3x.js.map +1 -1
  382. package/dist/es-legacy/components/FacilyPay/FacilyPay4x.js +1 -1
  383. package/dist/es-legacy/components/FacilyPay/FacilyPay4x.js.map +1 -1
  384. package/dist/es-legacy/components/FacilyPay/FacilyPay6x.js +1 -1
  385. package/dist/es-legacy/components/FacilyPay/FacilyPay6x.js.map +1 -1
  386. package/dist/es-legacy/components/Giftcard/Giftcard.js +1 -1
  387. package/dist/es-legacy/components/Giftcard/Giftcard.js.map +1 -1
  388. package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js +1 -1
  389. package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js.map +1 -1
  390. package/dist/es-legacy/components/Giftcard/components/GiftcardFields.js +1 -1
  391. package/dist/es-legacy/components/Giftcard/components/GiftcardFields.js.map +1 -1
  392. package/dist/es-legacy/components/Giftcard/components/GiftcardNumberField.js +1 -1
  393. package/dist/es-legacy/components/Giftcard/components/GiftcardNumberField.js.map +1 -1
  394. package/dist/es-legacy/components/Giftcard/components/GiftcardPinField.js +1 -1
  395. package/dist/es-legacy/components/Giftcard/components/GiftcardPinField.js.map +1 -1
  396. package/dist/es-legacy/components/Giropay/Giropay.js +1 -1
  397. package/dist/es-legacy/components/Giropay/Giropay.js.map +1 -1
  398. package/dist/es-legacy/components/GooglePay/GooglePay.js +1 -1
  399. package/dist/es-legacy/components/GooglePay/GooglePay.js.map +1 -1
  400. package/dist/es-legacy/components/GooglePay/GooglePayService.js.map +1 -1
  401. package/dist/es-legacy/components/GooglePay/components/GooglePayButton.js +1 -1
  402. package/dist/es-legacy/components/GooglePay/components/GooglePayButton.js.map +1 -1
  403. package/dist/es-legacy/components/GooglePay/requests.js.map +1 -1
  404. package/dist/es-legacy/components/Klarna/KlarnaPayments.js +1 -1
  405. package/dist/es-legacy/components/Klarna/KlarnaPayments.js.map +1 -1
  406. package/dist/es-legacy/components/Klarna/components/KlarnaContainer/KlarnaContainer.js +1 -1
  407. package/dist/es-legacy/components/Klarna/components/KlarnaContainer/KlarnaContainer.js.map +1 -1
  408. package/dist/es-legacy/components/Klarna/components/KlarnaWidget/KlarnaWidget.js +1 -1
  409. package/dist/es-legacy/components/Klarna/components/KlarnaWidget/KlarnaWidget.js.map +1 -1
  410. package/dist/es-legacy/components/MBWay/MBWay.js +1 -1
  411. package/dist/es-legacy/components/MBWay/MBWay.js.map +1 -1
  412. package/dist/es-legacy/components/MBWay/components/MBWayInput/MBWayInput.js +1 -1
  413. package/dist/es-legacy/components/MBWay/components/MBWayInput/MBWayInput.js.map +1 -1
  414. package/dist/es-legacy/components/MealVoucherFR/MealVoucherFR.js +1 -1
  415. package/dist/es-legacy/components/MealVoucherFR/MealVoucherFR.js.map +1 -1
  416. package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherExpiryField.js +1 -1
  417. package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherExpiryField.js.map +1 -1
  418. package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherFields.js +1 -1
  419. package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherFields.js.map +1 -1
  420. package/dist/es-legacy/components/Multibanco/Multibanco.js +1 -1
  421. package/dist/es-legacy/components/Multibanco/Multibanco.js.map +1 -1
  422. package/dist/es-legacy/components/OnlineBankingCZ/index.js +1 -1
  423. package/dist/es-legacy/components/OnlineBankingCZ/index.js.map +1 -1
  424. package/dist/es-legacy/components/OnlineBankingIN/index.js +1 -1
  425. package/dist/es-legacy/components/OnlineBankingIN/index.js.map +1 -1
  426. package/dist/es-legacy/components/OnlineBankingPL/OnlineBankingPL.js +1 -1
  427. package/dist/es-legacy/components/OnlineBankingPL/OnlineBankingPL.js.map +1 -1
  428. package/dist/es-legacy/components/OnlineBankingSK/index.js +1 -1
  429. package/dist/es-legacy/components/OnlineBankingSK/index.js.map +1 -1
  430. package/dist/es-legacy/components/Oxxo/Oxxo.js +1 -1
  431. package/dist/es-legacy/components/Oxxo/Oxxo.js.map +1 -1
  432. package/dist/es-legacy/components/PayByBank/PayByBank.js +1 -1
  433. package/dist/es-legacy/components/PayByBank/PayByBank.js.map +1 -1
  434. package/dist/es-legacy/components/PayPal/Paypal.js +1 -1
  435. package/dist/es-legacy/components/PayPal/Paypal.js.map +1 -1
  436. package/dist/es-legacy/components/PayPal/components/PaypalButtons.js +1 -1
  437. package/dist/es-legacy/components/PayPal/components/PaypalButtons.js.map +1 -1
  438. package/dist/es-legacy/components/PayPal/components/PaypalComponent.js +1 -1
  439. package/dist/es-legacy/components/PayPal/components/PaypalComponent.js.map +1 -1
  440. package/dist/es-legacy/components/PayPal/utils/get-paypal-settings.js +1 -1
  441. package/dist/es-legacy/components/PayPal/utils/get-paypal-settings.js.map +1 -1
  442. package/dist/es-legacy/components/PayU/PayuCashcard.js +1 -1
  443. package/dist/es-legacy/components/PayU/PayuCashcard.js.map +1 -1
  444. package/dist/es-legacy/components/PayU/PayuNetBanking.js +1 -1
  445. package/dist/es-legacy/components/PayU/PayuNetBanking.js.map +1 -1
  446. package/dist/es-legacy/components/PersonalDetails/PersonalDetails.js +1 -1
  447. package/dist/es-legacy/components/PersonalDetails/PersonalDetails.js.map +1 -1
  448. package/dist/es-legacy/components/Pix/Pix.js +1 -1
  449. package/dist/es-legacy/components/Pix/Pix.js.map +1 -1
  450. package/dist/es-legacy/components/RatePay/RatePay.js +1 -1
  451. package/dist/es-legacy/components/RatePay/RatePay.js.map +1 -1
  452. package/dist/es-legacy/components/RatePay/RatePayDirectDebit.js +1 -1
  453. package/dist/es-legacy/components/RatePay/RatePayDirectDebit.js.map +1 -1
  454. package/dist/es-legacy/components/Redirect/Redirect.js +1 -1
  455. package/dist/es-legacy/components/Redirect/Redirect.js.map +1 -1
  456. package/dist/es-legacy/components/Redirect/components/RedirectShopper/RedirectShopper.js +1 -1
  457. package/dist/es-legacy/components/Redirect/components/RedirectShopper/RedirectShopper.js.map +1 -1
  458. package/dist/es-legacy/components/Riverty/Riverty.js +1 -1
  459. package/dist/es-legacy/components/Riverty/Riverty.js.map +1 -1
  460. package/dist/es-legacy/components/Sepa/Sepa.js +1 -1
  461. package/dist/es-legacy/components/Sepa/Sepa.js.map +1 -1
  462. package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
  463. package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
  464. package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
  465. package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  466. package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
  467. package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js.map +1 -1
  468. package/dist/es-legacy/components/ThreeDS2/components/Challenge/DoChallenge3DS2.js.map +1 -1
  469. package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
  470. package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
  471. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/DoFingerprint3DS2.js.map +1 -1
  472. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js +1 -1
  473. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
  474. package/dist/es-legacy/components/ThreeDS2/components/utils.js +1 -1
  475. package/dist/es-legacy/components/ThreeDS2/components/utils.js.map +1 -1
  476. package/dist/es-legacy/components/Trustly/Trustly.js +1 -1
  477. package/dist/es-legacy/components/Trustly/Trustly.js.map +1 -1
  478. package/dist/es-legacy/components/Twint/Twint.js +1 -1
  479. package/dist/es-legacy/components/Twint/Twint.js.map +1 -1
  480. package/dist/es-legacy/components/UPI/UPI.js +1 -1
  481. package/dist/es-legacy/components/UPI/UPI.js.map +1 -1
  482. package/dist/es-legacy/components/UPI/components/UPIComponent/UPIComponent.js +1 -1
  483. package/dist/es-legacy/components/UPI/components/UPIComponent/UPIComponent.js.map +1 -1
  484. package/dist/es-legacy/components/UPI/components/UPIComponent/constants.js +2 -0
  485. package/dist/es-legacy/components/UPI/components/UPIComponent/constants.js.map +1 -0
  486. package/dist/es-legacy/components/UPI/components/UPIComponent/useUpiSegmentedControlOptions.js +2 -0
  487. package/dist/es-legacy/components/UPI/components/UPIComponent/useUpiSegmentedControlOptions.js.map +1 -0
  488. package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js +2 -0
  489. package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js.map +1 -0
  490. package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js +2 -0
  491. package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js.map +1 -0
  492. package/dist/es-legacy/components/UPI/components/VpaInput/VpaInput.js +1 -1
  493. package/dist/es-legacy/components/UPI/components/VpaInput/VpaInput.js.map +1 -1
  494. package/dist/es-legacy/components/WalletIN/index.js +1 -1
  495. package/dist/es-legacy/components/WalletIN/index.js.map +1 -1
  496. package/dist/es-legacy/components/components-name-map.js +1 -1
  497. package/dist/es-legacy/components/components-name-map.js.map +1 -1
  498. package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js +1 -1
  499. package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
  500. package/dist/es-legacy/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.js +1 -1
  501. package/dist/es-legacy/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.js.map +1 -1
  502. package/dist/es-legacy/components/helpers/QRLoaderContainer/QRLoaderContainer.js +1 -1
  503. package/dist/es-legacy/components/helpers/QRLoaderContainer/QRLoaderContainer.js.map +1 -1
  504. package/dist/es-legacy/components/internal/Address/Address.js +1 -1
  505. package/dist/es-legacy/components/internal/Address/Address.js.map +1 -1
  506. package/dist/es-legacy/components/internal/Address/components/AddressSearch.js +1 -1
  507. package/dist/es-legacy/components/internal/Address/components/AddressSearch.js.map +1 -1
  508. package/dist/es-legacy/components/internal/Address/components/CountryField.js +1 -1
  509. package/dist/es-legacy/components/internal/Address/components/CountryField.js.map +1 -1
  510. package/dist/es-legacy/components/internal/Address/components/ReadOnlyAddress.js +1 -1
  511. package/dist/es-legacy/components/internal/Address/components/ReadOnlyAddress.js.map +1 -1
  512. package/dist/es-legacy/components/internal/Await/Await.js +1 -1
  513. package/dist/es-legacy/components/internal/Await/Await.js.map +1 -1
  514. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js +1 -1
  515. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js.map +1 -1
  516. package/dist/es-legacy/components/internal/ClickToPay/ClickToPayComponent.js.map +1 -1
  517. package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPOneTimePasswordInput.js.map +1 -1
  518. package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js.map +1 -1
  519. package/dist/es-legacy/components/internal/ClickToPay/components/CtPSection/CtPLogoutLink.js.map +1 -1
  520. package/dist/es-legacy/components/internal/ClickToPay/errors/TimeoutError.js +1 -1
  521. package/dist/es-legacy/components/internal/ClickToPay/errors/TimeoutError.js.map +1 -1
  522. package/dist/es-legacy/components/internal/ClickToPay/services/ClickToPayService.js +1 -1
  523. package/dist/es-legacy/components/internal/ClickToPay/services/ClickToPayService.js.map +1 -1
  524. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/MastercardSdk.js +1 -1
  525. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/MastercardSdk.js.map +1 -1
  526. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/SrcSdkLoader.js.map +1 -1
  527. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/VisaSdk.js +1 -1
  528. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/VisaSdk.js.map +1 -1
  529. package/dist/es-legacy/components/internal/CompanyDetails/CompanyDetails.js +1 -1
  530. package/dist/es-legacy/components/internal/CompanyDetails/CompanyDetails.js.map +1 -1
  531. package/dist/es-legacy/components/internal/Countdown/index.js +1 -1
  532. package/dist/es-legacy/components/internal/Countdown/index.js.map +1 -1
  533. package/dist/es-legacy/components/internal/DisclaimerMessage/DisclaimerMessage.js +1 -1
  534. package/dist/es-legacy/components/internal/DisclaimerMessage/DisclaimerMessage.js.map +1 -1
  535. package/dist/es-legacy/components/internal/ExpandButton/ExpandButton.js +2 -0
  536. package/dist/es-legacy/components/internal/ExpandButton/ExpandButton.js.map +1 -0
  537. package/dist/es-legacy/components/internal/FormFields/Checkbox/Checkbox.js +1 -1
  538. package/dist/es-legacy/components/internal/FormFields/Checkbox/Checkbox.js.map +1 -1
  539. package/dist/es-legacy/components/internal/FormFields/ConsentCheckbox/ConsentCheckbox.js +1 -1
  540. package/dist/es-legacy/components/internal/FormFields/ConsentCheckbox/ConsentCheckbox.js.map +1 -1
  541. package/dist/es-legacy/components/internal/FormFields/Field/Field.js +1 -1
  542. package/dist/es-legacy/components/internal/FormFields/Field/Field.js.map +1 -1
  543. package/dist/es-legacy/components/internal/FormFields/InputBase.js +1 -1
  544. package/dist/es-legacy/components/internal/FormFields/InputBase.js.map +1 -1
  545. package/dist/es-legacy/components/internal/FormFields/InputDate/InputDate.js +1 -1
  546. package/dist/es-legacy/components/internal/FormFields/InputDate/InputDate.js.map +1 -1
  547. package/dist/es-legacy/components/internal/FormFields/InputEmail.js +1 -1
  548. package/dist/es-legacy/components/internal/FormFields/InputEmail.js.map +1 -1
  549. package/dist/es-legacy/components/internal/FormFields/InputTelephone.js +1 -1
  550. package/dist/es-legacy/components/internal/FormFields/InputTelephone.js.map +1 -1
  551. package/dist/es-legacy/components/internal/FormFields/InputText.js +1 -1
  552. package/dist/es-legacy/components/internal/FormFields/InputText.js.map +1 -1
  553. package/dist/es-legacy/components/internal/FormFields/RadioGroup/RadioGroup.js +1 -1
  554. package/dist/es-legacy/components/internal/FormFields/RadioGroup/RadioGroup.js.map +1 -1
  555. package/dist/es-legacy/components/internal/FormFields/Select/Select.js +1 -1
  556. package/dist/es-legacy/components/internal/FormFields/Select/Select.js.map +1 -1
  557. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js +1 -1
  558. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
  559. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectList.js.map +1 -1
  560. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectListItem.js.map +1 -1
  561. package/dist/es-legacy/components/internal/IbanInput/IbanInput.js +1 -1
  562. package/dist/es-legacy/components/internal/IbanInput/IbanInput.js.map +1 -1
  563. package/dist/es-legacy/components/internal/Img/Img.js +1 -1
  564. package/dist/es-legacy/components/internal/Img/Img.js.map +1 -1
  565. package/dist/es-legacy/components/internal/IssuerList/IssuerButtonGroup/IssuerButtonGroup.js +1 -1
  566. package/dist/es-legacy/components/internal/IssuerList/IssuerButtonGroup/IssuerButtonGroup.js.map +1 -1
  567. package/dist/es-legacy/components/internal/Modal/Modal.js.map +1 -1
  568. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js +1 -1
  569. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
  570. package/dist/es-legacy/components/internal/PayButton/PayButton.js +1 -1
  571. package/dist/es-legacy/components/internal/PayButton/PayButton.js.map +1 -1
  572. package/dist/es-legacy/components/internal/PersonalDetails/PersonalDetails.js +1 -1
  573. package/dist/es-legacy/components/internal/PersonalDetails/PersonalDetails.js.map +1 -1
  574. package/dist/es-legacy/components/internal/PhoneInput/PhoneInput.js +1 -1
  575. package/dist/es-legacy/components/internal/PhoneInput/PhoneInput.js.map +1 -1
  576. package/dist/es-legacy/components/internal/QRLoader/QRLoader.js +1 -1
  577. package/dist/es-legacy/components/internal/QRLoader/QRLoader.js.map +1 -1
  578. package/dist/es-legacy/components/internal/RedirectButton/RedirectButton.js +1 -1
  579. package/dist/es-legacy/components/internal/RedirectButton/RedirectButton.js.map +1 -1
  580. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js +1 -1
  581. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
  582. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js +1 -1
  583. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js.map +1 -1
  584. package/dist/es-legacy/components/internal/SecuredFields/SFP/defaultProps.js +1 -1
  585. package/dist/es-legacy/components/internal/SecuredFields/SFP/defaultProps.js.map +1 -1
  586. package/dist/es-legacy/components/internal/SecuredFields/binLookup/triggerBinLookUp.js.map +1 -1
  587. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/CSF.js +1 -1
  588. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/CSF.js.map +1 -1
  589. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/configureCallbacks.js +1 -1
  590. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/configureCallbacks.js.map +1 -1
  591. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js +1 -1
  592. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map +1 -1
  593. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleBrandFromBinLookup.js +1 -1
  594. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleBrandFromBinLookup.js.map +1 -1
  595. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.js +1 -1
  596. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.js.map +1 -1
  597. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleIOSTouchEvents.js +1 -1
  598. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleIOSTouchEvents.js.map +1 -1
  599. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleValidation.js +1 -1
  600. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleValidation.js.map +1 -1
  601. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/initCSF.js +1 -1
  602. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/initCSF.js.map +1 -1
  603. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/partials/processBrand.js +1 -1
  604. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/partials/processBrand.js.map +1 -1
  605. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/cardType.js.map +1 -1
  606. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/getCardGroupTypes.js +1 -1
  607. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/getCardGroupTypes.js.map +1 -1
  608. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/iframes/postMessageValidation.js +1 -1
  609. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/iframes/postMessageValidation.js.map +1 -1
  610. package/dist/es-legacy/components/internal/SecuredFields/lib/constants.js +1 -1
  611. package/dist/es-legacy/components/internal/SecuredFields/lib/constants.js.map +1 -1
  612. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.js +1 -1
  613. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.js.map +1 -1
  614. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/SecuredField.js +1 -1
  615. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/SecuredField.js.map +1 -1
  616. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/processAriaConfig.js +1 -1
  617. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/processAriaConfig.js.map +1 -1
  618. package/dist/es-legacy/components/internal/SecuredFields/lib/utilities/commonUtils.js +1 -1
  619. package/dist/es-legacy/components/internal/SecuredFields/lib/utilities/commonUtils.js.map +1 -1
  620. package/dist/es-legacy/components/internal/SecuredFields/lib/utilities/dom.js +1 -1
  621. package/dist/es-legacy/components/internal/SecuredFields/lib/utilities/dom.js.map +1 -1
  622. package/dist/es-legacy/components/internal/SecuredFields/lib/utilities/logger.js.map +1 -1
  623. package/dist/es-legacy/components/internal/SecuredFields/utils.js +1 -1
  624. package/dist/es-legacy/components/internal/SecuredFields/utils.js.map +1 -1
  625. package/dist/es-legacy/components/internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil.js +1 -1
  626. package/dist/es-legacy/components/internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil.js.map +1 -1
  627. package/dist/es-legacy/components/internal/UIElement/UIElement.js +1 -1
  628. package/dist/es-legacy/components/internal/UIElement/UIElement.js.map +1 -1
  629. package/dist/es-legacy/components/tx-variants.js +1 -1
  630. package/dist/es-legacy/components/tx-variants.js.map +1 -1
  631. package/dist/es-legacy/core/Analytics/Analytics.js +1 -1
  632. package/dist/es-legacy/core/Analytics/Analytics.js.map +1 -1
  633. package/dist/es-legacy/core/Analytics/analyticsPreProcessor.js +1 -1
  634. package/dist/es-legacy/core/Analytics/analyticsPreProcessor.js.map +1 -1
  635. package/dist/es-legacy/core/Analytics/utils.js +1 -1
  636. package/dist/es-legacy/core/Analytics/utils.js.map +1 -1
  637. package/dist/es-legacy/core/Context/Resources.js +1 -1
  638. package/dist/es-legacy/core/Context/Resources.js.map +1 -1
  639. package/dist/es-legacy/core/Environment/Environment.js +1 -1
  640. package/dist/es-legacy/core/Environment/Environment.js.map +1 -1
  641. package/dist/es-legacy/core/Environment/constants.js +1 -1
  642. package/dist/es-legacy/core/Environment/constants.js.map +1 -1
  643. package/dist/es-legacy/core/Errors/SRPanel.js +1 -1
  644. package/dist/es-legacy/core/Errors/SRPanel.js.map +1 -1
  645. package/dist/es-legacy/core/ProcessResponse/PaymentAction/actionTypes.js +1 -1
  646. package/dist/es-legacy/core/ProcessResponse/PaymentAction/actionTypes.js.map +1 -1
  647. package/dist/es-legacy/core/ProcessResponse/PaymentMethods/utils.js +1 -1
  648. package/dist/es-legacy/core/ProcessResponse/PaymentMethods/utils.js.map +1 -1
  649. package/dist/es-legacy/core/ProcessResponse/process-response.js +1 -1
  650. package/dist/es-legacy/core/ProcessResponse/process-response.js.map +1 -1
  651. package/dist/es-legacy/core/RiskModule/RiskModule.js +1 -1
  652. package/dist/es-legacy/core/RiskModule/RiskModule.js.map +1 -1
  653. package/dist/es-legacy/core/RiskModule/components/DeviceFingerprint/GetDeviceFingerprint.js.map +1 -1
  654. package/dist/es-legacy/core/Services/analytics/collect-id.js +1 -1
  655. package/dist/es-legacy/core/Services/analytics/collect-id.js.map +1 -1
  656. package/dist/es-legacy/core/Services/get-translations.js +1 -1
  657. package/dist/es-legacy/core/Services/get-translations.js.map +1 -1
  658. package/dist/es-legacy/core/Services/http.js +1 -1
  659. package/dist/es-legacy/core/Services/http.js.map +1 -1
  660. package/dist/es-legacy/core/config.js +1 -1
  661. package/dist/es-legacy/core/config.js.map +1 -1
  662. package/dist/es-legacy/core/core.js +1 -1
  663. package/dist/es-legacy/core/core.js.map +1 -1
  664. package/dist/es-legacy/core/core.registry.js +1 -1
  665. package/dist/es-legacy/core/core.registry.js.map +1 -1
  666. package/dist/es-legacy/core/utils.js +1 -1
  667. package/dist/es-legacy/core/utils.js.map +1 -1
  668. package/dist/es-legacy/external/preact/dist/preact.js +1 -1
  669. package/dist/es-legacy/external/preact/dist/preact.js.map +1 -1
  670. package/dist/es-legacy/external/preact/hooks/dist/hooks.js +1 -1
  671. package/dist/es-legacy/external/preact/hooks/dist/hooks.js.map +1 -1
  672. package/dist/es-legacy/language/constants.js +1 -1
  673. package/dist/es-legacy/language/constants.js.map +1 -1
  674. package/dist/es-legacy/utils/amount-util.js.map +1 -1
  675. package/dist/es-legacy/utils/browserInfo.js +1 -1
  676. package/dist/es-legacy/utils/browserInfo.js.map +1 -1
  677. package/dist/es-legacy/utils/commonUtils.js +2 -0
  678. package/dist/es-legacy/utils/commonUtils.js.map +1 -0
  679. package/dist/es-legacy/utils/listenerUtils.js +2 -0
  680. package/dist/es-legacy/utils/listenerUtils.js.map +1 -0
  681. package/dist/es-legacy/utils/regex.js.map +1 -1
  682. package/dist/es-legacy/utils/useForm/reducer.js +1 -1
  683. package/dist/es-legacy/utils/useForm/reducer.js.map +1 -1
  684. package/package.json +22 -18
  685. package/dist/es/components/Card/components/CardInput/components/IframeLabelAlternative.js.map +0 -1
  686. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/ExpandButton.js +0 -2
  687. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/ExpandButton.js.map +0 -1
  688. package/dist/es-legacy/components/Card/components/CardInput/components/IframeLabelAlternative.js +0 -2
  689. package/dist/es-legacy/components/Card/components/CardInput/components/IframeLabelAlternative.js.map +0 -1
  690. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/ExpandButton.js +0 -2
  691. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/ExpandButton.js.map +0 -1
@@ -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/ANCVInput.js";import{CoreProvider as s}from"../../core/Context/CoreProvider.js";import o from"./components/ANCVAwait/config.js";import i from"../internal/Await/Await.js";import n from"../../core/Errors/SRPanelProvider.js";import a from"../../core/Errors/AdyenCheckoutError.js";import p from"../internal/PayButton/PayButton.js";import{sanitizeResponse as h,verifyPaymentDidNotFail as m}from"../internal/UIElement/utils.js";class d extends e{static type="ancv";formatData(){return{paymentMethod:{type:d.type,beneficiaryId:this.state.data?.beneficiaryId}}}onOrderRequest=t=>this.props.onOrderRequest?new Promise(((e,r)=>{this.props.onOrderRequest(e,r,t)})):this.props.session?this.props.session.createOrder():void 0;createOrder=()=>(this.setStatus("loading"),this.props.order?Promise.resolve():this.onOrderRequest(this.data).then((t=>{const e={orderData:t.orderData,pspReference:t.pspReference};return this.setState(e),Promise.resolve()})).catch((t=>{this.setStatus(t?.message||"error"),this.props.onError&&this.handleError(new a("ERROR",t))})));submit(){if(!this.isValid)return this.showValidation(),!1;this.createOrder().then(this.makePaymentsCall).then(h).then(m).then(this.handleResponse).catch(this.handleFailedResult)}payButton=e=>t(p,e);get isValid(){return!!this.state.isValid}get displayName(){return this.props.name}render(){return this.props.paymentData?t(s,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(n,{srPanel:this.props.modules.srPanel},t(i,{ref:t=>{this.componentRef=t},clientKey:this.props.clientKey,paymentData:this.props.paymentData,onError:this.props.onError,onComplete:this.onComplete,brandLogo:this.icon,type:this.constructor.type,messageText:this.props.i18n.get("ancv.confirmPayment"),awaitText:this.props.i18n.get("await.waitForConfirmation"),showCountdownTimer:o.showCountdownTimer,throttleTime:o.THROTTLE_TIME,throttleInterval:o.THROTTLE_INTERVAL,onActionHandled:this.props.onActionHandled}))):t(s,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(r,{ref:t=>{this.componentRef=t},...this.props,onSubmit:this.submit,onChange:this.setState,payButton:this.payButton,showPayButton:this.props.showPayButton}))}}export{d as ANCVElement,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/ANCVInput.js";import{CoreProvider as s}from"../../core/Context/CoreProvider.js";import o from"./components/ANCVAwait/config.js";import i from"../internal/Await/Await.js";import n from"../../core/Errors/SRPanelProvider.js";import a from"../../core/Errors/AdyenCheckoutError.js";import p from"../internal/PayButton/PayButton.js";import{sanitizeResponse as h,verifyPaymentDidNotFail as m}from"../internal/UIElement/utils.js";class d extends e{static type="ancv";formatData(){return{paymentMethod:{type:d.type,beneficiaryId:this.state.data?.beneficiaryId}}}onOrderRequest=t=>this.props.onOrderRequest?new Promise(((e,r)=>{this.props.onOrderRequest(e,r,t)})):this.props.session?this.props.session.createOrder():void 0;createOrder=()=>(this.setStatus("loading"),this.props.order?Promise.resolve():this.onOrderRequest(this.data).then((t=>{const e={order:{orderData:t.orderData,pspReference:t.pspReference}};return this.setState(e),Promise.resolve()})).catch((t=>{this.setStatus(t?.message||"error"),this.props.onError&&this.handleError(new a("ERROR",t))})));submit(){if(!this.isValid)return this.showValidation(),!1;this.createOrder().then(this.makePaymentsCall).then(h).then(m).then(this.handleResponse).catch(this.handleFailedResult)}payButton=e=>t(p,e);get isValid(){return!!this.state.isValid}get displayName(){return this.props.name}render(){return this.props.paymentData?t(s,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(n,{srPanel:this.props.modules.srPanel},t(i,{ref:t=>{this.componentRef=t},clientKey:this.props.clientKey,paymentData:this.props.paymentData,onError:this.props.onError,onComplete:this.onComplete,brandLogo:this.icon,type:this.constructor.type,messageText:this.props.i18n.get("ancv.confirmPayment"),awaitText:this.props.i18n.get("await.waitForConfirmation"),showCountdownTimer:o.showCountdownTimer,throttleTime:o.THROTTLE_TIME,throttleInterval:o.THROTTLE_INTERVAL,onActionHandled:this.props.onActionHandled}))):t(s,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(r,{ref:t=>{this.componentRef=t},...this.props,onSubmit:this.submit,onChange:this.setState,payButton:this.payButton,showPayButton:this.props.showPayButton}))}}export{d as ANCVElement,d as default};
2
2
  //# sourceMappingURL=ANCV.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ANCV.js","sources":["../../../../src/components/ANCV/ANCV.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport ANCVInput from './components/ANCVInput';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport config from './components/ANCVAwait/config';\nimport Await from '../../components/internal/Await';\nimport SRPanelProvider from '../../core/Errors/SRPanelProvider';\nimport AdyenCheckoutError from '../../core/Errors/AdyenCheckoutError';\nimport PayButton from '../internal/PayButton';\nimport { ANCVConfiguration } from './types';\nimport { sanitizeResponse, verifyPaymentDidNotFail } from '../internal/UIElement/utils';\n\nexport class ANCVElement extends UIElement<ANCVConfiguration> {\n public static type = 'ancv';\n\n /**\n * Formats the component data output\n */\n formatData() {\n return {\n paymentMethod: {\n type: ANCVElement.type,\n beneficiaryId: this.state.data?.beneficiaryId\n }\n };\n }\n\n private onOrderRequest = data => {\n if (this.props.onOrderRequest)\n return new Promise((resolve, reject) => {\n this.props.onOrderRequest(resolve, reject, data);\n });\n\n if (this.props.session) {\n return this.props.session.createOrder();\n }\n };\n\n /**\n * Check if order exists, if it does Resolve.\n * Otherwise createOrder and then Resolve.\n */\n public createOrder = (): Promise<void> => {\n this.setStatus('loading');\n\n // allow for multiple ANCV payments, follow giftcard logic and just use order if it exists\n if (this.props.order) {\n return Promise.resolve();\n }\n\n return this.onOrderRequest(this.data)\n .then((order: { orderData: string; pspReference: string }) => {\n const stateOrder = { orderData: order.orderData, pspReference: order.pspReference };\n this.setState(stateOrder);\n return Promise.resolve();\n })\n .catch(error => {\n this.setStatus(error?.message || 'error');\n if (this.props.onError) this.handleError(new AdyenCheckoutError('ERROR', error));\n });\n };\n\n public submit() {\n if (!this.isValid) {\n this.showValidation();\n return false;\n }\n\n this.createOrder()\n .then(this.makePaymentsCall)\n .then(sanitizeResponse)\n .then(verifyPaymentDidNotFail)\n .then(this.handleResponse)\n .catch(this.handleFailedResult);\n }\n\n // Reimplement payButton similar to GiftCard to allow to set onClick\n public payButton = props => {\n return <PayButton {...props} />;\n };\n\n get isValid(): boolean {\n return !!this.state.isValid;\n }\n\n get displayName(): string {\n return this.props.name;\n }\n\n render() {\n if (this.props.paymentData) {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>\n <Await\n ref={ref => {\n this.componentRef = ref;\n }}\n clientKey={this.props.clientKey}\n paymentData={this.props.paymentData}\n onError={this.props.onError}\n onComplete={this.onComplete}\n brandLogo={this.icon}\n type={this.constructor['type']}\n messageText={this.props.i18n.get('ancv.confirmPayment')}\n awaitText={this.props.i18n.get('await.waitForConfirmation')}\n showCountdownTimer={config.showCountdownTimer}\n throttleTime={config.THROTTLE_TIME}\n throttleInterval={config.THROTTLE_INTERVAL}\n onActionHandled={this.props.onActionHandled}\n />\n </SRPanelProvider>\n </CoreProvider>\n );\n }\n\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <ANCVInput\n ref={ref => {\n this.componentRef = ref;\n }}\n {...this.props}\n onSubmit={this.submit}\n onChange={this.setState}\n payButton={this.payButton}\n showPayButton={this.props.showPayButton}\n />\n </CoreProvider>\n );\n }\n}\n\nexport default ANCVElement;\n"],"names":["ANCVElement","UIElement","static","formatData","paymentMethod","type","beneficiaryId","this","state","data","onOrderRequest","props","Promise","resolve","reject","session","createOrder","setStatus","order","then","stateOrder","orderData","pspReference","setState","catch","error","message","onError","handleError","AdyenCheckoutError","submit","isValid","showValidation","makePaymentsCall","sanitizeResponse","verifyPaymentDidNotFail","handleResponse","handleFailedResult","payButton","h","PayButton","displayName","name","render","paymentData","CoreProvider","i18n","loadingContext","resources","SRPanelProvider","srPanel","modules","Await","ref","componentRef","clientKey","onComplete","brandLogo","icon","constructor","messageText","get","awaitText","showCountdownTimer","config","throttleTime","THROTTLE_TIME","throttleInterval","THROTTLE_INTERVAL","onActionHandled","ANCVInput","onSubmit","onChange","showPayButton"],"mappings":"qkBAYO,MAAMA,UAAoBC,EAC7BC,YAAqB,OAKrBC,UAAAA,GACI,MAAO,CACHC,cAAe,CACXC,KAAML,EAAYK,KAClBC,cAAeC,KAAKC,MAAMC,MAAMH,eAG5C,CAEQI,eAAiBD,GACjBF,KAAKI,MAAMD,eACJ,IAAIE,SAAQ,CAACC,EAASC,KACzBP,KAAKI,MAAMD,eAAeG,EAASC,EAAQL,EAAA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CC,UAAWvD,KAAKI,MAAMmC,KAAKe,IAAI,6BAC/BE,mBAAoBC,EAAOD,mBAC3BE,aAAcD,EAAOE,cACrBC,iBAAkBH,EAAOI,kBACzBC,gBAAiB9D,KAAKI,MAAM0D,oBAQ5C9B,EAACM,EAAAA,CAAaC,KAAMvC,KAAKI,MAAMmC,KAAMC,eAAgBxC,KAAKI,MAAMoC,eAAgBC,UAAWzC,KAAKyC,WAC5FT,EAAC+B,EAAAA,CACGjB,IAAKA,IACD9C,KAAK+C,aAAeD,CAAAA,KAEpB9C,KAAKI,MACT4D,SAAUhE,KAAKuB,OACf0C,SAAUjE,KAAKgB,SACfe,UAAW/B,KAAK+B,UAChBmC,cAAelE,KAAKI,MAAM8D,gBAI1C"}
1
+ {"version":3,"file":"ANCV.js","sources":["../../../../src/components/ANCV/ANCV.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport ANCVInput from './components/ANCVInput';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport config from './components/ANCVAwait/config';\nimport Await from '../../components/internal/Await';\nimport SRPanelProvider from '../../core/Errors/SRPanelProvider';\nimport AdyenCheckoutError from '../../core/Errors/AdyenCheckoutError';\nimport PayButton from '../internal/PayButton';\nimport { ANCVConfiguration } from './types';\nimport { sanitizeResponse, verifyPaymentDidNotFail } from '../internal/UIElement/utils';\n\nexport class ANCVElement extends UIElement<ANCVConfiguration> {\n public static type = 'ancv';\n\n /**\n * Formats the component data output\n */\n formatData() {\n return {\n paymentMethod: {\n type: ANCVElement.type,\n beneficiaryId: this.state.data?.beneficiaryId\n }\n };\n }\n\n private onOrderRequest = data => {\n if (this.props.onOrderRequest)\n return new Promise((resolve, reject) => {\n this.props.onOrderRequest(resolve, reject, data);\n });\n\n if (this.props.session) {\n return this.props.session.createOrder();\n }\n };\n\n /**\n * Check if order exists, if it does Resolve.\n * Otherwise createOrder and then Resolve.\n */\n public createOrder = (): Promise<void> => {\n this.setStatus('loading');\n\n // allow for multiple ANCV payments, follow giftcard logic and just use order if it exists\n if (this.props.order) {\n return Promise.resolve();\n }\n\n return this.onOrderRequest(this.data)\n .then((order: { orderData: string; pspReference: string }) => {\n const stateOrder = { order: { orderData: order.orderData, pspReference: order.pspReference } };\n this.setState(stateOrder);\n return Promise.resolve();\n })\n .catch(error => {\n this.setStatus(error?.message || 'error');\n if (this.props.onError) this.handleError(new AdyenCheckoutError('ERROR', error));\n });\n };\n\n public submit() {\n if (!this.isValid) {\n this.showValidation();\n return false;\n }\n\n this.createOrder()\n .then(this.makePaymentsCall)\n .then(sanitizeResponse)\n .then(verifyPaymentDidNotFail)\n .then(this.handleResponse)\n .catch(this.handleFailedResult);\n }\n\n // Reimplement payButton similar to GiftCard to allow to set onClick\n public payButton = props => {\n return <PayButton {...props} />;\n };\n\n get isValid(): boolean {\n return !!this.state.isValid;\n }\n\n get displayName(): string {\n return this.props.name;\n }\n\n render() {\n if (this.props.paymentData) {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>\n <Await\n ref={ref => {\n this.componentRef = ref;\n }}\n clientKey={this.props.clientKey}\n paymentData={this.props.paymentData}\n onError={this.props.onError}\n onComplete={this.onComplete}\n brandLogo={this.icon}\n type={this.constructor['type']}\n messageText={this.props.i18n.get('ancv.confirmPayment')}\n awaitText={this.props.i18n.get('await.waitForConfirmation')}\n showCountdownTimer={config.showCountdownTimer}\n throttleTime={config.THROTTLE_TIME}\n throttleInterval={config.THROTTLE_INTERVAL}\n onActionHandled={this.props.onActionHandled}\n />\n </SRPanelProvider>\n </CoreProvider>\n );\n }\n\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <ANCVInput\n ref={ref => {\n this.componentRef = ref;\n }}\n {...this.props}\n onSubmit={this.submit}\n onChange={this.setState}\n payButton={this.payButton}\n showPayButton={this.props.showPayButton}\n />\n </CoreProvider>\n );\n }\n}\n\nexport default ANCVElement;\n"],"names":["ANCVElement","UIElement","static","formatData","paymentMethod","type","beneficiaryId","this","state","data","onOrderRequest","props","Promise","resolve","reject","session","createOrder","setStatus","order","then","stateOrder","orderData","pspReference","setState","catch","error","message","onError","handleError","AdyenCheckoutError","submit","isValid","showValidation","makePaymentsCall","sanitizeResponse","verifyPaymentDidNotFail","handleResponse","handleFailedResult","payButton","h","PayButton","displayName","name","render","paymentData","CoreProvider","i18n","loadingContext","resources","SRPanelProvider","srPanel","modules","Await","ref","componentRef","clientKey","onComplete","brandLogo","icon","constructor","messageText","get","awaitText","showCountdownTimer","config","throttleTime","THROTTLE_TIME","throttleInterval","THROTTLE_INTERVAL","onActionHandled","ANCVInput","onSubmit","onChange","showPayButton"],"mappings":"qkBAYO,MAAMA,UAAoBC,EAC7BC,YAAqB,OAKrBC,UAAAA,GACI,MAAO,CACHC,cAAe,CACXC,KAAML,EAAYK,KAClBC,cAAeC,KAAKC,MAAMC,MAAMH,eAG5C,CAEQI,eAAiBD,GACjBF,KAAKI,MAAMD,eACJ,IAAIE,SAAQ,CAACC,EAASC,KACzBP,KAAKI,MAAMD,eAAeG,EAASC,EAAQL,EAAAA,IAG/CF,KAAKI,MAAMI,QACJR,KAAKI,MAAMI,QAAQC,mBAD9B,EASJA,YAAqB,KACjBT,KAAKU,UAAU,WAGXV,KAAKI,MAAMO,MACJN,QAAQC,UAGZN,KAAKG,eAAeH,KAAKE,MAC3BU,MAAMD,IACH,MAAME,EAAa,CAAEF,MAAO,CAAEG,UAAWH,EAAMG,UAAWC,aAAcJ,EAAMI,eAE9E,OADAf,KAAKgB,SAASH,GACPR,QAAQC,SAAO,IAEzBW,OAAMC,IACHlB,KAAKU,UAAUQ,GAAOC,SAAW,SAC7BnB,KAAKI,MAAMgB,SAASpB,KAAKqB,YAAY,IAAIC,EAAmB,QAASJ,GAAAA,KAI9EK,MAAAA,GACH,IAAKvB,KAAKwB,QAEN,OADAxB,KAAKyB,kBACE,EAGX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@@
1
- import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import s from"./components/AchInput/AchInput.js";import{CoreProvider as o}from"../../core/Context/CoreProvider.js";import r from"../internal/RedirectButton/RedirectButton.js";import{TxVariants as n}from"../tx-variants.js";class i extends e{static type=n.ach;formatProps(t){return{...t,holderNameRequired:t.hasHolderName??t.holderNameRequired}}formatData(){const t=!!this.props.storedPaymentMethodId,e={type:i.type,...this.state.data,ownerName:this.state.data?.holderName,...t&&{storedPaymentMethodId:this.props.storedPaymentMethodId}};return delete e.holderName,{paymentMethod:e,...this.state.billingAddress&&{billingAddress:this.state.billingAddress},...this.state.storePaymentMethod&&{storePaymentMethod:this.state.storePaymentMethod}}}updateStyles(t){return this.componentRef&&this.componentRef.updateStyles&&this.componentRef.updateStyles(t),this}setFocusOn(t){return this.componentRef&&this.componentRef.setFocusOn&&this.componentRef.setFocusOn(t),this}get isValid(){return!!this.props.storedPaymentMethodId||!!this.state.isValid}get displayName(){return this.props.storedPaymentMethodId&&this.props.bankAccountNumber?`•••• ${this.props.bankAccountNumber.slice(-4)}`:this.props.name}get additionalInfo(){return this.props.storedPaymentMethodId?this.props.i18n.get("ach.savedBankAccount"):""}render(){return t(o,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},this.props.storedPaymentMethodId?t(r,{showPayButton:this.props.showPayButton,name:this.displayName,amount:this.props.amount,payButton:this.payButton,onSubmit:this.submit,ref:t=>{this.componentRef=t}}):t(s,{setComponentRef:this.setComponentRef,...this.props,onChange:this.setState,onSubmit:this.submit,payButton:this.payButton,resources:this.resources}))}}export{i as AchElement,i as default};
1
+ import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import s from"./components/AchInput/AchInput.js";import{CoreProvider as o}from"../../core/Context/CoreProvider.js";import r from"../internal/RedirectButton/RedirectButton.js";import{TxVariants as n}from"../tx-variants.js";class i extends e{static type=n.ach;formatProps(t){return{...t,holderNameRequired:t.hasHolderName??t.holderNameRequired}}formatData(){const t=!!this.props.storedPaymentMethodId,e={type:i.type,...this.state.data,ownerName:this.state.data?.holderName,...t&&{storedPaymentMethodId:this.props.storedPaymentMethodId}};return delete e.holderName,{paymentMethod:e,...this.state.billingAddress&&{billingAddress:this.state.billingAddress},...this.state.storePaymentMethod&&{storePaymentMethod:this.state.storePaymentMethod}}}updateStyles(t){return this.componentRef&&this.componentRef.updateStyles&&this.componentRef.updateStyles(t),this}setFocusOn(t){return this.componentRef&&this.componentRef.setFocusOn&&this.componentRef.setFocusOn(t),this}get isValid(){return!!this.props.storedPaymentMethodId||!!this.state.isValid}get displayName(){return this.props.storedPaymentMethodId&&this.props.bankAccountNumber?`•••• ${this.props.bankAccountNumber.slice(-4)}`:this.props.name}get additionalInfo(){return this.props.storedPaymentMethodId?this.props.i18n.get("ach.savedBankAccount"):""}render(){return t(o,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},this.props.storedPaymentMethodId?t(r,{showPayButton:this.props.showPayButton,name:this.displayName,amount:this.props.amount,payButton:this.payButton,onSubmit:this.submit,ref:t=>{this.componentRef=t}}):t(s,{setComponentRef:this.setComponentRef,handleKeyPress:this.handleKeyPress,...this.props,onChange:this.setState,onSubmit:this.submit,payButton:this.payButton,resources:this.resources}))}}export{i as AchElement,i as default};
2
2
  //# sourceMappingURL=Ach.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Ach.js","sources":["../../../../src/components/Ach/Ach.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport AchInput from './components/AchInput';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport RedirectButton from '../internal/RedirectButton';\nimport { AchConfiguration } from './types';\nimport { TxVariants } from '../tx-variants';\n\nexport class AchElement extends UIElement<AchConfiguration> {\n public static type = TxVariants.ach;\n\n formatProps(props: AchConfiguration) {\n return {\n ...props,\n // Fix mismatch between passed hasHolderName & holderNameRequired props\n // (when holderNameRequired = true, but hasHolderName = false - which means component will never be valid)\n holderNameRequired: props.hasHolderName ?? props.holderNameRequired\n // TODO - if it turns out that hasHolderName & holderNameRequired are not configurable by the merchant\n // then we will need to force these properties to true\n };\n }\n\n /**\n * Formats the component data output\n */\n formatData() {\n const recurringPayment = !!this.props.storedPaymentMethodId;\n\n // Map holderName to ownerName\n const paymentMethod = {\n type: AchElement.type,\n ...this.state.data,\n ownerName: this.state.data?.holderName,\n ...(recurringPayment && { storedPaymentMethodId: this.props.storedPaymentMethodId })\n };\n\n delete paymentMethod.holderName;\n\n return {\n paymentMethod,\n ...(this.state.billingAddress && { billingAddress: this.state.billingAddress }),\n ...(this.state.storePaymentMethod && { storePaymentMethod: this.state.storePaymentMethod })\n };\n }\n\n updateStyles(stylesObj) {\n if (this.componentRef && this.componentRef.updateStyles) this.componentRef.updateStyles(stylesObj);\n return this;\n }\n\n setFocusOn(fieldName) {\n if (this.componentRef && this.componentRef.setFocusOn) this.componentRef.setFocusOn(fieldName);\n return this;\n }\n\n get isValid() {\n if (this.props.storedPaymentMethodId) {\n return true;\n }\n\n return !!this.state.isValid;\n }\n\n get displayName() {\n if (this.props.storedPaymentMethodId && this.props.bankAccountNumber) {\n // get lastFour from bankAccountNumber, value comes from storedPaymentMethods\n return `•••• ${this.props.bankAccountNumber.slice(-4)}`;\n }\n return this.props.name;\n }\n\n get additionalInfo() {\n return this.props.storedPaymentMethodId ? this.props.i18n.get('ach.savedBankAccount') : '';\n }\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n {this.props.storedPaymentMethodId ? (\n <RedirectButton\n showPayButton={this.props.showPayButton}\n name={this.displayName}\n amount={this.props.amount}\n payButton={this.payButton}\n onSubmit={this.submit}\n ref={ref => {\n this.componentRef = ref;\n }}\n />\n ) : (\n <AchInput\n setComponentRef={this.setComponentRef}\n {...this.props}\n onChange={this.setState}\n onSubmit={this.submit}\n payButton={this.payButton}\n resources={this.resources}\n />\n )}\n </CoreProvider>\n );\n }\n}\n\nexport default AchElement;\n"],"names":["AchElement","UIElement","static","TxVariants","ach","formatProps","props","holderNameRequired","hasHolderName","formatData","recurringPayment","this","storedPaymentMethodId","paymentMethod","type","state","data","ownerName","holderName","billingAddress","storePaymentMethod","updateStyles","stylesObj","componentRef","setFocusOn","fieldName","isValid","displayName","bankAccountNumber","slice","name","additionalInfo","i18n","get","render","h","CoreProvider","loadingContext","resources","RedirectButton","showPayButton","amount","payButton","onSubmit","submit","ref","AchInput","setComponentRef","onChange","setState"],"mappings":"kWAQO,MAAMA,UAAmBC,EAC5BC,YAAqBC,EAAWC,IAEhCC,WAAAA,CAAYC,GACR,MAAO,IACAA,EAGHC,mBAAoBD,EAAME,eAAiBF,EAAMC,mBAIzD,CAKAE,UAAAA,GACI,MAAMC,IAAqBC,KAAKL,MAAMM,sBAGhCC,EAAgB,CAClBC,KAAMd,EAAWc,QACdH,KAAKI,MAAMC,KACdC,UAAWN,KAAKI,MAAMC,MAAME,cACxBR,GAAoB,CAAEE,sBAAuBD,KAAKL,MAAMM,wBAKhE,cAFOC,EAAcK,WAEd,CACHL,mBACIF,KAAKI,MAAMI,gBAAkB,CAAEA,eAAgBR,KAAKI,MAAMI,mBAC1DR,KAAKI,MAAMK,oBAAsB,CAAEA,mBAAoBT,KAAKI,MAAMK,oBAE9E,CAEAC,YAAAA,CAAaC,GAET,OADIX,KAAKY,cAAgBZ,KAAKY,aAAaF,cAAcV,KAAKY,aAAaF,aAAaC,GACjFX,IACX,CAEAa,UAAAA,CAAWC,GAEP,OADId,KAAKY,cAAgBZ,KAAKY,aAAaC,YAAYb,KAAKY,aAAaC,WAAWC,GAC7Ed,IACX,CAEA,WAAIe,GACA,QAAIf,KAAKL,MAAMM,yBAIND,KAAKI,MAAMW,OACxB,CAEA,eAAIC,GACA,OAAIhB,KAAKL,MAAMM,uBAAyBD,KAAKL,MAAMsB,kBAExC,QAAQjB,KAAKL,MAAMsB,kBAAkBC,OAAO,KAEhDlB,KAAKL,MAAMwB,IACtB,CAEA,kBAAIC,GACA,OAAOpB,KAAKL,MAAMM,sBAAwBD,KAAKL,MAAM0B,KAAKC,IAAI,wBAA0B,EAC5F,CAEAC,MAAAA,GACI,OACIC,EAACC,EAAAA,CAAaJ,KAAMrB,KAAKL,MAAM0B,KAAMK,eAAgB1B,KAAKL,MAAM+B,eAAgBC,UAAW3B,KAAK2B,WAC3F3B,KAAKL,MAAMM,sBACRuB,EAACI,EAAAA,CACGC,cAAe7B,KAAKL,MAAMkC,cAC1BV,KAAMnB,KAAKgB,YACXc,OAAQ9B,KAAKL,MAAMmC,OACnBC,UAAW/B,KAAK+B,UAChBC,SAAUhC,KAAKiC,OACfC,IAAKA,IACDlC,KAAKY,aAAesB,CAAAA,IAI5BV,EAACW,EAAAA,CACGC,gBAAiBpC,KAAKoC,mBAClBpC,KAAKL,MACT0C,SAAUrC,KAAKsC,SACfN,SAAUhC,KAAKiC,OACfF,UAAW/B,KAAK+B,UAChBJ,UAAW3B,KAAK2B,YAKpC"}
1
+ {"version":3,"file":"Ach.js","sources":["../../../../src/components/Ach/Ach.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport AchInput from './components/AchInput';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport RedirectButton from '../internal/RedirectButton';\nimport { AchConfiguration } from './types';\nimport { TxVariants } from '../tx-variants';\n\nexport class AchElement extends UIElement<AchConfiguration> {\n public static type = TxVariants.ach;\n\n formatProps(props: AchConfiguration) {\n return {\n ...props,\n // Fix mismatch between passed hasHolderName & holderNameRequired props\n // (when holderNameRequired = true, but hasHolderName = false - which means component will never be valid)\n holderNameRequired: props.hasHolderName ?? props.holderNameRequired\n // TODO - if it turns out that hasHolderName & holderNameRequired are not configurable by the merchant\n // then we will need to force these properties to true\n };\n }\n\n /**\n * Formats the component data output\n */\n formatData() {\n const recurringPayment = !!this.props.storedPaymentMethodId;\n\n // Map holderName to ownerName\n const paymentMethod = {\n type: AchElement.type,\n ...this.state.data,\n ownerName: this.state.data?.holderName,\n ...(recurringPayment && { storedPaymentMethodId: this.props.storedPaymentMethodId })\n };\n\n delete paymentMethod.holderName;\n\n return {\n paymentMethod,\n ...(this.state.billingAddress && { billingAddress: this.state.billingAddress }),\n ...(this.state.storePaymentMethod && { storePaymentMethod: this.state.storePaymentMethod })\n };\n }\n\n updateStyles(stylesObj) {\n if (this.componentRef && this.componentRef.updateStyles) this.componentRef.updateStyles(stylesObj);\n return this;\n }\n\n setFocusOn(fieldName) {\n if (this.componentRef && this.componentRef.setFocusOn) this.componentRef.setFocusOn(fieldName);\n return this;\n }\n\n get isValid() {\n if (this.props.storedPaymentMethodId) {\n return true;\n }\n\n return !!this.state.isValid;\n }\n\n get displayName() {\n if (this.props.storedPaymentMethodId && this.props.bankAccountNumber) {\n // get lastFour from bankAccountNumber, value comes from storedPaymentMethods\n return `•••• ${this.props.bankAccountNumber.slice(-4)}`;\n }\n return this.props.name;\n }\n\n get additionalInfo() {\n return this.props.storedPaymentMethodId ? this.props.i18n.get('ach.savedBankAccount') : '';\n }\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n {this.props.storedPaymentMethodId ? (\n <RedirectButton\n showPayButton={this.props.showPayButton}\n name={this.displayName}\n amount={this.props.amount}\n payButton={this.payButton}\n onSubmit={this.submit}\n ref={ref => {\n this.componentRef = ref;\n }}\n />\n ) : (\n <AchInput\n setComponentRef={this.setComponentRef}\n handleKeyPress={this.handleKeyPress}\n {...this.props}\n onChange={this.setState}\n onSubmit={this.submit}\n payButton={this.payButton}\n resources={this.resources}\n />\n )}\n </CoreProvider>\n );\n }\n}\n\nexport default AchElement;\n"],"names":["AchElement","UIElement","static","TxVariants","ach","formatProps","props","holderNameRequired","hasHolderName","formatData","recurringPayment","this","storedPaymentMethodId","paymentMethod","type","state","data","ownerName","holderName","billingAddress","storePaymentMethod","updateStyles","stylesObj","componentRef","setFocusOn","fieldName","isValid","displayName","bankAccountNumber","slice","name","additionalInfo","i18n","get","render","h","CoreProvider","loadingContext","resources","RedirectButton","showPayButton","amount","payButton","onSubmit","submit","ref","AchInput","setComponentRef","handleKeyPress","onChange","setState"],"mappings":"kWAQO,MAAMA,UAAmBC,EAC5BC,YAAqBC,EAAWC,IAEhCC,WAAAA,CAAYC,GACR,MAAO,IACAA,EAGHC,mBAAoBD,EAAME,eAAiBF,EAAMC,mBAIzD,CAKAE,UAAAA,GACI,MAAMC,IAAqBC,KAAKL,MAAMM,sBAGhCC,EAAgB,CAClBC,KAAMd,EAAWc,QACdH,KAAKI,MAAMC,KACdC,UAAWN,KAAKI,MAAMC,MAAME,cACxBR,GAAoB,CAAEE,sBAAuBD,KAAKL,MAAMM,wBAKhE,cAFOC,EAAcK,WAEd,CACHL,mBACIF,KAAKI,MAAMI,gBAAkB,CAAEA,eAAgBR,KAAKI,MAAMI,mBAC1DR,KAAKI,MAAMK,oBAAsB,CAAEA,mBAAoBT,KAAKI,MAAMK,oBAE9E,CAEAC,YAAAA,CAAaC,GAET,OADIX,KAAKY,cAAgBZ,KAAKY,aAAaF,cAAcV,KAAKY,aAAaF,aAAaC,GACjFX,IACX,CAEAa,UAAAA,CAAWC,GAEP,OADId,KAAKY,cAAgBZ,KAAKY,aAAaC,YAAYb,KAAKY,aAAaC,WAAWC,GAC7Ed,IACX,CAEA,WAAIe,GACA,QAAIf,KAAKL,MAAMM,yBAIND,KAAKI,MAAMW,OACxB,CAEA,eAAIC,GACA,OAAIhB,KAAKL,MAAMM,uBAAyBD,KAAKL,MAAMsB,kBAExC,QAAQjB,KAAKL,MAAMsB,kBAAkBC,OAAO,KAEhDlB,KAAKL,MAAMwB,IACtB,CAEA,kBAAIC,GACA,OAAOpB,KAAKL,MAAMM,sBAAwBD,KAAKL,MAAM0B,KAAKC,IAAI,wBAA0B,EAC5F,CAEAC,MAAAA,GACI,OACIC,EAACC,EAAAA,CAAaJ,KAAMrB,KAAKL,MAAM0B,KAAMK,eAAgB1B,KAAKL,MAAM+B,eAAgBC,UAAW3B,KAAK2B,WAC3F3B,KAAKL,MAAMM,sBACRuB,EAACI,EAAAA,CACGC,cAAe7B,KAAKL,MAAMkC,cAC1BV,KAAMnB,KAAKgB,YACXc,OAAQ9B,KAAKL,MAAMmC,OACnBC,UAAW/B,KAAK+B,UAChBC,SAAUhC,KAAKiC,OACfC,IAAKA,IACDlC,KAAKY,aAAesB,CAAAA,IAI5BV,EAACW,EAAAA,CACGC,gBAAiBpC,KAAKoC,gBACtBC,eAAgBrC,KAAKqC,kBACjBrC,KAAKL,MACT2C,SAAUtC,KAAKuC,SACfP,SAAUhC,KAAKiC,OACfF,UAAW/B,KAAK+B,UAChBJ,UAAW3B,KAAK2B,YAKpC"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../external/preact/dist/preact.js";import{useState as o,useRef as r,useEffect as t}from"../../../../external/preact/hooks/dist/hooks.js";import a from"../../../../external/classnames/index.js";import l from"./components/AchSecuredFields.js";import s from"../../../internal/SecuredFields/SFP/SecuredFieldsProvider.js";import d from"../../../internal/Address/Address.js";import n from"../../../internal/FormFields/Field/Field.js";import i from"../../../internal/LoadingWrapper/LoadingWrapper.js";import c from"./defaultProps.js";import u from"./defaultStyles.js";import{useCoreContext as m}from"../../../../core/Context/CoreProvider.js";import h from"../../../internal/StoreDetails/StoreDetails.js";import p from"../../../internal/FormFields/InputText.js";import N from"../../../internal/FormInstruction/FormInstruction.js";function f(e,o=!1){return!o||!!e&&"string"==typeof e&&e.trim().length>0}function g(c){const{i18n:g}=m(),y=c.hasHolderName&&(!!c.holderName||!!c.data.holderName),[_,C]=o({}),[b,x]=o({...c.holderNameRequired&&{holderName:y}}),[A,R]=o({...c.hasHolderName&&{holderName:c.holderName||c.data.holderName}}),[j,q]=o(c.billingAddressRequired?c.data.billingAddress:null),[S,k]=o(!1),[v,w]=o(""),[V,P]=o(!1),E=e=>{q({...j,...e.data}),x({...b,billingAddress:e.isValid})},H=e=>{const o=e.target.value;R({...A,holderName:o}),C({..._,holderName:!!c.holderNameRequired&&!f(o)}),x({...b,holderName:!c.holderNameRequired||f(o,c.holderNameRequired)})},I=r(null),O=r(null),B=e=>{O.current=e},[L,M]=o("ready"),W=r({});return Object.keys(W.current).length||c.setComponentRef?.(W.current),W.current.showValidation=()=>{I.current.showValidation(),c.holderNameRequired&&!b.holderName&&C({..._,holderName:!0}),O.current&&O.current.showValidation()},W.current.setStatus=M,t((()=>(this.setFocusOn=I.current.setFocusOn,this.updateStyles=I.current.updateStyles,()=>{I.current.destroy()})),[]),t((()=>{const e=f(A.holderName,c.holderNameRequired),o=S,r=!c.billingAddressRequired||Boolean(b.billingAddress),t=o&&e&&r;c.onChange({data:A,isValid:t,billingAddress:j,storePaymentMethod:V})}),[A,b,_,V]),e("div",{className:"adyen-checkout__ach"},e(N,null),e(s,{ref:I,...F(c),styles:{...u,...c.styles},onChange:e=>{const o=e,r=o.autoCompleteName?o.autoCompleteName:A.holderName;R({...A,...o.data,holderName:r}),C({..._,...o.errors}),x({...b,...o.valid,holderName:!c.holderNameRequired||f(r,c.holderNameRequired)}),k(o.isSfpValid)},onFocus:e=>{const o=!0===e.focus;w(e.currentFocusObject),o?c.onFocus(e):c.onBlur(e)},render:({setRootNode:o,setFocusOn:r},t)=>e("div",{ref:o,className:"adyen-checkout__ach-input sf-input__wrapper"},e(i,{status:t.status},e("div",{className:a(["adyen-checkout__fieldset","adyen-checkout__fieldset--ach"])},e("div",{className:"adyen-checkout__fieldset__title"},g.get("ach.bankAccount")),c.hasHolderName&&e(n,{label:g.get("ach.accountHolderNameField.title"),className:"adyen-checkout__pm__holderName",errorMessage:!!_.holderName&&g.get("ach.accountHolderNameField.invalid"),showContextualElement:c.showContextualElement,contextualText:g.get("ach.accountHolderNameField.contextualText"),isValid:!!b.holderName,name:"holderName"},e(p,{className:"adyen-checkout__pm__holderName__input adyen-checkout__input",placeholder:c?.placeholders?.holderName,value:A.holderName,required:c.holderNameRequired,onInput:H})),e(l,{focusedElement:v,onFocusField:r,errors:t.errors,valid:t.valid})),c.billingAddressRequired&&e(d,{label:"billingAddress",data:j,onChange:E,allowedCountries:c.billingAddressAllowedCountries,requiredFields:c.billingAddressRequiredFields,setComponentRef:B}),c.enableStoreDetails&&e(h,{onChange:P})))}),c.showPayButton&&c.payButton({status:L,label:g.get("confirmPurchase")}))}g.defaultProps=c;const F=e=>({autoFocus:e.autoFocus,clientKey:e.clientKey,i18n:e.i18n,keypadFix:e.keypadFix,legacyInputMode:e.legacyInputMode,loadingContext:e.loadingContext,onAllValid:e.onAllValid,onConfigSuccess:e.onConfigSuccess,onError:e.onError,onFieldValid:e.onFieldValid,onFocus:e.onFocus,onLoad:e.onLoad,showWarnings:e.showWarnings,styles:e.styles,type:e.type,forceCompat:e.forceCompat,resources:e.resources,placeholders:e.placeholders});export{g as default};
1
+ import{createElement as e}from"../../../../external/preact/dist/preact.js";import{useState as o,useRef as r,useEffect as t}from"../../../../external/preact/hooks/dist/hooks.js";import a from"../../../../external/classnames/index.js";import l from"./components/AchSecuredFields.js";import s from"../../../internal/SecuredFields/SFP/SecuredFieldsProvider.js";import d from"../../../internal/Address/Address.js";import n from"../../../internal/FormFields/Field/Field.js";import i from"../../../internal/LoadingWrapper/LoadingWrapper.js";import c from"./defaultProps.js";import u from"./defaultStyles.js";import{useCoreContext as m}from"../../../../core/Context/CoreProvider.js";import h from"../../../internal/StoreDetails/StoreDetails.js";import p from"../../../internal/FormFields/InputText.js";import N from"../../../internal/FormInstruction/FormInstruction.js";function f(e,o=!1){return!o||!!e&&"string"==typeof e&&e.trim().length>0}function g(c){const{i18n:g}=m(),y=c.hasHolderName&&(!!c.holderName||!!c.data.holderName),[_,C]=o({}),[b,x]=o({...c.holderNameRequired&&{holderName:y}}),[A,R]=o({...c.hasHolderName&&{holderName:c.holderName||c.data.holderName}}),[j,q]=o(c.billingAddressRequired?c.data.billingAddress:null),[S,k]=o(!1),[v,w]=o(""),[V,P]=o(!1),E=e=>{q({...j,...e.data}),x({...b,billingAddress:e.isValid})},H=e=>{const o=e.target.value;R({...A,holderName:o}),C({..._,holderName:!!c.holderNameRequired&&!f(o)}),x({...b,holderName:!c.holderNameRequired||f(o,c.holderNameRequired)})},I=r(null),O=r(null),B=e=>{O.current=e},[K,L]=o("ready"),M=r({});return Object.keys(M.current).length||c.setComponentRef?.(M.current),M.current.showValidation=()=>{I.current.showValidation(),c.holderNameRequired&&!b.holderName&&C({..._,holderName:!0}),O.current&&O.current.showValidation()},M.current.setStatus=L,t((()=>(this.setFocusOn=I.current.setFocusOn,this.updateStyles=I.current.updateStyles,()=>{I.current.destroy()})),[]),t((()=>{const e=f(A.holderName,c.holderNameRequired),o=S,r=!c.billingAddressRequired||Boolean(b.billingAddress),t=o&&e&&r;c.onChange({data:A,isValid:t,billingAddress:j,storePaymentMethod:V})}),[A,b,_,V]),e("div",{className:"adyen-checkout__ach"},e(N,null),e(s,{ref:I,...F(c),styles:{...u,...c.styles},onChange:e=>{const o=e,r=o.autoCompleteName?o.autoCompleteName:A.holderName;R({...A,...o.data,holderName:r}),C({..._,...o.errors}),x({...b,...o.valid,holderName:!c.holderNameRequired||f(r,c.holderNameRequired)}),k(o.isSfpValid)},onFocus:e=>{const o=!0===e.focus;w(e.currentFocusObject),o?c.onFocus(e):c.onBlur(e)},render:({setRootNode:o,setFocusOn:r},t)=>e("div",{ref:o,className:"adyen-checkout__ach-input sf-input__wrapper"},e(i,{status:t.status},e("div",{className:a(["adyen-checkout__fieldset","adyen-checkout__fieldset--ach"])},e("div",{className:"adyen-checkout__fieldset__title"},g.get("ach.bankAccount")),c.hasHolderName&&e(n,{label:g.get("ach.accountHolderNameField.title"),className:"adyen-checkout__pm__holderName",errorMessage:!!_.holderName&&g.get("ach.accountHolderNameField.invalid"),showContextualElement:c.showContextualElement,contextualText:g.get("ach.accountHolderNameField.contextualText"),isValid:!!b.holderName,name:"holderName"},e(p,{className:"adyen-checkout__pm__holderName__input adyen-checkout__input",placeholder:c?.placeholders?.holderName,value:A.holderName,required:c.holderNameRequired,onInput:H})),e(l,{focusedElement:v,onFocusField:r,errors:t.errors,valid:t.valid})),c.billingAddressRequired&&e(d,{label:"billingAddress",data:j,onChange:E,allowedCountries:c.billingAddressAllowedCountries,requiredFields:c.billingAddressRequiredFields,setComponentRef:B}),c.enableStoreDetails&&e(h,{onChange:P})))}),c.showPayButton&&c.payButton({status:K,label:g.get("confirmPurchase")}))}g.defaultProps=c;const F=e=>({autoFocus:e.autoFocus,clientKey:e.clientKey,i18n:e.i18n,keypadFix:e.keypadFix,legacyInputMode:e.legacyInputMode,loadingContext:e.loadingContext,onAllValid:e.onAllValid,onConfigSuccess:e.onConfigSuccess,onError:e.onError,onFieldValid:e.onFieldValid,onFocus:e.onFocus,onLoad:e.onLoad,showWarnings:e.showWarnings,styles:e.styles,type:e.type,forceCompat:e.forceCompat,resources:e.resources,placeholders:e.placeholders,handleKeyPress:e.handleKeyPress});export{g as default};
2
2
  //# sourceMappingURL=AchInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AchInput.js","sources":["../../../../../../src/components/Ach/components/AchInput/AchInput.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useState, useEffect, useRef } from 'preact/hooks';\nimport classNames from 'classnames';\nimport AchSecuredFields from './components/AchSecuredFields';\nimport SecuredFieldsProvider from '../../../internal/SecuredFields/SFP/SecuredFieldsProvider';\nimport Address from '../../../internal/Address';\nimport Field from '../../../internal/FormFields/Field';\nimport LoadingWrapper from '../../../internal/LoadingWrapper/LoadingWrapper';\nimport defaultProps from './defaultProps';\nimport defaultStyles from './defaultStyles';\nimport { useCoreContext } from '../../../../core/Context/CoreProvider';\nimport './AchInput.scss';\nimport { ACHInputDataState, ACHInputProps, ACHInputStateError, ACHInputStateValid } from './types';\nimport StoreDetails from '../../../internal/StoreDetails';\nimport InputText from '../../../internal/FormFields/InputText';\nimport FormInstruction from '../../../internal/FormInstruction';\nimport { ComponentMethodsRef } from '../../../internal/UIElement/types';\n\nfunction validateHolderName(holderName, holderNameRequired = false) {\n if (holderNameRequired) {\n return !!holderName && typeof holderName === 'string' && holderName.trim().length > 0;\n }\n return true;\n}\n\nfunction AchInput(props: ACHInputProps) {\n const { i18n } = useCoreContext();\n\n const holderNameIsValid = props.hasHolderName && (!!props.holderName || !!props.data.holderName);\n\n const [errors, setErrors] = useState<ACHInputStateError>({});\n const [valid, setValid] = useState<ACHInputStateValid>({\n ...(props.holderNameRequired && { holderName: holderNameIsValid })\n });\n const [data, setData] = useState<ACHInputDataState>({\n ...(props.hasHolderName && { holderName: props.holderName || props.data.holderName })\n });\n\n const [billingAddress, setBillingAddress] = useState(props.billingAddressRequired ? props.data.billingAddress : null);\n const [isSfpValid, setIsSfpValid] = useState(false);\n const [focusedElement, setFocusedElement] = useState('');\n const [storePaymentMethod, setStorePaymentMethod] = useState(false);\n\n const handleFocus = e => {\n const isFocused = e.focus === true;\n\n setFocusedElement(e.currentFocusObject);\n\n if (isFocused) {\n props.onFocus(e);\n } else {\n props.onBlur(e);\n }\n };\n\n const handleAddress = address => {\n setBillingAddress({ ...billingAddress, ...address.data });\n setValid({ ...valid, billingAddress: address.isValid });\n };\n\n const handleHolderName = e => {\n const holderName = e.target.value;\n\n setData({ ...data, holderName });\n setErrors({ ...errors, holderName: props.holderNameRequired ? !validateHolderName(holderName) : false });\n setValid({ ...valid, holderName: props.holderNameRequired ? validateHolderName(holderName, props.holderNameRequired) : true });\n };\n\n const handleSecuredFieldsChange = newState => {\n const sfState = newState;\n\n const tempHolderName = sfState.autoCompleteName ? sfState.autoCompleteName : data.holderName;\n\n setData({ ...data, ...sfState.data, holderName: tempHolderName });\n setErrors({ ...errors, ...sfState.errors });\n setValid({\n ...valid,\n ...sfState.valid,\n holderName: props.holderNameRequired ? validateHolderName(tempHolderName, props.holderNameRequired) : true\n });\n\n setIsSfpValid(sfState.isSfpValid);\n };\n\n // Refs\n const sfp = useRef(null);\n const billingAddressRef = useRef(null);\n const setAddressRef = ref => {\n billingAddressRef.current = ref;\n };\n\n const [status, setStatus] = useState('ready');\n\n /** An object by which to expose 'public' members to the parent UIElement */\n const achRef = useRef<ComponentMethodsRef>({});\n // Just call once\n if (!Object.keys(achRef.current).length) {\n props.setComponentRef?.(achRef.current);\n }\n\n achRef.current.showValidation = () => {\n // Validate SecuredFields\n sfp.current.showValidation();\n\n // Validate holderName\n if (props.holderNameRequired && !valid.holderName) {\n setErrors({ ...errors, holderName: true });\n }\n\n // Validate Address\n if (billingAddressRef.current) billingAddressRef.current.showValidation();\n };\n\n achRef.current.setStatus = setStatus;\n\n useEffect(() => {\n this.setFocusOn = sfp.current.setFocusOn;\n this.updateStyles = sfp.current.updateStyles;\n\n return () => {\n sfp.current.destroy();\n };\n }, []);\n\n // Run when state.data, -errors or -valid change\n useEffect(() => {\n // Validate whole component i.e holderName + securedFields + address\n const holderNameValid = validateHolderName(data.holderName, props.holderNameRequired);\n const sfpValid = isSfpValid;\n const billingAddressValid = props.billingAddressRequired ? Boolean(valid.billingAddress) : true;\n\n const isValid = sfpValid && holderNameValid && billingAddressValid;\n\n props.onChange({ data, isValid, billingAddress, storePaymentMethod });\n }, [data, valid, errors, storePaymentMethod]);\n\n return (\n <div className=\"adyen-checkout__ach\">\n <FormInstruction />\n\n <SecuredFieldsProvider\n ref={sfp}\n {...extractPropsForSFP(props)}\n styles={{ ...defaultStyles, ...props.styles }}\n onChange={handleSecuredFieldsChange}\n onFocus={handleFocus}\n render={({ setRootNode, setFocusOn }, sfpState) => (\n <div ref={setRootNode} className=\"adyen-checkout__ach-input sf-input__wrapper\">\n <LoadingWrapper status={sfpState.status}>\n <div className={classNames(['adyen-checkout__fieldset', 'adyen-checkout__fieldset--ach'])}>\n {<div className=\"adyen-checkout__fieldset__title\">{i18n.get('ach.bankAccount')}</div>}\n\n {props.hasHolderName && (\n <Field\n label={i18n.get('ach.accountHolderNameField.title')}\n className={'adyen-checkout__pm__holderName'}\n errorMessage={!!errors.holderName && i18n.get('ach.accountHolderNameField.invalid')}\n showContextualElement={props.showContextualElement}\n contextualText={i18n.get('ach.accountHolderNameField.contextualText')}\n isValid={!!valid.holderName}\n name={'holderName'}\n >\n <InputText\n className=\"adyen-checkout__pm__holderName__input adyen-checkout__input\"\n placeholder={props?.placeholders?.holderName}\n value={data.holderName}\n required={props.holderNameRequired}\n onInput={handleHolderName}\n />\n </Field>\n )}\n\n <AchSecuredFields\n focusedElement={focusedElement}\n onFocusField={setFocusOn}\n errors={sfpState.errors}\n valid={sfpState.valid}\n />\n </div>\n\n {props.billingAddressRequired && (\n <Address\n label=\"billingAddress\"\n data={billingAddress}\n onChange={handleAddress}\n allowedCountries={props.billingAddressAllowedCountries}\n requiredFields={props.billingAddressRequiredFields}\n setComponentRef={setAddressRef}\n />\n )}\n\n {props.enableStoreDetails && <StoreDetails onChange={setStorePaymentMethod} />}\n </LoadingWrapper>\n </div>\n )}\n />\n {props.showPayButton && props.payButton({ status, label: i18n.get('confirmPurchase') })}\n </div>\n );\n}\n\nAchInput.defaultProps = defaultProps;\n\nexport default AchInput;\n\nconst extractPropsForSFP = (props: ACHInputProps) => {\n return {\n autoFocus: props.autoFocus,\n clientKey: props.clientKey,\n i18n: props.i18n,\n keypadFix: props.keypadFix,\n legacyInputMode: props.legacyInputMode,\n loadingContext: props.loadingContext,\n onAllValid: props.onAllValid,\n onConfigSuccess: props.onConfigSuccess,\n onError: props.onError,\n onFieldValid: props.onFieldValid,\n onFocus: props.onFocus,\n onLoad: props.onLoad,\n showWarnings: props.showWarnings,\n styles: props.styles,\n type: props.type,\n forceCompat: props.forceCompat,\n resources: props.resources,\n placeholders: props.placeholders\n };\n};\n"],"names":["validateHolderName","holderName","holderNameRequired","trim","length","AchInput","props","i18n","useCoreContext","holderNameIsValid","hasHolderName","data","errors","setErrors","useState","valid","setValid","setData","billingAddress","setBillingAddress","billingAddressRequired","isSfpValid","setIsSfpValid","focusedElement","setFocusedElement","storePaymentMethod","setStorePaymentMethod","handleAddress","address","isValid","handleHolderName","e","target","value","sfp","useRef","billingAddressRef","setAddressRef","ref","current","status","setStatus","achRef","Object","keys","setComponentRef","showValidation","useEffect","this","setFocusOn","updateStyles","destroy","holderNameValid","sfpValid","billingAddressValid","Boolean","onChange","h","div","className","FormInstruction","SecuredFieldsProvider","extractPropsForSFP","styles","defaultStyles","newState","sfState","tempHolderName","autoCompleteName","onFocus","isFocused","focus","currentFocusObject","onBlur","render","setRootNode","sfpState","LoadingWrapper","classNames","get","Field","label","errorMessage","showContextualElement","contextualText","name","InputText","placeholder","placeholders","required","onInput","AchSecuredFields","onFocusField","Address","allowedCountries","billingAddressAllowedCountries","requiredFields","billingAddressRequiredFields","enableStoreDetails","StoreDetails","showPayButton","payButton","defaultProps","autoFocus","clientKey","keypadFix","legacyInputMode","loadingContext","onAllValid","onConfigSuccess","onError","onFieldValid","onLoad","showWarnings","type","forceCompat","resources"],"mappings":"81BAkBA,SAASA,EAAmBC,EAAYC,GAAqB,GACzD,OAAIA,KACSD,GAAoC,iBAAfA,GAA2BA,EAAWE,OAAOC,OAAS,CAG5F,CAEA,SAASC,EAASC,GACd,MAAMC,KAAEA,GAASC,IAEXC,EAAoBH,EAAMI,kBAAoBJ,EAAML,cAAgBK,EAAMK,KAAKV,aAE9EW,EAAQC,GAAaC,EAA6B,CAAC,IACnDC,EAAOC,GAAYF,EAA6B,IAC/CR,EAAMJ,oBAAsB,CAAED,WAAYQ,MAE3CE,EAAMM,GAAWH,EAA4B,IAC5CR,EAAMI,eAAiB,CAAET,WAAYK,EAAML,YAAcK,EAAMK,KAAKV,eAGrEiB,EAAgBC,GAAqBL,EAASR,EAAMc,uBAAyBd,EAAMK,KAAKO,eAAiB,OACzGG,EAAYC,GAAiBR,GAAS,IACtCS,EAAgBC,GAAqBV,EAAS,KAC9CW,EAAoBC,GAAyBZ,GAAS,GAcvDa,EAAgBC,IAClBT,EAAkB,IAAKD,KAAmBU,EAAQjB,OAClDK,EAAS,IAAKD,EAAOG,eAAgBU,EAAQC,SAAQ,E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AMO,EACNsC,SAAU7B,EACVmE,iBAAkBxF,EAAMyF,+BACxBC,eAAgB1F,EAAM2F,6BACtBpD,gBAAiBR,IAIxB/B,EAAM4F,oBAAsBzC,EAAC0C,EAAAA,CAAa3C,SAAU9B,QAKpEpB,EAAM8F,eAAiB9F,EAAM+F,UAAU,CAAE7D,SAAQyC,MAAO1E,EAAKwE,IAAI,qBAG9E,CAEA1E,EAASiG,aAAeA,EAIxB,MAAMxC,EAAsBxD,IACjB,CACHiG,UAAWjG,EAAMiG,UACjBC,UAAWlG,EAAMkG,UACjBjG,KAAMD,EAAMC,KACZkG,UAAWnG,EAAMmG,UACjBC,gBAAiBpG,EAAMoG,gBACvBC,eAAgBrG,EAAMqG,eACtBC,WAAYtG,EAAMsG,WAClBC,gBAAiBvG,EAAMuG,gBACvBC,QAASxG,EAAMwG,QACfC,aAAczG,EAAMyG,aACpB1C,QAAS/D,EAAM+D,QACf2C,OAAQ1G,EAAM0G,OACdC,aAAc3G,EAAM2G,aACpBlD,OAAQzD,EAAMyD,OACdmD,KAAM5G,EAAM4G,KACZC,YAAa7G,EAAM6G,YACnBC,UAAW9G,EAAM8G,UACjB5B,aAAclF,EAAMkF"}
1
+ {"version":3,"file":"AchInput.js","sources":["../../../../../../src/components/Ach/components/AchInput/AchInput.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useState, useEffect, useRef } from 'preact/hooks';\nimport classNames from 'classnames';\nimport AchSecuredFields from './components/AchSecuredFields';\nimport SecuredFieldsProvider from '../../../internal/SecuredFields/SFP/SecuredFieldsProvider';\nimport Address from '../../../internal/Address';\nimport Field from '../../../internal/FormFields/Field';\nimport LoadingWrapper from '../../../internal/LoadingWrapper/LoadingWrapper';\nimport defaultProps from './defaultProps';\nimport defaultStyles from './defaultStyles';\nimport { useCoreContext } from '../../../../core/Context/CoreProvider';\nimport './AchInput.scss';\nimport { ACHInputDataState, ACHInputProps, ACHInputStateError, ACHInputStateValid } from './types';\nimport StoreDetails from '../../../internal/StoreDetails';\nimport InputText from '../../../internal/FormFields/InputText';\nimport FormInstruction from '../../../internal/FormInstruction';\nimport { ComponentMethodsRef } from '../../../internal/UIElement/types';\n\nfunction validateHolderName(holderName, holderNameRequired = false) {\n if (holderNameRequired) {\n return !!holderName && typeof holderName === 'string' && holderName.trim().length > 0;\n }\n return true;\n}\n\nfunction AchInput(props: ACHInputProps) {\n const { i18n } = useCoreContext();\n\n const holderNameIsValid = props.hasHolderName && (!!props.holderName || !!props.data.holderName);\n\n const [errors, setErrors] = useState<ACHInputStateError>({});\n const [valid, setValid] = useState<ACHInputStateValid>({\n ...(props.holderNameRequired && { holderName: holderNameIsValid })\n });\n const [data, setData] = useState<ACHInputDataState>({\n ...(props.hasHolderName && { holderName: props.holderName || props.data.holderName })\n });\n\n const [billingAddress, setBillingAddress] = useState(props.billingAddressRequired ? props.data.billingAddress : null);\n const [isSfpValid, setIsSfpValid] = useState(false);\n const [focusedElement, setFocusedElement] = useState('');\n const [storePaymentMethod, setStorePaymentMethod] = useState(false);\n\n const handleFocus = e => {\n const isFocused = e.focus === true;\n\n setFocusedElement(e.currentFocusObject);\n\n if (isFocused) {\n props.onFocus(e);\n } else {\n props.onBlur(e);\n }\n };\n\n const handleAddress = address => {\n setBillingAddress({ ...billingAddress, ...address.data });\n setValid({ ...valid, billingAddress: address.isValid });\n };\n\n const handleHolderName = e => {\n const holderName = e.target.value;\n\n setData({ ...data, holderName });\n setErrors({ ...errors, holderName: props.holderNameRequired ? !validateHolderName(holderName) : false });\n setValid({ ...valid, holderName: props.holderNameRequired ? validateHolderName(holderName, props.holderNameRequired) : true });\n };\n\n const handleSecuredFieldsChange = newState => {\n const sfState = newState;\n\n const tempHolderName = sfState.autoCompleteName ? sfState.autoCompleteName : data.holderName;\n\n setData({ ...data, ...sfState.data, holderName: tempHolderName });\n setErrors({ ...errors, ...sfState.errors });\n setValid({\n ...valid,\n ...sfState.valid,\n holderName: props.holderNameRequired ? validateHolderName(tempHolderName, props.holderNameRequired) : true\n });\n\n setIsSfpValid(sfState.isSfpValid);\n };\n\n // Refs\n const sfp = useRef(null);\n const billingAddressRef = useRef(null);\n const setAddressRef = ref => {\n billingAddressRef.current = ref;\n };\n\n const [status, setStatus] = useState('ready');\n\n /** An object by which to expose 'public' members to the parent UIElement */\n const achRef = useRef<ComponentMethodsRef>({});\n // Just call once\n if (!Object.keys(achRef.current).length) {\n props.setComponentRef?.(achRef.current);\n }\n\n achRef.current.showValidation = () => {\n // Validate SecuredFields\n sfp.current.showValidation();\n\n // Validate holderName\n if (props.holderNameRequired && !valid.holderName) {\n setErrors({ ...errors, holderName: true });\n }\n\n // Validate Address\n if (billingAddressRef.current) billingAddressRef.current.showValidation();\n };\n\n achRef.current.setStatus = setStatus;\n\n useEffect(() => {\n this.setFocusOn = sfp.current.setFocusOn;\n this.updateStyles = sfp.current.updateStyles;\n\n return () => {\n sfp.current.destroy();\n };\n }, []);\n\n // Run when state.data, -errors or -valid change\n useEffect(() => {\n // Validate whole component i.e holderName + securedFields + address\n const holderNameValid = validateHolderName(data.holderName, props.holderNameRequired);\n const sfpValid = isSfpValid;\n const billingAddressValid = props.billingAddressRequired ? Boolean(valid.billingAddress) : true;\n\n const isValid = sfpValid && holderNameValid && billingAddressValid;\n\n props.onChange({ data, isValid, billingAddress, storePaymentMethod });\n }, [data, valid, errors, storePaymentMethod]);\n\n return (\n <div className=\"adyen-checkout__ach\">\n <FormInstruction />\n\n <SecuredFieldsProvider\n ref={sfp}\n {...extractPropsForSFP(props)}\n styles={{ ...defaultStyles, ...props.styles }}\n onChange={handleSecuredFieldsChange}\n onFocus={handleFocus}\n render={({ setRootNode, setFocusOn }, sfpState) => (\n <div ref={setRootNode} className=\"adyen-checkout__ach-input sf-input__wrapper\">\n <LoadingWrapper status={sfpState.status}>\n <div className={classNames(['adyen-checkout__fieldset', 'adyen-checkout__fieldset--ach'])}>\n {<div className=\"adyen-checkout__fieldset__title\">{i18n.get('ach.bankAccount')}</div>}\n\n {props.hasHolderName && (\n <Field\n label={i18n.get('ach.accountHolderNameField.title')}\n className={'adyen-checkout__pm__holderName'}\n errorMessage={!!errors.holderName && i18n.get('ach.accountHolderNameField.invalid')}\n showContextualElement={props.showContextualElement}\n contextualText={i18n.get('ach.accountHolderNameField.contextualText')}\n isValid={!!valid.holderName}\n name={'holderName'}\n >\n <InputText\n className=\"adyen-checkout__pm__holderName__input adyen-checkout__input\"\n placeholder={props?.placeholders?.holderName}\n value={data.holderName}\n required={props.holderNameRequired}\n onInput={handleHolderName}\n />\n </Field>\n )}\n\n <AchSecuredFields\n focusedElement={focusedElement}\n onFocusField={setFocusOn}\n errors={sfpState.errors}\n valid={sfpState.valid}\n />\n </div>\n\n {props.billingAddressRequired && (\n <Address\n label=\"billingAddress\"\n data={billingAddress}\n onChange={handleAddress}\n allowedCountries={props.billingAddressAllowedCountries}\n requiredFields={props.billingAddressRequiredFields}\n setComponentRef={setAddressRef}\n />\n )}\n\n {props.enableStoreDetails && <StoreDetails onChange={setStorePaymentMethod} />}\n </LoadingWrapper>\n </div>\n )}\n />\n {props.showPayButton && props.payButton({ status, label: i18n.get('confirmPurchase') })}\n </div>\n );\n}\n\nAchInput.defaultProps = defaultProps;\n\nexport default AchInput;\n\nconst extractPropsForSFP = (props: ACHInputProps) => {\n return {\n autoFocus: props.autoFocus,\n clientKey: props.clientKey,\n i18n: props.i18n,\n keypadFix: props.keypadFix,\n legacyInputMode: props.legacyInputMode,\n loadingContext: props.loadingContext,\n onAllValid: props.onAllValid,\n onConfigSuccess: props.onConfigSuccess,\n onError: props.onError,\n onFieldValid: props.onFieldValid,\n onFocus: props.onFocus,\n onLoad: props.onLoad,\n showWarnings: props.showWarnings,\n styles: props.styles,\n type: props.type,\n forceCompat: props.forceCompat,\n resources: props.resources,\n placeholders: props.placeholders,\n handleKeyPress: props.handleKeyPress\n };\n};\n"],"names":["validateHolderName","holderName","holderNameRequired","trim","length","AchInput","props","i18n","useCoreContext","holderNameIsValid","hasHolderName","data","errors","setErrors","useState","valid","setValid","setData","billingAddress","setBillingAddress","billingAddressRequired","isSfpValid","setIsSfpValid","focusedElement","setFocusedElement","storePaymentMethod","setStorePaymentMethod","handleAddress","address","isValid","handleHolderName","e","target","value","sfp","useRef","billingAddressRef","setAddressRef","ref","current","status","setStatus","achRef","Object","keys","setComponentRef","showValidation","useEffect","this","setFocusOn","updateStyles","destroy","holderNameValid","sfpValid","billingAddressValid","Boolean","onChange","h","div","className","FormInstruction","SecuredFieldsProvider","extractPropsForSFP","styles","defaultStyles","newState","sfState","tempHolderName","autoCompleteName","onFocus","isFocused","focus","currentFocusObject","onBlur","render","setRootNode","sfpState","LoadingWrapper","classNames","get","Field","label","errorMessage","showContextualElement","contextualText","name","InputText","placeholder","placeholders","required","onInput","AchSecuredFields","onFocusField","Address","allowedCountries","billingAddressAllowedCountries","requiredFields","billingAddressRequiredFields","enableStoreDetails","StoreDetails","showPayButton","payButton","defaultProps","autoFocus","clientKey","keypadFix","legacyInputMode","loadingContext","onAllValid","onConfigSuccess","onError","onFieldValid","onLoad","showWarnings","type","forceCompat","resources","handleKeyPress"],"mappings":"81BAkBA,SAASA,EAAmBC,EAAYC,GAAqB,GACzD,OAAIA,KACSD,GAAoC,iBAAfA,GAA2BA,EAAWE,OAAOC,OAAS,CAG5F,CAEA,SAASC,EAASC,GACd,MAAMC,KAAEA,GAASC,IAEXC,EAAoBH,EAAMI,kBAAoBJ,EAAML,cAAgBK,EAAMK,KAAKV,aAE9EW,EAAQC,GAAaC,EAA6B,CAAC,IACnDC,EAAOC,GAAYF,EAA6B,IAC/CR,EAAMJ,oBAAsB,CAAED,WAAYQ,MAE3CE,EAAMM,GAAWH,EAA4B,IAC5CR,EAAMI,eAAiB,CAAET,WAAYK,EAAML,YAAcK,EAAMK,KAAKV,eAGrEiB,EAAgBC,GAAqBL,EAASR,EAAMc,uBAAyBd,EAAMK,KAAKO,eAAiB,OACzGG,EAAYC,GAAiBR,GAAS,IACtCS,EAAgBC,GAAqBV,EAAS,KAC9CW,EAAoB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AChBqE,aAAc3C,EACdrC,OAAQgE,EAAShE,OACjBG,MAAO6D,EAAS7D,SAIvBT,EAAMc,wBACHqC,EAACoC,EAAAA,CACGZ,MAAM,iBACNtE,KAAMO,EACNsC,SAAU7B,EACVmE,iBAAkBxF,EAAMyF,+BACxBC,eAAgB1F,EAAM2F,6BACtBpD,gBAAiBR,IAIxB/B,EAAM4F,oBAAsBzC,EAAC0C,EAAAA,CAAa3C,SAAU9B,QAKpEpB,EAAM8F,eAAiB9F,EAAM+F,UAAU,CAAE7D,SAAQyC,MAAO1E,EAAKwE,IAAI,qBAG9E,CAEA1E,EAASiG,aAAeA,EAIxB,MAAMxC,EAAsBxD,IACjB,CACHiG,UAAWjG,EAAMiG,UACjBC,UAAWlG,EAAMkG,UACjBjG,KAAMD,EAAMC,KACZkG,UAAWnG,EAAMmG,UACjBC,gBAAiBpG,EAAMoG,gBACvBC,eAAgBrG,EAAMqG,eACtBC,WAAYtG,EAAMsG,WAClBC,gBAAiBvG,EAAMuG,gBACvBC,QAASxG,EAAMwG,QACfC,aAAczG,EAAMyG,aACpB1C,QAAS/D,EAAM+D,QACf2C,OAAQ1G,EAAM0G,OACdC,aAAc3G,EAAM2G,aACpBlD,OAAQzD,EAAMyD,OACdmD,KAAM5G,EAAM4G,KACZC,YAAa7G,EAAM6G,YACnBC,UAAW9G,EAAM8G,UACjB5B,aAAclF,EAAMkF,aACpB6B,eAAgB/G,EAAM+G"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../../external/preact/dist/preact.js";import t from"../../../../../external/classnames/index.js";import a from"../../../../internal/FormFields/Field/Field.js";import r from"../../../../Card/components/CardInput/components/DataSfSpan.js";import{alternativeLabelContent as n}from"../../../../Card/components/CardInput/components/IframeLabelAlternative.js";import{capitalizeFirstLetter as o}from"../../../../../utils/textUtils.js";const s=({id:s,dataInfo:i,className:l="",label:d,focused:c,filled:m,errorMessage:p="",isValid:u=!1,onFocusField:f,dir:_})=>{const F=`encrypted${o(s)}`;return e(a,{label:d,focused:c,filled:m,classNameModifiers:[s],onFocusField:()=>f(F),errorMessage:p,isValid:u,className:l,dir:_,name:s,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:n},e(r,{encryptedFieldType:F,"data-info":i,className:t({"adyen-checkout__input":!0,"adyen-checkout__input--large":!0,"adyen-checkout__input--error":p.length,"adyen-checkout__input--focus":c,"adyen-checkout__input--valid":u})}))};export{s as default};
1
+ import{createElement as e}from"../../../../../external/preact/dist/preact.js";import t from"../../../../../external/classnames/index.js";import a from"../../../../internal/FormFields/Field/Field.js";import r from"../../../../Card/components/CardInput/components/DataSfSpan.js";import{alternativeLabelContent as n}from"../../../../Card/components/CardInput/components/FieldLabelAlternative.js";import{capitalizeFirstLetter as o}from"../../../../../utils/textUtils.js";const s=({id:s,dataInfo:i,className:l="",label:d,focused:c,filled:m,errorMessage:p="",isValid:u=!1,onFocusField:f,dir:F})=>{const _=`encrypted${o(s)}`;return e(a,{label:d,focused:c,filled:m,classNameModifiers:[s],onFocusField:()=>f(_),errorMessage:p,isValid:u,className:l,dir:F,name:s,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:n},e(r,{encryptedFieldType:_,"data-info":i,className:t({"adyen-checkout__input":!0,"adyen-checkout__input--large":!0,"adyen-checkout__input--error":p.length,"adyen-checkout__input--focus":c,"adyen-checkout__input--valid":u})}))};export{s as default};
2
2
  //# sourceMappingURL=AchSFInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AchSFInput.js","sources":["../../../../../../../src/components/Ach/components/AchInput/components/AchSFInput.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport Field from '../../../../internal/FormFields/Field';\nimport DataSfSpan from '../../../../Card/components/CardInput/components/DataSfSpan';\nimport { alternativeLabelContent } from '../../../../Card/components/CardInput/components/IframeLabelAlternative';\nimport { capitalizeFirstLetter } from '../../../../../utils/textUtils';\n\nconst AchSFInput = ({ id, dataInfo, className = '', label, focused, filled, errorMessage = '', isValid = false, onFocusField, dir }) => {\n const capitalisedId = capitalizeFirstLetter(id);\n const encryptedIdStr = `encrypted${capitalisedId}`;\n\n return (\n <Field\n label={label}\n focused={focused}\n filled={filled}\n classNameModifiers={[id]}\n onFocusField={() => onFocusField(encryptedIdStr)}\n errorMessage={errorMessage}\n isValid={isValid}\n className={className}\n dir={dir}\n name={id}\n contextVisibleToScreenReader={false}\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n >\n <DataSfSpan\n encryptedFieldType={encryptedIdStr}\n data-info={dataInfo}\n className={classNames({\n 'adyen-checkout__input': true,\n 'adyen-checkout__input--large': true,\n 'adyen-checkout__input--error': errorMessage.length,\n 'adyen-checkout__input--focus': focused,\n 'adyen-checkout__input--valid': isValid\n })}\n />\n </Field>\n );\n};\n\nexport default AchSFInput;\n"],"names":["AchSFInput","id","dataInfo","className","label","focused","filled","errorMessage","isValid","onFocusField","dir","encryptedIdStr","capitalizeFirstLetter","h","Field","classNameModifiers","name","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","data-info","classNames","length"],"mappings":"odAOMA,MAAAA,EAAa,EAAGC,KAAIC,WAAUC,YAAY,GAAIC,QAAOC,UAASC,SAAQC,eAAe,GAAIC,WAAU,EAAOC,eAAcC,UAC1H,MACMC,EAAiB,YADDC,EAAsBX,KAG5C,OACIY,EAACC,EAAAA,CACGV,MAAOA,EACPC,QAASA,EACTC,OAAQA,EACRS,mBAAoB,CAACd,GACrBQ,aAAc,IAAMA,EAAaE,GACjCJ,aAAcA,EACdC,QAASA,EACTL,UAAWA,EACXO,IAAKA,EACLM,KAAMf,EACNgB,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,GAE1BP,EAACQ,EAAAA,CACGC,mBAAoBX,EACpBY,YAAWrB,EACXC,UAAWqB,EAAW,CAClB,yBAAyB,EACzB,gCAAgC,EAChC,+BAAgCjB,EAAakB,OAC7C,+BAAgCpB,EAChC,+BAAgCG"}
1
+ {"version":3,"file":"AchSFInput.js","sources":["../../../../../../../src/components/Ach/components/AchInput/components/AchSFInput.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport Field from '../../../../internal/FormFields/Field';\nimport DataSfSpan from '../../../../Card/components/CardInput/components/DataSfSpan';\nimport { alternativeLabelContent } from '../../../../Card/components/CardInput/components/FieldLabelAlternative';\nimport { capitalizeFirstLetter } from '../../../../../utils/textUtils';\n\nconst AchSFInput = ({ id, dataInfo, className = '', label, focused, filled, errorMessage = '', isValid = false, onFocusField, dir }) => {\n const capitalisedId = capitalizeFirstLetter(id);\n const encryptedIdStr = `encrypted${capitalisedId}`;\n\n return (\n <Field\n label={label}\n focused={focused}\n filled={filled}\n classNameModifiers={[id]}\n onFocusField={() => onFocusField(encryptedIdStr)}\n errorMessage={errorMessage}\n isValid={isValid}\n className={className}\n dir={dir}\n name={id}\n contextVisibleToScreenReader={false}\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n >\n <DataSfSpan\n encryptedFieldType={encryptedIdStr}\n data-info={dataInfo}\n className={classNames({\n 'adyen-checkout__input': true,\n 'adyen-checkout__input--large': true,\n 'adyen-checkout__input--error': errorMessage.length,\n 'adyen-checkout__input--focus': focused,\n 'adyen-checkout__input--valid': isValid\n })}\n />\n </Field>\n );\n};\n\nexport default AchSFInput;\n"],"names":["AchSFInput","id","dataInfo","className","label","focused","filled","errorMessage","isValid","onFocusField","dir","encryptedIdStr","capitalizeFirstLetter","h","Field","classNameModifiers","name","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","data-info","classNames","length"],"mappings":"mdAOMA,MAAAA,EAAa,EAAGC,KAAIC,WAAUC,YAAY,GAAIC,QAAOC,UAASC,SAAQC,eAAe,GAAIC,WAAU,EAAOC,eAAcC,UAC1H,MACMC,EAAiB,YADDC,EAAsBX,KAG5C,OACIY,EAACC,EAAAA,CACGV,MAAOA,EACPC,QAASA,EACTC,OAAQA,EACRS,mBAAoB,CAACd,GACrBQ,aAAc,IAAMA,EAAaE,GACjCJ,aAAcA,EACdC,QAASA,EACTL,UAAWA,EACXO,IAAKA,EACLM,KAAMf,EACNgB,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,GAE1BP,EAACQ,EAAAA,CACGC,mBAAoBX,EACpBY,YAAWrB,EACXC,UAAWqB,EAAW,CAClB,yBAAyB,EACzB,gCAAgC,EAChC,+BAAgCjB,EAAakB,OAC7C,+BAAgCpB,EAChC,+BAAgCG"}
@@ -1 +1 @@
1
- {"version":3,"file":"AmazonPayButton.js","sources":["../../../../../src/components/AmazonPay/components/AmazonPayButton.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useEffect, useState } from 'preact/hooks';\nimport { getAmazonSignature } from '../services';\nimport { getAmazonPaySettings, getPayloadJSON } from '../utils';\nimport { AmazonPayButtonProps, CheckoutSessionConfig, PayloadJSON } from '../types';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\n\nexport default function AmazonPayButton(props: AmazonPayButtonProps) {\n const { loadingContext } = useCoreContext();\n const { amazonRef, configuration = {} } = props;\n const [signature, setSignature] = useState<string>(null);\n const payloadJSON: PayloadJSON = getPayloadJSON(props);\n const settings = getAmazonPaySettings(props);\n\n const handleOnClick = () => {\n new Promise(props.onClick).then(this.initCheckout).catch(error => {\n if (props.onError) props.onError(error, this.componentRef);\n });\n };\n\n const renderAmazonPayButton = (): void => {\n const amazonPayButton = amazonRef.Pay.renderButton('#amazonPayButton', settings);\n amazonPayButton.onClick(handleOnClick);\n };\n\n this.initCheckout = () => {\n const checkoutSessionConfig: CheckoutSessionConfig = {\n payloadJSON: JSON.stringify(payloadJSON),\n publicKeyId: configuration.publicKeyId,\n signature\n };\n\n amazonRef.Pay.initCheckout({\n ...settings,\n createCheckoutSessionConfig: checkoutSessionConfig\n });\n };\n\n useEffect(() => {\n const { clientKey } = props;\n\n getAmazonSignature(loadingContext, clientKey, payloadJSON)\n .then(response => {\n if (!response?.signature) return console.error('Could not get AmazonPay signature');\n setSignature(response.signature);\n if (props.showPayButton) renderAmazonPayButton();\n })\n .catch(error => {\n console.error(error);\n if (props.onError) props.onError(error, this.componentRef);\n });\n }, []);\n\n if (!props.showPayButton) return null;\n return <div className=\"adyen-checkout__amazonpay__button\" id=\"amazonPayButton\" />;\n}\n"],"names":["AmazonPayButton","props","loadingContext","useCoreContext","amazonRef","configuration","signature","setSignature","useState","payloadJSON","getPayloadJSON","settings","getAmazonPaySettings","handleOnClick","Promise","onClick","then","this","initCheckout","catch","error","onError","componentRef","checkoutSessionConfig","JSON","stringify","publicKeyId","Pay","createCheckoutSessionConfig","useEffect","clientKey","getAmazonSignature","response","console","showPayButton","renderButton","renderAmazonPayButton","h","div","className","id"],"mappings":"iWAOe,SAASA,EAAgBC,GACpC,MAAMC,eAAEA,GAAmBC,KACrBC,UAAEA,EAASC,cAAEA,EAAgB,CAAE,GAAKJ,GACnCK,EAAWC,GAAgBC,EAAiB,MAC7CC,EAA2BC,EAAeT,GAC1CU,EAAWC,EAAqBX,GAEhCY,EAAgB,KAClB,IAAIC,QAAQb,EAAMc,SAASC,KAAKC,KAAKC,cAAcC,OAAMC,IACjDnB,EAAMoB,SAASpB,EAAMoB,QAAQD,EAAOH,KAAKK,aAAY,GAC7D,EAoCJ,OA5BAL,KAAKC,aAAe,KAChB,MAAMK,EAA+C,CACjDd,YAAae,KAAKC,UAAUhB,GAC5BiB,YAAarB,EAAcqB,YAC3BpB,aAGJF,EAAUuB,IAAIT,aAAa,IACpBP,EACHiB,4BAA6BL,GACjC,EAGJM,GAAU,KACN,MAAMC,UAAEA,GAAc7B,EAEtB8B,EAAmB7B,EAAgB4B,EAAWrB,GACzCO,MAAKgB,IACF,IAAKA,GAAU1B,UAAW,OAAO2B,QAAQb,MAAM,qCAC/Cb,EAAayB,EAAS1B,WAClBL,EAAMiC,eAxBM9B,EAAUuB,IAAIQ,aAAa,mBAAoBxB,GACvDI,QAAQF,EAuBSuB,IAE5BjB,OAAMC,IACHa,QAAQb,MAAMA,GACVnB,EAAMoB,SAASpB,EAAMoB,QAAQD,EAAOH,KAAKK,aAAY,GAC7D,GACL,IAEErB,EAAMiC,cACJG,EAACC,MAAAA,CAAIC,UAAU,oCAAoCC,GAAG,oBAD5B,IAErC"}
1
+ {"version":3,"file":"AmazonPayButton.js","sources":["../../../../../src/components/AmazonPay/components/AmazonPayButton.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useEffect, useState } from 'preact/hooks';\nimport { getAmazonSignature } from '../services';\nimport { getAmazonPaySettings, getPayloadJSON } from '../utils';\nimport { AmazonPayButtonProps, CheckoutSessionConfig, PayloadJSON } from '../types';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\n\nexport default function AmazonPayButton(props: AmazonPayButtonProps) {\n const { loadingContext } = useCoreContext();\n const { amazonRef, configuration = {} } = props;\n const [signature, setSignature] = useState<string>(null);\n const payloadJSON: PayloadJSON = getPayloadJSON(props);\n const settings = getAmazonPaySettings(props);\n\n const handleOnClick = () => {\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n new Promise(props.onClick).then(this.initCheckout).catch(error => {\n if (props.onError) props.onError(error, this.componentRef);\n });\n };\n\n const renderAmazonPayButton = (): void => {\n const amazonPayButton = amazonRef.Pay.renderButton('#amazonPayButton', settings);\n amazonPayButton.onClick(handleOnClick);\n };\n\n this.initCheckout = () => {\n const checkoutSessionConfig: CheckoutSessionConfig = {\n payloadJSON: JSON.stringify(payloadJSON),\n publicKeyId: configuration.publicKeyId,\n signature\n };\n\n amazonRef.Pay.initCheckout({\n ...settings,\n createCheckoutSessionConfig: checkoutSessionConfig\n });\n };\n\n useEffect(() => {\n const { clientKey } = props;\n\n getAmazonSignature(loadingContext, clientKey, payloadJSON)\n .then(response => {\n if (!response?.signature) return console.error('Could not get AmazonPay signature');\n setSignature(response.signature);\n if (props.showPayButton) renderAmazonPayButton();\n })\n .catch(error => {\n console.error(error);\n if (props.onError) props.onError(error, this.componentRef);\n });\n }, []);\n\n if (!props.showPayButton) return null;\n return <div className=\"adyen-checkout__amazonpay__button\" id=\"amazonPayButton\" />;\n}\n"],"names":["AmazonPayButton","props","loadingContext","useCoreContext","amazonRef","configuration","signature","setSignature","useState","payloadJSON","getPayloadJSON","settings","getAmazonPaySettings","handleOnClick","Promise","onClick","then","this","initCheckout","catch","error","onError","componentRef","checkoutSessionConfig","JSON","stringify","publicKeyId","Pay","createCheckoutSessionConfig","useEffect","clientKey","getAmazonSignature","response","console","showPayButton","renderButton","renderAmazonPayButton","h","div","className","id"],"mappings":"iWAOe,SAASA,EAAgBC,GACpC,MAAMC,eAAEA,GAAmBC,KACrBC,UAAEA,EAASC,cAAEA,EAAgB,CAAE,GAAKJ,GACnCK,EAAWC,GAAgBC,EAAiB,MAC7CC,EAA2BC,EAAeT,GAC1CU,EAAWC,EAAqBX,GAEhCY,EAAgB,KAElB,IAAIC,QAAQb,EAAMc,SAASC,KAAKC,KAAKC,cAAcC,OAAMC,IACjDnB,EAAMoB,SAASpB,EAAMoB,QAAQD,EAAOH,KAAKK,aAAY,GAC7D,EAoCJ,OA5BAL,KAAKC,aAAe,KAChB,MAAMK,EAA+C,CACjDd,YAAae,KAAKC,UAAUhB,GAC5BiB,YAAarB,EAAcqB,YAC3BpB,aAGJF,EAAUuB,IAAIT,aAAa,IACpBP,EACHiB,4BAA6BL,GACjC,EAGJM,GAAU,KACN,MAAMC,UAAEA,GAAc7B,EAEtB8B,EAAmB7B,EAAgB4B,EAAWrB,GACzCO,MAAKgB,IACF,IAAKA,GAAU1B,UAAW,OAAO2B,QAAQb,MAAM,qCAC/Cb,EAAayB,EAAS1B,WAClBL,EAAMiC,eAxBM9B,EAAUuB,IAAIQ,aAAa,mBAAoBxB,GACvDI,QAAQF,EAuBSuB,IAE5BjB,OAAMC,IACHa,QAAQb,MAAMA,GACVnB,EAAMoB,SAASpB,EAAMoB,QAAQD,EAAOH,KAAKK,aAAY,GAC7D,GACL,IAEErB,EAAMiC,cACJG,EAACC,MAAAA,CAAIC,UAAU,oCAAoCC,GAAG,oBAD5B,IAErC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AmazonPayComponent.js","sources":["../../../../../src/components/AmazonPay/components/AmazonPayComponent.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useState, useEffect, useRef } from 'preact/hooks';\nimport Spinner from '../../internal/Spinner';\nimport { getAmazonPayUrl } from '../utils';\nimport { AmazonPayComponentProps } from '../types';\nimport AmazonPayButton from './AmazonPayButton';\nimport ChangePaymentDetailsButton from './ChangePaymentDetailsButton';\nimport OrderButton from './OrderButton';\nimport SignOutButton from './SignOutButton';\nimport Script from '../../../utils/Script';\n\nexport default function AmazonPayComponent(props: AmazonPayComponentProps) {\n const [status, setStatus] = useState('pending');\n const amazonPayButtonRef = useRef(null);\n const orderButtonRef = useRef(null);\n\n const handleLoad = () => {\n setStatus('ready');\n };\n\n this.getSubmitFunction = () => {\n if (amazonPayButtonRef.current && amazonPayButtonRef.current.initCheckout) return () => amazonPayButtonRef.current.initCheckout();\n if (orderButtonRef.current && orderButtonRef.current.createOrder) return () => orderButtonRef.current.createOrder();\n };\n\n useEffect(() => {\n const src = getAmazonPayUrl(props.configuration.region);\n const script = new Script(src);\n if (window.amazon) {\n handleLoad();\n } else {\n script.load().then(handleLoad);\n }\n\n return () => {\n script.remove();\n };\n }, []);\n\n if (status === 'pending') {\n return (\n <div className=\"adyen-checkout__amazonpay\">\n <div className=\"adyen-checkout__amazonpay__status adyen-checkout__amazonpay__status--pending\">\n <Spinner />\n </div>\n </div>\n );\n }\n\n if (props.showSignOutButton) {\n return (\n <div className=\"adyen-checkout__amazonpay\">\n <SignOutButton amazonRef={window.amazon} onSignOut={props.onSignOut} />\n </div>\n );\n }\n\n if (props.amazonCheckoutSessionId) {\n return (\n <div className=\"adyen-checkout__amazonpay\">\n {props.showOrderButton && (\n <OrderButton\n amazonCheckoutSessionId={props.amazonCheckoutSessionId}\n amount={props.amount}\n chargePermissionType={props.chargePermissionType}\n recurringMetadata={props.recurringMetadata}\n clientKey={props.clientKey}\n onError={props.onError}\n publicKeyId={props.configuration?.publicKeyId}\n region={props.configuration?.region}\n returnUrl={props.returnUrl}\n ref={orderButtonRef}\n />\n )}\n\n {props.showChangePaymentDetailsButton && (\n <ChangePaymentDetailsButton amazonCheckoutSessionId={props.amazonCheckoutSessionId} amazonRef={window.amazon} />\n )}\n </div>\n );\n }\n\n return (\n <div className=\"adyen-checkout__amazonpay\">\n <AmazonPayButton {...props} showPayButton={this.props.showPayButton} amazonRef={window.amazon} ref={amazonPayButtonRef} />\n </div>\n );\n}\n"],"names":["AmazonPayComponent","props","status","setStatus","useState","amazonPayButtonRef","useRef","orderButtonRef","handleLoad","this","getSubmitFunction","current","initCheckout","createOrder","useEffect","src","getAmazonPayUrl","configuration","region","script","Script","window","amazon","load","then","remove","h","div","className","Spinner","showSignOutButton","SignOutButton","amazonRef","onSignOut","amazonCheckoutSessionId","showOrderButton","OrderButton","amount","chargePermissionType","recurringMetadata","clientKey","onError","publicKeyId","returnUrl","ref","showChangePaymentDetailsButton","ChangePaymentDetailsButton","AmazonPayButton","showPayButton"],"mappings":"ucAWe,SAASA,EAAmBC,GACvC,MAAOC,EAAQC,GAAaC,EAAS,WAC/BC,EAAqBC,EAAO,MAC5BC,EAAiBD,EAAO,MAExBE,EAAa,KACfL,EAAU,QAAA,EAsBd,OAnBAM,KAAKC,kBAAoB,IACjBL,EAAmBM,SAAWN,EAAmBM,QAAQC,aAAqB,IAAMP,EAAmBM,QAAQC,eAC/GL,EAAeI,SAAWJ,EAAeI,QAAQE,YAAoB,IAAMN,EAAeI,QAAQE,mBAAtG,EAGJC,GAAU,KACN,MAAMC,EAAMC,EAAgBf,EAAMgB,cAAcC,QAC1CC,EAAS,IAAIC,EAAOL,GAO1B,OANIM,OAAOC,OACPd,IAEAW,EAAOI,OAAOC,KAAKhB,GAGhB,KACHW,EAAOM,QAAM,CACjB,GACD,IAEY,YAAXvB,EAEIwB,EAACC,MAAAA,CAAIC,UAAU,6BACXF,EAACC,MAAAA,CAAIC,UAAU,gFACXF,EAACG,EAAAA,QAMb5B,EAAM6B,kBAEFJ,EAACC,MAAAA,CAAIC,UAAU,6BACXF,EAACK,EAAAA,CAAcC,UAAWX,OAAOC,OAAQW,UAAWhC,EAAMgC,aAKlEhC,EAAMiC,wBAEFR,EAACC,MAAAA,CAAIC,UAAU,6BACV3B,EAAMkC,iBACHT,EAACU,EAAAA,CACGF,wBAAyBjC,EAAMiC,wBAC/BG,OAAQpC,EAAMoC,OACdC,qBAAsBrC,EAAMqC,qBAC5BC,kBAAmBtC,EAAMsC,kBACzBC,UAAWvC,EAAMuC,UACjBC,QAASxC,EAAMwC,QACfC,YAAazC,EAAMgB,eAAeyB,YAClCxB,OAAQjB,EAAMgB,eAAeC,OAC7ByB,UAAW1C,EAAM0C,UACjBC,IAAKrC,IAIZN,EAAM4C,gCACHnB,EAACoB,EAAAA,CAA2BZ,wBAAyBjC,EAAMiC,wBAAyBF,UAAWX,OAAOC,UAOlHI,EAACC,MAAAA,CAAIC,UAAU,6BACXF,EAACqB,EAAAA,IAAoB9C,EAAO+C,cAAevC,KAAKR,MAAM+C,cAAehB,UAAWX,OAAOC,OAAQsB,IAAKvC,IAGhH"}
1
+ {"version":3,"file":"AmazonPayComponent.js","sources":["../../../../../src/components/AmazonPay/components/AmazonPayComponent.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useState, useEffect, useRef } from 'preact/hooks';\nimport Spinner from '../../internal/Spinner';\nimport { getAmazonPayUrl } from '../utils';\nimport { AmazonPayComponentProps } from '../types';\nimport AmazonPayButton from './AmazonPayButton';\nimport ChangePaymentDetailsButton from './ChangePaymentDetailsButton';\nimport OrderButton from './OrderButton';\nimport SignOutButton from './SignOutButton';\nimport Script from '../../../utils/Script';\n\nexport default function AmazonPayComponent(props: AmazonPayComponentProps) {\n const [status, setStatus] = useState('pending');\n const amazonPayButtonRef = useRef(null);\n const orderButtonRef = useRef(null);\n\n const handleLoad = () => {\n setStatus('ready');\n };\n\n this.getSubmitFunction = () => {\n if (amazonPayButtonRef.current && amazonPayButtonRef.current.initCheckout) return () => amazonPayButtonRef.current.initCheckout();\n if (orderButtonRef.current && orderButtonRef.current.createOrder) return () => orderButtonRef.current.createOrder();\n };\n\n useEffect(() => {\n const src = getAmazonPayUrl(props.configuration.region);\n const script = new Script(src);\n if (window.amazon) {\n handleLoad();\n } else {\n void script.load().then(handleLoad);\n }\n\n return () => {\n script.remove();\n };\n }, []);\n\n if (status === 'pending') {\n return (\n <div className=\"adyen-checkout__amazonpay\">\n <div className=\"adyen-checkout__amazonpay__status adyen-checkout__amazonpay__status--pending\">\n <Spinner />\n </div>\n </div>\n );\n }\n\n if (props.showSignOutButton) {\n return (\n <div className=\"adyen-checkout__amazonpay\">\n <SignOutButton amazonRef={window.amazon} onSignOut={props.onSignOut} />\n </div>\n );\n }\n\n if (props.amazonCheckoutSessionId) {\n return (\n <div className=\"adyen-checkout__amazonpay\">\n {props.showOrderButton && (\n <OrderButton\n amazonCheckoutSessionId={props.amazonCheckoutSessionId}\n amount={props.amount}\n chargePermissionType={props.chargePermissionType}\n recurringMetadata={props.recurringMetadata}\n clientKey={props.clientKey}\n onError={props.onError}\n publicKeyId={props.configuration?.publicKeyId}\n region={props.configuration?.region}\n returnUrl={props.returnUrl}\n ref={orderButtonRef}\n />\n )}\n\n {props.showChangePaymentDetailsButton && (\n <ChangePaymentDetailsButton amazonCheckoutSessionId={props.amazonCheckoutSessionId} amazonRef={window.amazon} />\n )}\n </div>\n );\n }\n\n return (\n <div className=\"adyen-checkout__amazonpay\">\n <AmazonPayButton {...props} showPayButton={this.props.showPayButton} amazonRef={window.amazon} ref={amazonPayButtonRef} />\n </div>\n );\n}\n"],"names":["AmazonPayComponent","props","status","setStatus","useState","amazonPayButtonRef","useRef","orderButtonRef","handleLoad","this","getSubmitFunction","current","initCheckout","createOrder","useEffect","src","getAmazonPayUrl","configuration","region","script","Script","window","amazon","load","then","remove","h","div","className","Spinner","showSignOutButton","SignOutButton","amazonRef","onSignOut","amazonCheckoutSessionId","showOrderButton","OrderButton","amount","chargePermissionType","recurringMetadata","clientKey","onError","publicKeyId","returnUrl","ref","showChangePaymentDetailsButton","ChangePaymentDetailsButton","AmazonPayButton","showPayButton"],"mappings":"ucAWe,SAASA,EAAmBC,GACvC,MAAOC,EAAQC,GAAaC,EAAS,WAC/BC,EAAqBC,EAAO,MAC5BC,EAAiBD,EAAO,MAExBE,EAAa,KACfL,EAAU,QAAA,EAsBd,OAnBAM,KAAKC,kBAAoB,IACjBL,EAAmBM,SAAWN,EAAmBM,QAAQC,aAAqB,IAAMP,EAAmBM,QAAQC,eAC/GL,EAAeI,SAAWJ,EAAeI,QAAQE,YAAoB,IAAMN,EAAeI,QAAQE,mBAAtG,EAGJC,GAAU,KACN,MAAMC,EAAMC,EAAgBf,EAAMgB,cAAcC,QAC1CC,EAAS,IAAIC,EAAOL,GAO1B,OANIM,OAAOC,OACPd,IAEKW,EAAOI,OAAOC,KAAKhB,GAGrB,KACHW,EAAOM,QAAM,CACjB,GACD,IAEY,YAAXvB,EAEIwB,EAACC,MAAAA,CAAIC,UAAU,6BACXF,EAACC,MAAAA,CAAIC,UAAU,gFACXF,EAACG,EAAAA,QAMb5B,EAAM6B,kBAEFJ,EAACC,MAAAA,CAAIC,UAAU,6BACXF,EAACK,EAAAA,CAAcC,UAAWX,OAAOC,OAAQW,UAAWhC,EAAMgC,aAKlEhC,EAAMiC,wBAEFR,EAACC,MAAAA,CAAIC,UAAU,6BACV3B,EAAMkC,iBACHT,EAACU,EAAAA,CACGF,wBAAyBjC,EAAMiC,wBAC/BG,OAAQpC,EAAMoC,OACdC,qBAAsBrC,EAAMqC,qBAC5BC,kBAAmBtC,EAAMsC,kBACzBC,UAAWvC,EAAMuC,UACjBC,QAASxC,EAAMwC,QACfC,YAAazC,EAAMgB,eAAeyB,YAClCxB,OAAQjB,EAAMgB,eAAeC,OAC7ByB,UAAW1C,EAAM0C,UACjBC,IAAKrC,IAIZN,EAAM4C,gCACHnB,EAACoB,EAAAA,CAA2BZ,wBAAyBjC,EAAMiC,wBAAyBF,UAAWX,OAAOC,UAOlHI,EAACC,MAAAA,CAAIC,UAAU,6BACXF,EAACqB,EAAAA,IAAoB9C,EAAO+C,cAAevC,KAAKR,MAAM+C,cAAehB,UAAWX,OAAOC,OAAQsB,IAAKvC,IAGhH"}
@@ -1 +1 @@
1
- {"version":3,"file":"SignOutButton.js","sources":["../../../../../src/components/AmazonPay/components/SignOutButton.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport { SignOutButtonProps } from '../types';\n\nexport default function SignOutButton(props: SignOutButtonProps) {\n const { i18n } = useCoreContext();\n\n const handleClick = () => {\n new Promise(props.onSignOut)\n .then(() => {\n props.amazonRef.Pay.signout();\n })\n .catch(console.error);\n };\n\n return (\n <button\n type=\"button\"\n className=\"adyen-checkout__button adyen-checkout__button--ghost adyen-checkout__amazonpay__button--signOut\"\n onClick={handleClick}\n >\n {i18n.get('amazonpay.signout')}\n </button>\n );\n}\n"],"names":["SignOutButton","props","i18n","useCoreContext","h","button","type","className","onClick","Promise","onSignOut","then","amazonRef","Pay","signout","catch","console","error","get"],"mappings":"+IAIe,SAASA,EAAcC,GAClC,MAAMC,KAAEA,GAASC,IAUjB,OACIC,EAACC,SAAAA,CACGC,KAAK,SACLC,UAAU,mGACVC,QAZY,KAChB,IAAIC,QAAQR,EAAMS,WACbC,MAAK,KACFV,EAAMW,UAAUC,IAAIC,SAAO,IAE9BC,MAAMC,QAAQC,MAAK,GASnBf,EAAKgB,IAAI,qBAGtB"}
1
+ {"version":3,"file":"SignOutButton.js","sources":["../../../../../src/components/AmazonPay/components/SignOutButton.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport { SignOutButtonProps } from '../types';\n\nexport default function SignOutButton(props: SignOutButtonProps) {\n const { i18n } = useCoreContext();\n\n const handleClick = () => {\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n new Promise(props.onSignOut)\n .then(() => {\n props.amazonRef.Pay.signout();\n })\n .catch(console.error);\n };\n\n return (\n <button\n type=\"button\"\n className=\"adyen-checkout__button adyen-checkout__button--ghost adyen-checkout__amazonpay__button--signOut\"\n onClick={handleClick}\n >\n {i18n.get('amazonpay.signout')}\n </button>\n );\n}\n"],"names":["SignOutButton","props","i18n","useCoreContext","h","button","type","className","onClick","Promise","onSignOut","then","amazonRef","Pay","signout","catch","console","error","get"],"mappings":"+IAIe,SAASA,EAAcC,GAClC,MAAMC,KAAEA,GAASC,IAWjB,OACIC,EAACC,SAAAA,CACGC,KAAK,SACLC,UAAU,mGACVC,QAbY,KAEhB,IAAIC,QAAQR,EAAMS,WACbC,MAAK,KACFV,EAAMW,UAAUC,IAAIC,SAAO,IAE9BC,MAAMC,QAAQC,MAAK,GASnBf,EAAKgB,IAAI,qBAGtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"ApplePayService.js","sources":["../../../../src/components/ApplePay/ApplePayService.ts"],"sourcesContent":["import { ApplePayPaymentAuthorizationResult } from './types';\n\ninterface ApplePayServiceOptions {\n version: number;\n onValidateMerchant: (resolve, reject, url) => void;\n onError: (error?: unknown) => void;\n onCancel?: (event: ApplePayJS.Event) => void;\n onPaymentMethodSelected?: (resolve, reject, event: ApplePayJS.ApplePayPaymentMethodSelectedEvent) => void;\n onShippingMethodSelected?: (resolve, reject, event: ApplePayJS.ApplePayShippingMethodSelectedEvent) => void;\n onShippingContactSelected?: (resolve, reject, event: ApplePayJS.ApplePayShippingContactSelectedEvent) => void;\n onPaymentAuthorized: (\n resolve: (result: ApplePayPaymentAuthorizationResult) => void,\n reject: (result: ApplePayPaymentAuthorizationResult) => void,\n event: ApplePayJS.ApplePayPaymentAuthorizedEvent\n ) => void;\n}\n\nclass ApplePayService {\n private session: ApplePaySession;\n private readonly options: ApplePayServiceOptions;\n\n constructor(paymentRequest: ApplePayJS.ApplePayPaymentRequest, options: ApplePayServiceOptions) {\n this.options = options;\n\n this.session = new ApplePaySession(options.version, paymentRequest);\n this.session.onvalidatemerchant = event => this.onvalidatemerchant(event, options.onValidateMerchant);\n this.session.onpaymentauthorized = event => this.onpaymentauthorized(event, options.onPaymentAuthorized);\n this.session.oncancel = event => this.oncancel(event, options.onCancel);\n\n if (typeof options.onPaymentMethodSelected === 'function') {\n this.session.onpaymentmethodselected = event => this.onpaymentmethodselected(event, options.onPaymentMethodSelected);\n }\n\n if (typeof options.onShippingContactSelected === 'function') {\n this.session.onshippingcontactselected = event => this.onshippingcontactselected(event, options.onShippingContactSelected);\n }\n\n if (typeof options.onShippingMethodSelected === 'function') {\n this.session.onshippingmethodselected = event => this.onshippingmethodselected(event, options.onShippingMethodSelected);\n }\n }\n\n /**\n * Begins the merchant validation process.\n * When this method is called, the payment sheet is presented and the merchant validation process is initiated.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778001-begin}\n */\n begin() {\n return this.session.begin();\n }\n\n /**\n * An event handler that is called when the payment sheet is displayed.\n * Use this attribute to request and return a merchant session.\n * @param event - An ApplePayValidateMerchantEvent object (contains validationURL)\n * @param onValidateMerchant - A promise implemented by the merchant that will resolve with the merchantSession\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_js_api/providing_merchant_validation}\n */\n onvalidatemerchant(event: ApplePayJS.ApplePayValidateMerchantEvent, onValidateMerchant) {\n return new Promise((resolve, reject) => onValidateMerchant(resolve, reject, event.validationURL))\n .then(response => {\n this.session.completeMerchantValidation(response);\n })\n .catch(error => {\n console.error(error);\n this.session.abort();\n this.options.onError(error);\n });\n }\n\n /**\n * An event handler that is called when the user has authorized the Apple Pay payment with Touch ID, Face ID, or passcode.\n * The onpaymentauthorized function must complete the payment and respond by calling completePayment before the 30 second timeout.\n *\n * @param event - The event parameter contains the payment (ApplePayPayment) attribute.\n * @param onPaymentAuthorized - A promise that will complete the payment when resolved. Use this promise to process the payment.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778020-onpaymentauthorized}\n */\n onpaymentauthorized(\n event: ApplePayJS.ApplePayPaymentAuthorizedEvent,\n onPaymentAuthorized: ApplePayServiceOptions['onPaymentAuthorized']\n ): Promise<void> {\n return new Promise((resolve, reject) => onPaymentAuthorized(resolve, reject, event))\n .then((result: ApplePayPaymentAuthorizationResult) => {\n this.session.completePayment(result);\n })\n .catch((result: ApplePayPaymentAuthorizationResult) => {\n this.session.completePayment(result);\n });\n }\n\n /**\n * An event handler that is called when a new payment method is selected.\n * The onpaymentmethodselected function must resolve before the 30 second timeout\n *\n * @param event - The event parameter contains the payment (ApplePayPayment) attribute.\n * @param onPaymentMethodSelected - A promise that will complete the payment when resolved. Use this promise to process the payment.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778013-onpaymentmethodselected}\n */\n onpaymentmethodselected(event: ApplePayJS.ApplePayPaymentMethodSelectedEvent, onPaymentMethodSelected) {\n return new Promise((resolve, reject) => onPaymentMethodSelected(resolve, reject, event))\n .then((paymentMethodUpdate: ApplePayJS.ApplePayPaymentMethodUpdate) => {\n this.session.completePaymentMethodSelection(paymentMethodUpdate);\n })\n .catch((paymentMethodUpdate: ApplePayJS.ApplePayPaymentMethodUpdate) => {\n this.session.completePaymentMethodSelection(paymentMethodUpdate);\n });\n }\n\n /**\n * An event handler that is called when a new payment method is selected.\n * The onpaymentmethodselected function must resolve before the 30 second timeout\n * @param event - The event parameter contains the shippingContact attribute.\n * @param onShippingContactSelected - A promise that will complete the selection of a shipping contact with an update.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778009-onshippingcontactselected}\n */\n onshippingcontactselected(event: ApplePayJS.ApplePayShippingContactSelectedEvent, onShippingContactSelected) {\n return new Promise((resolve, reject) => onShippingContactSelected(resolve, reject, event))\n .then((shippingContactUpdate: ApplePayJS.ApplePayShippingContactUpdate) => {\n this.session.completeShippingContactSelection(shippingContactUpdate);\n })\n .catch((shippingContactUpdate: ApplePayJS.ApplePayShippingContactUpdate) => {\n this.session.completeShippingContactSelection(shippingContactUpdate);\n });\n }\n\n /**\n * An event handler that is called when a new payment method is selected.\n * The onpaymentmethodselected function must resolve before the 30 second timeout\n * @param event - The event parameter contains the shippingMethod attribute.\n * @param onShippingMethodSelected - A promise that will complete the selection of a shipping method with an update.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778009-onshippingcontactselected}\n */\n onshippingmethodselected(event: ApplePayJS.ApplePayShippingMethodSelectedEvent, onShippingMethodSelected) {\n return new Promise((resolve, reject) => onShippingMethodSelected(resolve, reject, event))\n .then((shippingMethodUpdate: ApplePayJS.ApplePayShippingMethodUpdate) => {\n this.session.completeShippingMethodSelection(shippingMethodUpdate);\n })\n .catch((shippingMethodUpdate: ApplePayJS.ApplePayShippingMethodUpdate) => {\n this.session.completeShippingMethodSelection(shippingMethodUpdate);\n });\n }\n\n /**\n * An event handler that is automatically called when the payment UI is dismissed.\n * This function can be called even after an onpaymentauthorized event has been dispatched.\n * @param event -\n * @param onCancel -\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778029-oncancel}\n */\n oncancel(event: ApplePayJS.Event, onCancel): void {\n onCancel(event);\n }\n}\n\nexport default ApplePayService;\n"],"names":["ApplePayService","session","options","constructor","paymentRequest","this","ApplePaySession","version","onvalidatemerchant","event","onValidateMerchant","onpaymentauthorized","onPaymentAuthorized","oncancel","onCancel","onPaymentMethodSelected","onpaymentmethodselected","onShippingContactSelected","onshippingcontactselected","onShippingMethodSelected","onshippingmethodselected","begin","Promise","resolve","reject","validationURL","then","response","completeMerchantValidation","catch","error","console","abort","onError","result","completePayment","paymentMethodUpdate","completePaymentMethodSelection","shippingContactUpdate","completeShippingContactSelection","shippingMethodUpdate","completeShippingMethodSelection"],"mappings":"AAiBA,MAAMA,EACMC,QACSC,QAE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C,IAAWT,EAAwBQ,EAASC,EAAQf,KAC5EiB,MAAMU,IACH/B,KAAKJ,QAAQoC,+BAA+BD,EAAAA,IAE/CP,OAAOO,IACJ/B,KAAKJ,QAAQoC,+BAA+BD,EAAAA,GAExD,CASAlB,yBAAAA,CAA0BT,EAAwDQ,GAC9E,OAAO,IAAIK,SAAQ,CAACC,EAASC,IAAWP,EAA0BM,EAASC,EAAQf,KAC9EiB,MAAMY,IACHjC,KAAKJ,QAAQsC,iCAAiCD,EAAAA,IAEjDT,OAAOS,IACJjC,KAAKJ,QAAQsC,iCAAiCD,EAAAA,GAE1D,CASAlB,wBAAAA,CAAyBX,EAAuDU,GAC5E,OAAO,IAAIG,SAAQ,CAACC,EAASC,IAAWL,EAAyBI,EAASC,EAAQf,KAC7EiB,MAAMc,IACHnC,KAAKJ,QAAQwC,gCAAgCD,EAAAA,IAEhDX,OAAOW,IACJnC,KAAKJ,QAAQwC,gCAAgCD,EAAAA,GAEzD,CASA3B,QAAAA,CAASJ,EAAyBK,GAC9BA,EAASL,EACb"}
1
+ {"version":3,"file":"ApplePayService.js","sources":["../../../../src/components/ApplePay/ApplePayService.ts"],"sourcesContent":["import { ApplePayPaymentAuthorizationResult } from './types';\n\ninterface ApplePayServiceOptions {\n version: number;\n onValidateMerchant: (resolve, reject, url) => void;\n onError: (error?: unknown) => void;\n onCancel?: (event: ApplePayJS.Event) => void;\n onPaymentMethodSelected?: (resolve, reject, event: ApplePayJS.ApplePayPaymentMethodSelectedEvent) => void;\n onShippingMethodSelected?: (resolve, reject, event: ApplePayJS.ApplePayShippingMethodSelectedEvent) => void;\n onShippingContactSelected?: (resolve, reject, event: ApplePayJS.ApplePayShippingContactSelectedEvent) => void;\n onPaymentAuthorized: (\n resolve: (result: ApplePayPaymentAuthorizationResult) => void,\n reject: (result: ApplePayPaymentAuthorizationResult) => void,\n event: ApplePayJS.ApplePayPaymentAuthorizedEvent\n ) => void;\n}\n\nclass ApplePayService {\n private session: ApplePaySession;\n private readonly options: ApplePayServiceOptions;\n\n constructor(paymentRequest: ApplePayJS.ApplePayPaymentRequest, options: ApplePayServiceOptions) {\n this.options = options;\n\n this.session = new ApplePaySession(options.version, paymentRequest);\n /* eslint-disable @typescript-eslint/no-misused-promises */\n this.session.onvalidatemerchant = event => this.onvalidatemerchant(event, options.onValidateMerchant);\n this.session.onpaymentauthorized = event => this.onpaymentauthorized(event, options.onPaymentAuthorized);\n this.session.oncancel = event => this.oncancel(event, options.onCancel);\n\n if (typeof options.onPaymentMethodSelected === 'function') {\n this.session.onpaymentmethodselected = event => this.onpaymentmethodselected(event, options.onPaymentMethodSelected);\n }\n\n if (typeof options.onShippingContactSelected === 'function') {\n this.session.onshippingcontactselected = event => this.onshippingcontactselected(event, options.onShippingContactSelected);\n }\n\n if (typeof options.onShippingMethodSelected === 'function') {\n this.session.onshippingmethodselected = event => this.onshippingmethodselected(event, options.onShippingMethodSelected);\n }\n /* eslint-enable @typescript-eslint/no-misused-promises */\n }\n\n /**\n * Begins the merchant validation process.\n * When this method is called, the payment sheet is presented and the merchant validation process is initiated.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778001-begin}\n */\n begin() {\n return this.session.begin();\n }\n\n /**\n * An event handler that is called when the payment sheet is displayed.\n * Use this attribute to request and return a merchant session.\n * @param event - An ApplePayValidateMerchantEvent object (contains validationURL)\n * @param onValidateMerchant - A promise implemented by the merchant that will resolve with the merchantSession\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_js_api/providing_merchant_validation}\n */\n onvalidatemerchant(event: ApplePayJS.ApplePayValidateMerchantEvent, onValidateMerchant) {\n return new Promise((resolve, reject) => onValidateMerchant(resolve, reject, event.validationURL))\n .then(response => {\n this.session.completeMerchantValidation(response);\n })\n .catch(error => {\n console.error(error);\n this.session.abort();\n this.options.onError(error);\n });\n }\n\n /**\n * An event handler that is called when the user has authorized the Apple Pay payment with Touch ID, Face ID, or passcode.\n * The onpaymentauthorized function must complete the payment and respond by calling completePayment before the 30 second timeout.\n *\n * @param event - The event parameter contains the payment (ApplePayPayment) attribute.\n * @param onPaymentAuthorized - A promise that will complete the payment when resolved. Use this promise to process the payment.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778020-onpaymentauthorized}\n */\n onpaymentauthorized(\n event: ApplePayJS.ApplePayPaymentAuthorizedEvent,\n onPaymentAuthorized: ApplePayServiceOptions['onPaymentAuthorized']\n ): Promise<void> {\n return new Promise((resolve, reject) => onPaymentAuthorized(resolve, reject, event))\n .then((result: ApplePayPaymentAuthorizationResult) => {\n this.session.completePayment(result);\n })\n .catch((result: ApplePayPaymentAuthorizationResult) => {\n this.session.completePayment(result);\n });\n }\n\n /**\n * An event handler that is called when a new payment method is selected.\n * The onpaymentmethodselected function must resolve before the 30 second timeout\n *\n * @param event - The event parameter contains the payment (ApplePayPayment) attribute.\n * @param onPaymentMethodSelected - A promise that will complete the payment when resolved. Use this promise to process the payment.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778013-onpaymentmethodselected}\n */\n onpaymentmethodselected(event: ApplePayJS.ApplePayPaymentMethodSelectedEvent, onPaymentMethodSelected) {\n return new Promise((resolve, reject) => onPaymentMethodSelected(resolve, reject, event))\n .then((paymentMethodUpdate: ApplePayJS.ApplePayPaymentMethodUpdate) => {\n this.session.completePaymentMethodSelection(paymentMethodUpdate);\n })\n .catch((paymentMethodUpdate: ApplePayJS.ApplePayPaymentMethodUpdate) => {\n this.session.completePaymentMethodSelection(paymentMethodUpdate);\n });\n }\n\n /**\n * An event handler that is called when a new payment method is selected.\n * The onpaymentmethodselected function must resolve before the 30 second timeout\n * @param event - The event parameter contains the shippingContact attribute.\n * @param onShippingContactSelected - A promise that will complete the selection of a shipping contact with an update.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778009-onshippingcontactselected}\n */\n onshippingcontactselected(event: ApplePayJS.ApplePayShippingContactSelectedEvent, onShippingContactSelected) {\n return new Promise((resolve, reject) => onShippingContactSelected(resolve, reject, event))\n .then((shippingContactUpdate: ApplePayJS.ApplePayShippingContactUpdate) => {\n this.session.completeShippingContactSelection(shippingContactUpdate);\n })\n .catch((shippingContactUpdate: ApplePayJS.ApplePayShippingContactUpdate) => {\n this.session.completeShippingContactSelection(shippingContactUpdate);\n });\n }\n\n /**\n * An event handler that is called when a new payment method is selected.\n * The onpaymentmethodselected function must resolve before the 30 second timeout\n * @param event - The event parameter contains the shippingMethod attribute.\n * @param onShippingMethodSelected - A promise that will complete the selection of a shipping method with an update.\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778009-onshippingcontactselected}\n */\n onshippingmethodselected(event: ApplePayJS.ApplePayShippingMethodSelectedEvent, onShippingMethodSelected) {\n return new Promise((resolve, reject) => onShippingMethodSelected(resolve, reject, event))\n .then((shippingMethodUpdate: ApplePayJS.ApplePayShippingMethodUpdate) => {\n this.session.completeShippingMethodSelection(shippingMethodUpdate);\n })\n .catch((shippingMethodUpdate: ApplePayJS.ApplePayShippingMethodUpdate) => {\n this.session.completeShippingMethodSelection(shippingMethodUpdate);\n });\n }\n\n /**\n * An event handler that is automatically called when the payment UI is dismissed.\n * This function can be called even after an onpaymentauthorized event has been dispatched.\n * @param event -\n * @param onCancel -\n * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778029-oncancel}\n */\n oncancel(event: ApplePayJS.Event, onCancel): void {\n onCancel(event);\n }\n}\n\nexport default ApplePayService;\n"],"names":["ApplePayService","session","options","constructor","paymentRequest","this","ApplePaySession","version","onvalidatemerchant","event","onValidateMerchant","onpaymentauthorized","onPaymentAuthorized","oncancel","onCancel","onPaymentMethodSelected","onpaymentmethodselected","onShippingContactSelected","onshippingcontactselected","onShippingMethodSelected","onshippingmethodselected","begin","Promise","resolve","reject","validationURL","then","response","completeMerchantValidation","catch","error","console","abort","onError","result","completePayment","paymentMethodUpdate","completePaymentMethodSelection","shippingContactUpdate","complete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GAEzC,CAUAlB,uBAAAA,CAAwBP,EAAsDM,GAC1E,OAAO,IAAIO,SAAQ,CAACC,EAASC,IAAWT,EAAwBQ,EAASC,EAAQf,KAC5EiB,MAAMU,IACH/B,KAAKJ,QAAQoC,+BAA+BD,EAAAA,IAE/CP,OAAOO,IACJ/B,KAAKJ,QAAQoC,+BAA+BD,EAAAA,GAExD,CASAlB,yBAAAA,CAA0BT,EAAwDQ,GAC9E,OAAO,IAAIK,SAAQ,CAACC,EAASC,IAAWP,EAA0BM,EAASC,EAAQf,KAC9EiB,MAAMY,IACHjC,KAAKJ,QAAQsC,iCAAiCD,EAAAA,IAEjDT,OAAOS,IACJjC,KAAKJ,QAAQsC,iCAAiCD,EAAAA,GAE1D,CASAlB,wBAAAA,CAAyBX,EAAuDU,GAC5E,OAAO,IAAIG,SAAQ,CAACC,EAASC,IAAWL,EAAyBI,EAASC,EAAQf,KAC7EiB,MAAMc,IACHnC,KAAKJ,QAAQwC,gCAAgCD,EAAAA,IAEhDX,OAAOW,IACJnC,KAAKJ,QAAQwC,gCAAgCD,EAAAA,GAEzD,CASA3B,QAAAA,CAASJ,EAAyBK,GAC9BA,EAASL,EACb"}
@@ -1 +1 @@
1
- {"version":3,"file":"ApplePayButton.js","sources":["../../../../../src/components/ApplePay/components/ApplePayButton.tsx"],"sourcesContent":["import { Component, h } from 'preact';\nimport cx from 'classnames';\nimport './ApplePayButton.scss';\nimport Language from '../../../language/Language';\nimport { ApplePayButtonType } from '../types';\n\ninterface ApplePayButtonProps {\n i18n: Language;\n buttonColor: 'black' | 'white' | 'white-with-line';\n buttonType: ApplePayButtonType;\n onClick: (event) => void;\n}\n\nclass ApplePayButton extends Component<ApplePayButtonProps> {\n public static defaultProps = {\n onClick: () => {},\n buttonColor: 'black',\n buttonType: 'plain'\n };\n\n render({ buttonColor, buttonType }) {\n /* eslint-disable jsx-a11y/no-static-element-interactions */\n return (\n <button\n type=\"button\"\n aria-label={this.props.i18n.get('payButton')}\n lang={this.props.i18n.languageCode}\n className={cx(\n 'adyen-checkout__applepay__button',\n `adyen-checkout__applepay__button--${buttonColor}`,\n `adyen-checkout__applepay__button--${buttonType}`,\n 'apple-pay',\n 'apple-pay-button',\n `apple-pay-button-${buttonColor}`,\n `apple-pay-button--type-${buttonType}`\n )}\n onClick={this.props.onClick}\n />\n );\n /* eslint-enable jsx-a11y/no-static-element-interactions */\n }\n}\n\nexport default ApplePayButton;\n"],"names":["ApplePayButton","Component","static","onClick","buttonColor","buttonType","render","h","button","type","aria-label","this","props","i18n","get","lang","languageCode","className","cx"],"mappings":"4IAaA,MAAMA,UAAuBC,EACzBC,oBAA6B,CACzBC,QAAS,OACTC,YAAa,QACbC,WAAY,SAGhBC,MAAAA,EAAOF,YAAEA,EAAWC,WAAEA,IAElB,OACIE,EAACC,SAAAA,CACGC,KAAK,SACLC,aAAYC,KAAKC,MAAMC,KAAKC,IAAI,aAChCC,KAAMJ,KAAKC,MAAMC,KAAKG,aACtBC,UAAWC,EACP,mCACA,qCAAqCd,IACrC,qCAAqCC,IACrC,YACA,mBACA,oBAAoBD,IACpB,0BAA0BC,KAE9BF,QAASQ,KAAKC,MAAMT,SAIhC"}
1
+ {"version":3,"file":"ApplePayButton.js","sources":["../../../../../src/components/ApplePay/components/ApplePayButton.tsx"],"sourcesContent":["import { Component, h } from 'preact';\nimport cx from 'classnames';\nimport './ApplePayButton.scss';\nimport Language from '../../../language/Language';\nimport { ApplePayButtonType } from '../types';\n\ninterface ApplePayButtonProps {\n i18n: Language;\n buttonColor: 'black' | 'white' | 'white-with-line';\n buttonType: ApplePayButtonType;\n onClick: (event) => void;\n}\n\nclass ApplePayButton extends Component<ApplePayButtonProps> {\n public static defaultProps = {\n onClick: () => {},\n buttonColor: 'black',\n buttonType: 'plain'\n };\n\n render({ buttonColor, buttonType }) {\n return (\n <button\n type=\"button\"\n aria-label={this.props.i18n.get('payButton')}\n lang={this.props.i18n.languageCode}\n className={cx(\n 'adyen-checkout__applepay__button',\n `adyen-checkout__applepay__button--${buttonColor}`,\n `adyen-checkout__applepay__button--${buttonType}`,\n 'apple-pay',\n 'apple-pay-button',\n `apple-pay-button-${buttonColor}`,\n `apple-pay-button--type-${buttonType}`\n )}\n onClick={this.props.onClick}\n />\n );\n \n }\n}\n\nexport default ApplePayButton;\n"],"names":["ApplePayButton","Component","static","onClick","buttonColor","buttonType","render","h","button","type","aria-label","this","props","i18n","get","lang","languageCode","className","cx"],"mappings":"4IAaA,MAAMA,UAAuBC,EACzBC,oBAA6B,CACzBC,QAAS,OACTC,YAAa,QACbC,WAAY,SAGhBC,MAAAA,EAAOF,YAAEA,EAAWC,WAAEA,IAClB,OACIE,EAACC,SAAAA,CACGC,KAAK,SACLC,aAAYC,KAAKC,MAAMC,KAAKC,IAAI,aAChCC,KAAMJ,KAAKC,MAAMC,KAAKG,aACtBC,UAAWC,EACP,mCACA,qCAAqCd,IACrC,qCAAqCC,IACrC,YACA,mBACA,oBAAoBD,IACpB,0BAA0BC,KAE9BF,QAASQ,KAAKC,MAAMT,SAIhC"}
@@ -1,2 +1,2 @@
1
- import{createElement as t}from"../../external/preact/dist/preact.js";import o from"./components/CardInput/CardInput.js";import{CoreProvider as e}from"../../core/Context/CoreProvider.js";import s from"../../utils/browserInfo.js";import r from"../internal/SecuredFields/binLookup/triggerBinLookUp.js";import{reject as i,fieldTypeToSnakeCase as n}from"../internal/SecuredFields/utils.js";import{hasValidInstallmentsObject as a}from"./components/CardInput/utils.js";import p from"../internal/ClickToPay/services/create-clicktopay-service.js";import c from"./components/ClickToPayWrapper.js";import l from"../../core/Errors/SRPanelProvider.js";import{TxVariants as u}from"../tx-variants.js";import{UIElement as d}from"../internal/UIElement/UIElement.js";import h from"../internal/PayButton/PayButton.js";import{ANALYTICS_RENDERED_STR as m,ANALYTICS_CONFIGURED_STR as y,ANALYTICS_FOCUS_STR as f,ANALYTICS_UNFOCUS_STR as b,ANALYTICS_VALIDATION_ERROR_STR as g}from"../../core/Analytics/constants.js";import{ALL_SECURED_FIELDS as C}from"../internal/SecuredFields/lib/constants.js";import{hasOwnProperty as P}from"../../utils/hasOwnProperty.js";import S,{IMPLEMENTATION_ERROR as k}from"../../core/Errors/AdyenCheckoutError.js";import{getErrorMessageFromCode as T}from"../../core/Errors/utils.js";import{SF_ErrorCodes as B}from"../../core/Errors/constants.js";class R extends d{static type=u.scheme;clickToPayService;clickToPayRef=null;constructor(t,o){super(t,o),o&&!o._disableClickToPay&&(this.clickToPayService=p(this.props.configuration,this.props.clickToPayConfiguration,this.props.environment),this.clickToPayService?.initialize())}static defaultProps={onBinLookup:()=>{},_disableClickToPay:!1};setStatus(t,o){return this.componentRef?.setStatus&&this.componentRef.setStatus(t,o),this.clickToPayRef?.setStatus&&this.clickToPayRef.setStatus(t,o),this}setClickToPayRef=t=>{this.clickToPayRef=t};formatProps(t){const o=t.session?.configuration?.enableStoreDetails??t.enableStoreDetails,e=!(0===t.amount?.value)&&o,s=t.storedPaymentMethodId||t.id,r=s&&t?.supportedShopperInteractions?.includes("Ecommerce");if(s&&!r)throw new S(k,"You are trying to create a storedCard from a stored PM that does not support Ecommerce interactions");return{...t,holderNameRequired:!!t.hasHolderName&&t.holderNameRequired,hasCVC:!(t.brand&&"bcmc"===t.brand||t.hideCVC),billingAddressRequired:!t.storedPaymentMethodId&&t.billingAddressRequired,brand:t.brand??u.card,countryCode:t.countryCode?t.countryCode.toLowerCase():null,configuration:{...t.configuration,socialSecurityNumberMode:t.configuration?.socialSecurityNumberMode??"auto"},brandsConfiguration:t.brandsConfiguration||t.configuration?.brandsConfiguration||{},icon:t.icon||t.configuration?.icon,installmentOptions:t.session?.configuration?.installmentOptions||t.installmentOptions,enableStoreDetails:o,showStoreDetailsCheckbox:e,clickToPayConfiguration:{...t.clickToPayConfiguration,disableOtpAutoFocus:t.clickToPayConfiguration?.disableOtpAutoFocus||!1,shopperEmail:t.clickToPayConfiguration?.shopperEmail||this.core.options?.session?.shopperEmail,telephoneNumber:t.clickToPayConfiguration?.telephoneNumber||this.core.options?.session?.telephoneNumber,locale:t.clickToPayConfiguration?.locale||t.i18n?.locale?.replace("-","_")},...s&&{storedPaymentMethodId:s}}}formatData(){const t=this.state.selectedBrandValue;return{paymentMethod:{type:R.type,...this.state.data,...this.props.storedPaymentMethodId&&{storedPaymentMethodId:this.props.storedPaymentMethodId},...t&&{brand:t},...this.props.fundingSource&&{fundingSource:this.props.fundingSource}},...this.state.billingAddress&&{billingAddress:this.state.billingAddress},...this.state.socialSecurityNumber&&{socialSecurityNumber:this.state.socialSecurityNumber},...this.storePaymentMethodPayload,...a(this.state.installments)&&{installments:this.state.installments},browserInfo:this.browserInfo,origin:!!window&&window.location.origin}}updateStyles(t){return this.componentRef?.updateStyles&&this.componentRef.updateStyles(t),this}setFocusOn(t){return this.componentRef?.setFocusOn&&this.componentRef.setFocusOn(t),this}onBrand=t=>{this.props.onBrand?.(t)};processBinLookupResponse(t,o=!1){return this.componentRef?.processBinLookupResponse&&this.componentRef.processBinLookupResponse(t,o),this}handleUnsupportedCard(t){return this.componentRef?.handleUnsupportedCard&&this.componentRef.handleUnsupportedCard(t),this}handleClickToPaySubmit=t=>{this.setState({data:{...t},valid:{},errors:{},isValid:!0}),this.submit()};onBinLookup(t){if(!t.isReset){const o=i("supportedBrandsRaw").from(t);this.props.onBinLookup(o)}}submitAnalytics(t){const{type:o}=t;o!==m&&o!==y||"scheme"===this.constructor.type&&P(this.props,"supportedShopperInteractions")&&(t.isStoredPaymentMethod=!0,t.brand=this.props.brand),super.submitAnalytics(t)}onConfigSuccess=t=>{this.submitAnalytics({type:y}),this.props.onConfigSuccess?.(t)};onFocus=t=>{this.submitAnalytics({type:f,target:n(t.fieldType)}),C.includes(t.fieldType)?this.props.onFocus?.(t.event):this.props.onFocus?.(t)};onBlur=t=>{this.submitAnalytics({type:b,target:n(t.fieldType)}),C.includes(t.fieldType)?this.props.onBlur?.(t.event):this.props.onBlur?.(t)};onValidationErrorAnalytics=t=>{this.submitAnalytics({type:g,target:n(t.fieldType),validationErrorCode:t.errorCode,validationErrorMessage:T(t.errorCode,B)})};onBinValue=r(this);get storePaymentMethodPayload(){if(this.props.storedPaymentMethodId?.length>0)return{};if(0===this.props.amount?.value)return this.props.enableStoreDetails?{storePaymentMethod:!0}:{};return this.props.showStoreDetailsCheckbox&&void 0!==this.state.storePaymentMethod?{storePaymentMethod:Boolean(this.state.storePaymentMethod)}:{}}get isValid(){return!!this.state.isValid}get icon(){return this.props.icon??this.resources.getImage()(this.props.brand)}get brands(){const{brands:t,brandsConfiguration:o}=this.props;return t?t.map((t=>({icon:o[t]?.icon??this.props.modules.resources.getImage()(t),name:t}))):[]}get displayName(){return this.props.storedPaymentMethodId?`•••• ${this.props.lastFour}`:this.props.name||R.type}get accessibleName(){return(this.props.name||R.type)+(this.props.storedPaymentMethodId?" "+this.props.i18n.get("creditCard.storedCard.description.ariaLabel").replace("%@",this.props.lastFour):"")}get browserInfo(){return s()}payButton=o=>{const e=0===this.props.amount?.value,s=this.props.storedPaymentMethodId?.length>0;return t(h,{...o,amount:this.props.amount,secondaryAmount:this.props.secondaryAmount,label:e&&!s?this.props.i18n.get("payButton.saveDetails"):"",onClick:this.submit})};renderCardInput(e=!0){return t(o,{setComponentRef:this.setComponentRef,...this.props,...this.state,onChange:this.setState,onSubmit:this.submit,payButton:this.payButton,onBrand:this.onBrand,onBinValue:this.onBinValue,brand:this.props.brand,brandsIcons:this.brands,isPayButtonPrimaryVariant:e,resources:this.resources,onFocus:this.onFocus,onBlur:this.onBlur,onValidationErrorAnalytics:this.onValidationErrorAnalytics,onConfigSuccess:this.onConfigSuccess})}render(){return t(e,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(l,{srPanel:this.props.modules.srPanel},t(c,{amount:this.props.amount,configuration:this.props.clickToPayConfiguration,clickToPayService:this.clickToPayService,isStandaloneComponent:!1,setClickToPayRef:this.setClickToPayRef,onSetStatus:this.setElementStatus,onSubmit:this.handleClickToPaySubmit,onError:this.handleError},(t=>this.renderCardInput(t)))))}}export{R as CardElement,R as default};
1
+ import{createElement as t}from"../../external/preact/dist/preact.js";import o from"./components/CardInput/CardInput.js";import{CoreProvider as e}from"../../core/Context/CoreProvider.js";import s from"../../utils/browserInfo.js";import r from"../internal/SecuredFields/binLookup/triggerBinLookUp.js";import{fieldTypeToSnakeCase as i}from"../internal/SecuredFields/utils.js";import{reject as n}from"../../utils/commonUtils.js";import{hasValidInstallmentsObject as a}from"./components/CardInput/utils.js";import p from"../internal/ClickToPay/services/create-clicktopay-service.js";import c from"./components/ClickToPayWrapper.js";import l from"../../core/Errors/SRPanelProvider.js";import{TxVariants as d}from"../tx-variants.js";import{UIElement as u}from"../internal/UIElement/UIElement.js";import h from"../internal/PayButton/PayButton.js";import{ANALYTICS_RENDERED_STR as m,ANALYTICS_CONFIGURED_STR as y,ANALYTICS_FOCUS_STR as f,ANALYTICS_UNFOCUS_STR as b,ANALYTICS_VALIDATION_ERROR_STR as g}from"../../core/Analytics/constants.js";import{ALL_SECURED_FIELDS as C}from"../internal/SecuredFields/lib/constants.js";import{hasOwnProperty as P}from"../../utils/hasOwnProperty.js";import S,{IMPLEMENTATION_ERROR as k}from"../../core/Errors/AdyenCheckoutError.js";import{getErrorMessageFromCode as T}from"../../core/Errors/utils.js";import{SF_ErrorCodes as R}from"../../core/Errors/constants.js";import B from"./components/CardInput/defaultProps.js";class I extends u{static type=d.scheme;clickToPayService;clickToPayRef=null;constructor(t,o){super(t,o),o&&!o._disableClickToPay&&(this.clickToPayService=p(this.props.configuration,this.props.clickToPayConfiguration,this.props.environment),this.clickToPayService?.initialize())}static defaultProps={showFormInstruction:!0,_disableClickToPay:!1,doBinLookup:!0,...n(["type","setComponentRef"]).from(B)};setStatus(t,o){return this.componentRef?.setStatus&&this.componentRef.setStatus(t,o),this.clickToPayRef?.setStatus&&this.clickToPayRef.setStatus(t,o),this}setClickToPayRef=t=>{this.clickToPayRef=t};formatProps(t){const o=t.session?.configuration?.enableStoreDetails??t.enableStoreDetails,e=!(0===t.amount?.value)&&o,s=t.storedPaymentMethodId||t.id,r=s&&t?.supportedShopperInteractions?.includes("Ecommerce");if(s&&!r)throw new S(k,"You are trying to create a storedCard from a stored PM that does not support Ecommerce interactions");return{...t,holderNameRequired:!!t.hasHolderName&&t.holderNameRequired,hasCVC:!(t.brand&&"bcmc"===t.brand||t.hideCVC),billingAddressRequired:!t.storedPaymentMethodId&&t.billingAddressRequired,billingAddressMode:t.onAddressLookup?B.billingAddressMode:t.billingAddressMode,brand:t.brand??d.card,countryCode:t.countryCode?t.countryCode.toLowerCase():null,configuration:{...t.configuration,socialSecurityNumberMode:t.configuration?.socialSecurityNumberMode??"auto"},brandsConfiguration:t.brandsConfiguration||t.configuration?.brandsConfiguration||{},icon:t.icon||t.configuration?.icon,installmentOptions:t.session?.configuration?.installmentOptions||t.installmentOptions,enableStoreDetails:o,showStoreDetailsCheckbox:e,clickToPayConfiguration:{...t.clickToPayConfiguration,disableOtpAutoFocus:t.clickToPayConfiguration?.disableOtpAutoFocus||!1,shopperEmail:t.clickToPayConfiguration?.shopperEmail||this.core.options?.session?.shopperEmail,telephoneNumber:t.clickToPayConfiguration?.telephoneNumber||this.core.options?.session?.telephoneNumber,locale:t.clickToPayConfiguration?.locale||t.i18n?.locale?.replace("-","_")},...s&&{storedPaymentMethodId:s}}}formatData(){const t=this.state.selectedBrandValue;return{paymentMethod:{type:I.type,...this.state.data,...this.props.storedPaymentMethodId&&{storedPaymentMethodId:this.props.storedPaymentMethodId},...t&&{brand:t},...this.props.fundingSource&&{fundingSource:this.props.fundingSource}},...this.state.billingAddress&&{billingAddress:this.state.billingAddress},...this.state.socialSecurityNumber&&{socialSecurityNumber:this.state.socialSecurityNumber},...this.storePaymentMethodPayload,...a(this.state.installments)&&{installments:this.state.installments},browserInfo:this.browserInfo,origin:!!window&&window.location.origin}}updateStyles(t){return this.componentRef?.updateStyles&&this.componentRef.updateStyles(t),this}setFocusOn(t){return this.componentRef?.setFocusOn&&this.componentRef.setFocusOn(t),this}onBrand=t=>{this.props.onBrand?.(t)};processBinLookupResponse(t,o=!1){return this.componentRef?.processBinLookupResponse&&this.componentRef.processBinLookupResponse(t,o),this}handleUnsupportedCard(t){return this.componentRef?.handleUnsupportedCard&&this.componentRef.handleUnsupportedCard(t),this}handleClickToPaySubmit=t=>{this.setState({data:{...t},valid:{},errors:{},isValid:!0}),this.submit()};onBinLookup(t){if(!t.isReset){const o=n("supportedBrandsRaw").from(t);this.props.onBinLookup(o)}}submitAnalytics(t){const{type:o}=t;o!==m&&o!==y||"scheme"===this.constructor.type&&P(this.props,"supportedShopperInteractions")&&(t.isStoredPaymentMethod=!0,t.brand=this.props.brand),super.submitAnalytics(t,this.props)}onConfigSuccess=t=>{this.submitAnalytics({type:y}),this.props.onConfigSuccess?.(t)};onFocus=t=>{this.submitAnalytics({type:f,target:i(t.fieldType)}),C.includes(t.fieldType)?this.props.onFocus?.(t.event):this.props.onFocus?.(t)};onBlur=t=>{this.submitAnalytics({type:b,target:i(t.fieldType)}),C.includes(t.fieldType)?this.props.onBlur?.(t.event):this.props.onBlur?.(t)};onValidationErrorAnalytics=t=>{this.submitAnalytics({type:g,target:i(t.fieldType),validationErrorCode:t.errorCode,validationErrorMessage:T(t.errorCode,R)})};onBinValue=r(this);get storePaymentMethodPayload(){if(this.props.storedPaymentMethodId?.length>0)return{};if(0===this.props.amount?.value)return this.props.enableStoreDetails?{storePaymentMethod:!0}:{};return this.props.showStoreDetailsCheckbox&&void 0!==this.state.storePaymentMethod?{storePaymentMethod:Boolean(this.state.storePaymentMethod)}:{}}get isValid(){return!!this.state.isValid}get icon(){return this.props.icon??this.resources.getImage()(this.props.brand)}get brands(){const{brands:t,brandsConfiguration:o}=this.props;return t?t.map((t=>({icon:o[t]?.icon??this.props.modules.resources.getImage()(t),name:t}))):[]}get displayName(){return this.props.storedPaymentMethodId?`•••• ${this.props.lastFour}`:this.props.name||I.type}get accessibleName(){return(this.props.name||I.type)+(this.props.storedPaymentMethodId?" "+this.props.i18n.get("creditCard.storedCard.description.ariaLabel").replace("%@",this.props.lastFour):"")}get browserInfo(){return s()}payButton=o=>{const e=0===this.props.amount?.value,s=this.props.storedPaymentMethodId?.length>0;return t(h,{...o,amount:this.props.amount,secondaryAmount:this.props.secondaryAmount,label:e&&!s?this.props.i18n.get("payButton.saveDetails"):"",onClick:this.submit})};renderCardInput(e=!0){return t(o,{setComponentRef:this.setComponentRef,...this.props,...this.state,onChange:this.setState,onSubmit:this.submit,handleKeyPress:this.handleKeyPress,payButton:this.payButton,onBrand:this.onBrand,onBinValue:this.onBinValue,brand:this.props.brand,brandsIcons:this.brands,isPayButtonPrimaryVariant:e,resources:this.resources,onFocus:this.onFocus,onBlur:this.onBlur,onValidationErrorAnalytics:this.onValidationErrorAnalytics,onConfigSuccess:this.onConfigSuccess})}render(){return t(e,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(l,{srPanel:this.props.modules.srPanel},t(c,{amount:this.props.amount,configuration:this.props.clickToPayConfiguration,clickToPayService:this.clickToPayService,isStandaloneComponent:!1,setClickToPayRef:this.setClickToPayRef,onSetStatus:this.setElementStatus,onSubmit:this.handleClickToPaySubmit,onError:this.handleError},(t=>this.renderCardInput(t)))))}}export{I as CardElement,I as default};
2
2
  //# sourceMappingURL=Card.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","sources":["../../../../src/components/Card/Card.tsx"],"sourcesContent":["import { h } from 'preact';\nimport CardInput from './components/CardInput';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport collectBrowserInfo from '../../utils/browserInfo';\nimport { BinLookupResponse, CardElementData, CardConfiguration } from './types';\nimport triggerBinLookUp from '../internal/SecuredFields/binLookup/triggerBinLookUp';\nimport { CbObjOnBinLookup, CbObjOnConfigSuccess, CbObjOnFocus } from '../internal/SecuredFields/lib/types';\nimport { fieldTypeToSnakeCase, reject } from '../internal/SecuredFields/utils';\nimport { hasValidInstallmentsObject } from './components/CardInput/utils';\nimport createClickToPayService from '../internal/ClickToPay/services/create-clicktopay-service';\nimport { ClickToPayCheckoutPayload, IClickToPayService } from '../internal/ClickToPay/services/types';\nimport ClickToPayWrapper from './components/ClickToPayWrapper';\nimport { ComponentFocusObject } from '../../types/global-types';\nimport SRPanelProvider from '../../core/Errors/SRPanelProvider';\nimport { TxVariants } from '../tx-variants';\nimport { UIElementStatus } from '../internal/UIElement/types';\nimport UIElement from '../internal/UIElement';\nimport PayButton from '../internal/PayButton';\nimport { PayButtonProps } from '../internal/PayButton/PayButton';\nimport type { ICore } from '../../core/types';\nimport {\n ANALYTICS_FOCUS_STR,\n ANALYTICS_CONFIGURED_STR,\n ANALYTICS_UNFOCUS_STR,\n ANALYTICS_VALIDATION_ERROR_STR,\n ANALYTICS_RENDERED_STR\n} from '../../core/Analytics/constants';\nimport { ALL_SECURED_FIELDS } from '../internal/SecuredFields/lib/constants';\nimport { FieldErrorAnalyticsObject, SendAnalyticsObject } from '../../core/Analytics/types';\nimport { hasOwnProperty } from '../../utils/hasOwnProperty';\nimport AdyenCheckoutError, { IMPLEMENTATION_ERROR } from '../../core/Errors/AdyenCheckoutError';\nimport { getErrorMessageFromCode } from '../../core/Errors/utils';\nimport { SF_ErrorCodes } from '../../core/Errors/constants';\n\nexport class CardElement extends UIElement<CardConfiguration> {\n public static type = TxVariants.scheme;\n\n private readonly clickToPayService: IClickToPayService | null;\n\n /**\n * Reference to the 'ClickToPayComponent'\n */\n private clickToPayRef = null;\n\n constructor(checkout: ICore, props?: CardConfiguration) {\n super(checkout, props);\n\n if (props && !props._disableClickToPay) {\n this.clickToPayService = createClickToPayService(this.props.configuration, this.props.clickToPayConfiguration, this.props.environment);\n this.clickToPayService?.initialize();\n }\n }\n\n protected static defaultProps = {\n onBinLookup: () => {},\n _disableClickToPay: false\n };\n\n public setStatus(status: UIElementStatus, props?): this {\n if (this.componentRef?.setStatus) {\n this.componentRef.setStatus(status, props);\n }\n if (this.clickToPayRef?.setStatus) {\n this.clickToPayRef.setStatus(status, props);\n }\n return this;\n }\n\n private setClickToPayRef = ref => {\n this.clickToPayRef = ref;\n };\n\n formatProps(props: CardConfiguration) {\n // The value from a session should be used, before falling back to the merchant configuration\n const enableStoreDetails = props.session?.configuration?.enableStoreDetails ?? props.enableStoreDetails;\n\n const isZeroAuth = props.amount?.value === 0;\n const showStoreDetailsCheckbox = isZeroAuth ? false : enableStoreDetails;\n\n const storedCardID = props.storedPaymentMethodId || props.id; // check if we've been passed a (checkout) processed storedCard or one that merchant has pulled from the PMs response\n const isEcommerceStoredCard = storedCardID && props?.supportedShopperInteractions?.includes('Ecommerce'); // If we have a storedCard does it support Ecommerce (it might not if the merchant has pulled it from the PMs response)\n\n // If we have a storedPM but it doesn't support Ecommerce - we can't make a storedCard component from it\n if (storedCardID && !isEcommerceStoredCard) {\n // TODO - Decide if an error is too severe? Would a console.warning suffice?\n throw new AdyenCheckoutError(\n IMPLEMENTATION_ERROR,\n 'You are trying to create a storedCard from a stored PM that does not support Ecommerce interactions'\n );\n }\n\n return {\n ...props,\n // Mismatch between hasHolderName & holderNameRequired which can mean card can never be valid\n holderNameRequired: !props.hasHolderName ? false : props.holderNameRequired,\n // False for *stored* BCMC cards & if merchant explicitly wants to hide the CVC field\n hasCVC: !((props.brand && props.brand === 'bcmc') || props.hideCVC),\n // billingAddressRequired only available for non-stored cards\n billingAddressRequired: props.storedPaymentMethodId ? false : props.billingAddressRequired,\n // ...(props.brands && !props.groupTypes && { groupTypes: props.brands }),\n /** props.brand will be specified in the case of a StoredCard or a Bancontact component, for a regular Card we default it to 'card' */\n brand: props.brand ?? TxVariants.card,\n countryCode: props.countryCode ? props.countryCode.toLowerCase() : null,\n // Required for transition period (until configuration object becomes the norm)\n // - if merchant has defined value directly in props, use this instead\n configuration: {\n ...props.configuration,\n socialSecurityNumberMode: props.configuration?.socialSecurityNumberMode ?? 'auto'\n },\n brandsConfiguration: props.brandsConfiguration || props.configuration?.brandsConfiguration || {},\n icon: props.icon || props.configuration?.icon,\n // installmentOptions of a session should be used before falling back to the merchant configuration\n installmentOptions: props.session?.configuration?.installmentOptions || props.installmentOptions,\n enableStoreDetails,\n showStoreDetailsCheckbox,\n /**\n * Click to Pay configuration\n * - If email is set explicitly in the configuration, then it can override the one used in the session creation\n */\n clickToPayConfiguration: {\n ...props.clickToPayConfiguration,\n disableOtpAutoFocus: props.clickToPayConfiguration?.disableOtpAutoFocus || false,\n shopperEmail: props.clickToPayConfiguration?.shopperEmail || this.core.options?.session?.shopperEmail,\n telephoneNumber: props.clickToPayConfiguration?.telephoneNumber || this.core.options?.session?.telephoneNumber,\n locale: props.clickToPayConfiguration?.locale || props.i18n?.locale?.replace('-', '_')\n },\n ...(storedCardID && { storedPaymentMethodId: storedCardID })\n };\n }\n\n /**\n * Formats the component data output\n */\n formatData(): CardElementData {\n /**\n * this.state.selectedBrandValue will be set when:\n * - /binLookup detects a single brand,\n * - when /binLookup detects a dual-branded card and the shopper makes a brand selection\n * - or, in the case of a storedCard\n */\n const cardBrand = this.state.selectedBrandValue;\n\n return {\n paymentMethod: {\n type: CardElement.type,\n ...this.state.data,\n ...(this.props.storedPaymentMethodId && { storedPaymentMethodId: this.props.storedPaymentMethodId }),\n ...(cardBrand && { brand: cardBrand }),\n ...(this.props.fundingSource && { fundingSource: this.props.fundingSource })\n },\n ...(this.state.billingAddress && { billingAddress: this.state.billingAddress }),\n ...(this.state.socialSecurityNumber && { socialSecurityNumber: this.state.socialSecurityNumber }),\n ...this.storePaymentMethodPayload,\n ...(hasValidInstallmentsObject(this.state.installments) && { installments: this.state.installments }),\n browserInfo: this.browserInfo,\n origin: !!window && window.location.origin\n };\n }\n\n updateStyles(stylesObj) {\n if (this.componentRef?.updateStyles) this.componentRef.updateStyles(stylesObj);\n return this;\n }\n\n setFocusOn(fieldName) {\n if (this.componentRef?.setFocusOn) this.componentRef.setFocusOn(fieldName);\n return this;\n }\n\n public onBrand = event => {\n this.props.onBrand?.(event);\n };\n\n processBinLookupResponse(binLookupResponse: BinLookupResponse, isReset = false) {\n if (this.componentRef?.processBinLookupResponse) this.componentRef.processBinLookupResponse(binLookupResponse, isReset);\n return this;\n }\n\n handleUnsupportedCard(errObj) {\n if (this.componentRef?.handleUnsupportedCard) this.componentRef.handleUnsupportedCard(errObj);\n return this;\n }\n\n private handleClickToPaySubmit = (payload: ClickToPayCheckoutPayload) => {\n this.setState({ data: { ...payload }, valid: {}, errors: {}, isValid: true });\n this.submit();\n };\n\n onBinLookup(obj: CbObjOnBinLookup) {\n // Handler for regular card comp doesn't need this 'raw' data or to know about 'resets'\n if (!obj.isReset) {\n const nuObj = reject('supportedBrandsRaw').from(obj);\n this.props.onBinLookup(nuObj);\n }\n }\n\n protected submitAnalytics(analyticsObj: SendAnalyticsObject) {\n const { type } = analyticsObj;\n\n if (type === ANALYTICS_RENDERED_STR || type === ANALYTICS_CONFIGURED_STR) {\n // Check if it's a storedCard\n if (this.constructor['type'] === 'scheme') {\n if (hasOwnProperty(this.props, 'supportedShopperInteractions')) {\n analyticsObj.isStoredPaymentMethod = true;\n analyticsObj.brand = this.props.brand;\n }\n }\n }\n\n super.submitAnalytics(analyticsObj);\n }\n\n private onConfigSuccess = (obj: CbObjOnConfigSuccess) => {\n this.submitAnalytics({\n type: ANALYTICS_CONFIGURED_STR\n });\n\n this.props.onConfigSuccess?.(obj);\n };\n\n private onFocus = (obj: ComponentFocusObject) => {\n this.submitAnalytics({\n type: ANALYTICS_FOCUS_STR,\n target: fieldTypeToSnakeCase(obj.fieldType)\n });\n\n // Call merchant defined callback\n if (ALL_SECURED_FIELDS.includes(obj.fieldType)) {\n this.props.onFocus?.(obj.event as CbObjOnFocus);\n } else {\n this.props.onFocus?.(obj);\n }\n };\n\n private onBlur = (obj: ComponentFocusObject) => {\n this.submitAnalytics({\n type: ANALYTICS_UNFOCUS_STR,\n target: fieldTypeToSnakeCase(obj.fieldType)\n });\n\n // Call merchant defined callback\n if (ALL_SECURED_FIELDS.includes(obj.fieldType)) {\n this.props.onBlur?.(obj.event as CbObjOnFocus);\n } else {\n this.props.onBlur?.(obj);\n }\n };\n\n private onValidationErrorAnalytics = (obj: FieldErrorAnalyticsObject) => {\n this.submitAnalytics({\n type: ANALYTICS_VALIDATION_ERROR_STR,\n target: fieldTypeToSnakeCase(obj.fieldType),\n validationErrorCode: obj.errorCode,\n validationErrorMessage: getErrorMessageFromCode(obj.errorCode, SF_ErrorCodes)\n });\n };\n\n public onBinValue = triggerBinLookUp(this);\n\n get storePaymentMethodPayload() {\n const isStoredCard = this.props.storedPaymentMethodId?.length > 0;\n if (isStoredCard) {\n return {};\n }\n\n /**\n * For regular card, zero auth payments, we store the payment method, *if* the configuration says we should:\n * - For sessions, this means if the session has been created with storePaymentMethodMode: 'askForConsent'\n * - For the advanced flow, this means if the merchant has still set enableStoreDetails: true\n *\n * What we are doing is.. if for a normal payment we would show the \"Save for my next payment\" checkbox,\n * for a zero-auth payment we effectively click the checkbox on behalf of the shopper.\n */\n const isZeroAuth = this.props.amount?.value === 0;\n if (isZeroAuth) {\n return this.props.enableStoreDetails ? { storePaymentMethod: true } : {};\n }\n\n // For regular card, non-zero auth payments, we store the payment method based on the checkbox value.\n // const includeStorePaymentMethod = this.props.enableStoreDetails && typeof this.state.storePaymentMethod !== 'undefined';\n const includeStorePaymentMethod = this.props.showStoreDetailsCheckbox && typeof this.state.storePaymentMethod !== 'undefined';\n return includeStorePaymentMethod ? { storePaymentMethod: Boolean(this.state.storePaymentMethod) } : {};\n }\n\n get isValid() {\n return !!this.state.isValid;\n }\n\n get icon() {\n return this.props.icon ?? this.resources.getImage()(this.props.brand);\n }\n\n get brands(): { icon: any; name: string }[] {\n const { brands, brandsConfiguration } = this.props;\n if (brands) {\n return brands.map(brand => {\n const brandIcon = brandsConfiguration[brand]?.icon ?? this.props.modules.resources.getImage()(brand);\n return { icon: brandIcon, name: brand };\n });\n }\n\n return [];\n }\n\n get displayName(): string {\n if (this.props.storedPaymentMethodId) {\n return `•••• ${this.props.lastFour}`;\n }\n\n return this.props.name || CardElement.type;\n }\n\n get accessibleName(): string {\n // Use display name, unless it's a stored payment method, there inform user\n return (\n (this.props.name || CardElement.type) +\n (this.props.storedPaymentMethodId\n ? ' ' + this.props.i18n.get('creditCard.storedCard.description.ariaLabel').replace('%@', this.props.lastFour)\n : '')\n );\n }\n\n get browserInfo() {\n return collectBrowserInfo();\n }\n // Override\n protected payButton = (props: PayButtonProps) => {\n const isZeroAuth = this.props.amount?.value === 0;\n const isStoredCard = this.props.storedPaymentMethodId?.length > 0;\n return (\n <PayButton\n {...props}\n amount={this.props.amount}\n secondaryAmount={this.props.secondaryAmount}\n label={isZeroAuth && !isStoredCard ? this.props.i18n.get('payButton.saveDetails') : ''}\n onClick={this.submit}\n />\n );\n };\n\n private renderCardInput(isCardPrimaryInput = true): h.JSX.Element {\n return (\n <CardInput\n setComponentRef={this.setComponentRef}\n {...this.props}\n {...this.state}\n onChange={this.setState}\n onSubmit={this.submit}\n payButton={this.payButton}\n onBrand={this.onBrand}\n onBinValue={this.onBinValue}\n brand={this.props.brand}\n brandsIcons={this.brands}\n isPayButtonPrimaryVariant={isCardPrimaryInput}\n resources={this.resources}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onValidationErrorAnalytics={this.onValidationErrorAnalytics}\n onConfigSuccess={this.onConfigSuccess}\n />\n );\n }\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>\n <ClickToPayWrapper\n amount={this.props.amount}\n configuration={this.props.clickToPayConfiguration}\n clickToPayService={this.clickToPayService}\n isStandaloneComponent={false}\n setClickToPayRef={this.setClickToPayRef}\n onSetStatus={this.setElementStatus}\n onSubmit={this.handleClickToPaySubmit}\n onError={this.handleError}\n >\n {isCardPrimaryInput => this.renderCardInput(isCardPrimaryInput)}\n </ClickToPayWrapper>\n </SRPanelProvider>\n </CoreProvider>\n );\n }\n}\n\nexport default CardElement;\n"],"names":["CardElement","UIElement","static","TxVariants","scheme","clickToPayService","clickToPayRef","constructor","checkout","props","super","_disableClickToPay","this","createClickToPayService","configuration","clickToPayConfiguration","environment","initialize","onBinLookup","setStatus","status","componentRef","setClickToPayRef","ref","formatProps","enableStoreDetails","session","showStoreDetailsCheckbox","amount","value","storedCardID","storedPaymentMethodId","id","isEcommerceStoredCard","supportedShopperInteractions","includes","AdyenCheckoutError","IMPLEMENTATION_ERROR","holderNameRequired","hasHolderName","hasCVC","brand","hideCVC","billingAddressRequired","card","countryCode","toLowerCase","socialSecurityNumberMode","brandsConfiguration","icon","installmentOptions","disableOtpAutoFocus","shopperEmail","core","options","telephoneNumber","locale","i18n","replace","formatData","cardBrand","state","selectedBrandValue","paymentMethod","type","data","fundingSource","billingAddress","socialSecurityNumber","storePaymentMethodPayload","hasValidInstallmentsObject","installments","browserInfo","origin","window","location","updateStyles","stylesObj","setFocusOn","fieldName","onBrand","event","processBinLookupResponse","binLookupResponse","isReset","handleUnsupportedCard","errObj","handleClickToPaySubmit","payload","setState","valid","errors","isValid","submit","obj","nuObj","reject","from","submitAnalytics","analyticsObj","ANALYTICS_RENDERED_STR","ANALYTICS_CONFIGURED_STR","hasOwnProperty","isStoredPaymentMethod","onConfigSuccess","onFocus","ANALYTICS_FOCUS_STR","target","fieldTypeToSnakeCase","fieldType","ALL_SECURED_FIELDS","onBlur","ANALYTICS_UNFOCUS_STR","onValidationErrorAnalytics","ANALYTICS_VALIDATION_ERROR_STR","validationErrorCode","errorCode","validationErrorMessage","getErrorMessageFromCode","SF_ErrorCodes","onBinValue","triggerBinLookUp","length","storePaymentMethod","Boolean","resources","getImage","brands","map","modules","name","displayName","lastFour","accessibleName","get","collectBrowserInfo","payButton","isZeroAuth","isStoredCard","h","PayButton","secondaryAmount","label","onClick","renderCardInput","isCardPrimaryInput","CardInput","setComponentRef","onChange","onSubmit","brandsIcons","isPayButtonPrimaryVariant","render","CoreProvider","loadingContext","SRPanelProvider","srPanel","ClickToPayWrapper","isStandaloneComponent","onSetStatus","setElementStatus","onError","handleError"],"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,uBACf0E,QAASrJ,KAAKsJ,cAEbjB,GAAsBrI,KAAKoI,gBAAgBC,MAKhE"}
1
+ {"version":3,"file":"Card.js","sources":["../../../../src/components/Card/Card.tsx"],"sourcesContent":["import { h } from 'preact';\nimport CardInput from './components/CardInput';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport collectBrowserInfo from '../../utils/browserInfo';\nimport { BinLookupResponse, CardElementData, CardConfiguration } from './types';\nimport triggerBinLookUp from '../internal/SecuredFields/binLookup/triggerBinLookUp';\nimport { CbObjOnBinLookup, CbObjOnConfigSuccess, CbObjOnFocus } from '../internal/SecuredFields/lib/types';\nimport { fieldTypeToSnakeCase } from '../internal/SecuredFields/utils';\nimport { reject } from '../../utils/commonUtils';\nimport { hasValidInstallmentsObject } from './components/CardInput/utils';\nimport createClickToPayService from '../internal/ClickToPay/services/create-clicktopay-service';\nimport { ClickToPayCheckoutPayload, IClickToPayService } from '../internal/ClickToPay/services/types';\nimport ClickToPayWrapper from './components/ClickToPayWrapper';\nimport { ComponentFocusObject } from '../../types/global-types';\nimport SRPanelProvider from '../../core/Errors/SRPanelProvider';\nimport { TxVariants } from '../tx-variants';\nimport type { PayButtonFunctionProps, UIElementStatus } from '../internal/UIElement/types';\nimport UIElement from '../internal/UIElement';\nimport PayButton from '../internal/PayButton';\nimport type { ICore } from '../../core/types';\nimport {\n ANALYTICS_FOCUS_STR,\n ANALYTICS_CONFIGURED_STR,\n ANALYTICS_UNFOCUS_STR,\n ANALYTICS_VALIDATION_ERROR_STR,\n ANALYTICS_RENDERED_STR\n} from '../../core/Analytics/constants';\nimport { ALL_SECURED_FIELDS } from '../internal/SecuredFields/lib/constants';\nimport { FieldErrorAnalyticsObject, SendAnalyticsObject } from '../../core/Analytics/types';\nimport { hasOwnProperty } from '../../utils/hasOwnProperty';\nimport AdyenCheckoutError, { IMPLEMENTATION_ERROR } from '../../core/Errors/AdyenCheckoutError';\nimport { getErrorMessageFromCode } from '../../core/Errors/utils';\nimport { SF_ErrorCodes } from '../../core/Errors/constants';\nimport CardInputDefaultProps from './components/CardInput/defaultProps';\n\nexport class CardElement extends UIElement<CardConfiguration> {\n public static type = TxVariants.scheme;\n\n private readonly clickToPayService: IClickToPayService | null;\n\n /**\n * Reference to the 'ClickToPayComponent'\n */\n private clickToPayRef = null;\n\n constructor(checkout: ICore, props?: CardConfiguration) {\n super(checkout, props);\n\n if (props && !props._disableClickToPay) {\n this.clickToPayService = createClickToPayService(this.props.configuration, this.props.clickToPayConfiguration, this.props.environment);\n void this.clickToPayService?.initialize();\n }\n }\n\n protected static defaultProps = {\n showFormInstruction: true,\n _disableClickToPay: false,\n doBinLookup: true,\n // Merge most of CardInput's defaultProps\n ...reject(['type', 'setComponentRef']).from(CardInputDefaultProps)\n };\n\n public setStatus(status: UIElementStatus, props?): this {\n if (this.componentRef?.setStatus) {\n this.componentRef.setStatus(status, props);\n }\n if (this.clickToPayRef?.setStatus) {\n this.clickToPayRef.setStatus(status, props);\n }\n return this;\n }\n\n private setClickToPayRef = ref => {\n this.clickToPayRef = ref;\n };\n\n formatProps(props: CardConfiguration): CardConfiguration {\n // The value from a session should be used, before falling back to the merchant configuration\n const enableStoreDetails = props.session?.configuration?.enableStoreDetails ?? props.enableStoreDetails;\n\n const isZeroAuth = props.amount?.value === 0;\n const showStoreDetailsCheckbox = isZeroAuth ? false : enableStoreDetails;\n\n const storedCardID = props.storedPaymentMethodId || props.id; // check if we've been passed a (checkout) processed storedCard or one that merchant has pulled from the PMs response\n const isEcommerceStoredCard = storedCardID && props?.supportedShopperInteractions?.includes('Ecommerce'); // If we have a storedCard does it support Ecommerce (it might not if the merchant has pulled it from the PMs response)\n\n // If we have a storedPM but it doesn't support Ecommerce - we can't make a storedCard component from it\n if (storedCardID && !isEcommerceStoredCard) {\n // TODO - Decide if an error is too severe? Would a console.warning suffice?\n throw new AdyenCheckoutError(\n IMPLEMENTATION_ERROR,\n 'You are trying to create a storedCard from a stored PM that does not support Ecommerce interactions'\n );\n }\n\n return {\n ...props,\n // Mismatch between hasHolderName & holderNameRequired which can mean card can never be valid\n holderNameRequired: !props.hasHolderName ? false : props.holderNameRequired,\n // False for *stored* BCMC cards & if merchant explicitly wants to hide the CVC field\n hasCVC: !((props.brand && props.brand === 'bcmc') || props.hideCVC),\n // billingAddressRequired only available for non-stored cards\n billingAddressRequired: props.storedPaymentMethodId ? false : props.billingAddressRequired,\n // edge case where merchant has defined both an onAddressLookup callback AND set billingAddressMode: 'partial' - which leads to some strange behaviour in the address UI\n billingAddressMode: props.onAddressLookup ? CardInputDefaultProps.billingAddressMode : props.billingAddressMode,\n /** props.brand will be specified in the case of a StoredCard or a Bancontact component, for a regular Card we default it to 'card' */\n brand: props.brand ?? TxVariants.card,\n countryCode: props.countryCode ? props.countryCode.toLowerCase() : null,\n // Required for transition period (until configuration object becomes the norm)\n // - if merchant has defined value directly in props, use this instead\n configuration: {\n ...props.configuration,\n socialSecurityNumberMode: props.configuration?.socialSecurityNumberMode ?? 'auto'\n },\n brandsConfiguration: props.brandsConfiguration || props.configuration?.brandsConfiguration || {},\n icon: props.icon || props.configuration?.icon,\n // installmentOptions of a session should be used before falling back to the merchant configuration\n installmentOptions: props.session?.configuration?.installmentOptions || props.installmentOptions,\n enableStoreDetails,\n showStoreDetailsCheckbox,\n /**\n * Click to Pay configuration\n * - If email is set explicitly in the configuration, then it can override the one used in the session creation\n */\n clickToPayConfiguration: {\n ...props.clickToPayConfiguration,\n disableOtpAutoFocus: props.clickToPayConfiguration?.disableOtpAutoFocus || false,\n shopperEmail: props.clickToPayConfiguration?.shopperEmail || this.core.options?.session?.shopperEmail,\n telephoneNumber: props.clickToPayConfiguration?.telephoneNumber || this.core.options?.session?.telephoneNumber,\n locale: props.clickToPayConfiguration?.locale || props.i18n?.locale?.replace('-', '_')\n },\n ...(storedCardID && { storedPaymentMethodId: storedCardID })\n };\n }\n\n /**\n * Formats the component data output\n */\n formatData(): CardElementData {\n /**\n * this.state.selectedBrandValue will be set when:\n * - /binLookup detects a single brand,\n * - when /binLookup detects a dual-branded card and the shopper makes a brand selection\n * - or, in the case of a storedCard\n */\n const cardBrand = this.state.selectedBrandValue;\n\n return {\n paymentMethod: {\n type: CardElement.type,\n ...this.state.data,\n ...(this.props.storedPaymentMethodId && { storedPaymentMethodId: this.props.storedPaymentMethodId }),\n ...(cardBrand && { brand: cardBrand }),\n ...(this.props.fundingSource && { fundingSource: this.props.fundingSource })\n },\n ...(this.state.billingAddress && { billingAddress: this.state.billingAddress }),\n ...(this.state.socialSecurityNumber && { socialSecurityNumber: this.state.socialSecurityNumber }),\n ...this.storePaymentMethodPayload,\n ...(hasValidInstallmentsObject(this.state.installments) && { installments: this.state.installments }),\n browserInfo: this.browserInfo,\n origin: !!window && window.location.origin\n };\n }\n\n updateStyles(stylesObj) {\n if (this.componentRef?.updateStyles) this.componentRef.updateStyles(stylesObj);\n return this;\n }\n\n setFocusOn(fieldName) {\n if (this.componentRef?.setFocusOn) this.componentRef.setFocusOn(fieldName);\n return this;\n }\n\n public onBrand = event => {\n this.props.onBrand?.(event);\n };\n\n processBinLookupResponse(binLookupResponse: BinLookupResponse, isReset = false) {\n if (this.componentRef?.processBinLookupResponse) this.componentRef.processBinLookupResponse(binLookupResponse, isReset);\n return this;\n }\n\n handleUnsupportedCard(errObj) {\n if (this.componentRef?.handleUnsupportedCard) this.componentRef.handleUnsupportedCard(errObj);\n return this;\n }\n\n private handleClickToPaySubmit = (payload: ClickToPayCheckoutPayload) => {\n this.setState({ data: { ...payload }, valid: {}, errors: {}, isValid: true });\n this.submit();\n };\n\n onBinLookup(obj: CbObjOnBinLookup) {\n // Handler for regular card comp doesn't need this 'raw' data or to know about 'resets'\n if (!obj.isReset) {\n const nuObj = reject('supportedBrandsRaw').from(obj);\n this.props.onBinLookup(nuObj);\n }\n }\n\n protected submitAnalytics(analyticsObj: SendAnalyticsObject) {\n const { type } = analyticsObj;\n\n if (type === ANALYTICS_RENDERED_STR || type === ANALYTICS_CONFIGURED_STR) {\n // Check if it's a storedCard\n if (this.constructor['type'] === 'scheme') {\n if (hasOwnProperty(this.props, 'supportedShopperInteractions')) {\n analyticsObj.isStoredPaymentMethod = true;\n analyticsObj.brand = this.props.brand;\n }\n }\n }\n\n super.submitAnalytics(analyticsObj, this.props);\n }\n\n private onConfigSuccess = (obj: CbObjOnConfigSuccess) => {\n this.submitAnalytics({\n type: ANALYTICS_CONFIGURED_STR\n });\n\n this.props.onConfigSuccess?.(obj);\n };\n\n private onFocus = (obj: ComponentFocusObject) => {\n this.submitAnalytics({\n type: ANALYTICS_FOCUS_STR,\n target: fieldTypeToSnakeCase(obj.fieldType)\n });\n\n // Call merchant defined callback\n if (ALL_SECURED_FIELDS.includes(obj.fieldType)) {\n this.props.onFocus?.(obj.event as CbObjOnFocus);\n } else {\n this.props.onFocus?.(obj);\n }\n };\n\n private onBlur = (obj: ComponentFocusObject) => {\n this.submitAnalytics({\n type: ANALYTICS_UNFOCUS_STR,\n target: fieldTypeToSnakeCase(obj.fieldType)\n });\n\n // Call merchant defined callback\n if (ALL_SECURED_FIELDS.includes(obj.fieldType)) {\n this.props.onBlur?.(obj.event as CbObjOnFocus);\n } else {\n this.props.onBlur?.(obj);\n }\n };\n\n private onValidationErrorAnalytics = (obj: FieldErrorAnalyticsObject) => {\n this.submitAnalytics({\n type: ANALYTICS_VALIDATION_ERROR_STR,\n target: fieldTypeToSnakeCase(obj.fieldType),\n validationErrorCode: obj.errorCode,\n validationErrorMessage: getErrorMessageFromCode(obj.errorCode, SF_ErrorCodes)\n });\n };\n\n public onBinValue = triggerBinLookUp(this);\n\n get storePaymentMethodPayload() {\n const isStoredCard = this.props.storedPaymentMethodId?.length > 0;\n if (isStoredCard) {\n return {};\n }\n\n /**\n * For regular card, zero auth payments, we store the payment method, *if* the configuration says we should:\n * - For sessions, this means if the session has been created with storePaymentMethodMode: 'askForConsent'\n * - For the advanced flow, this means if the merchant has still set enableStoreDetails: true\n *\n * What we are doing is.. if for a normal payment we would show the \"Save for my next payment\" checkbox,\n * for a zero-auth payment we effectively click the checkbox on behalf of the shopper.\n */\n const isZeroAuth = this.props.amount?.value === 0;\n if (isZeroAuth) {\n return this.props.enableStoreDetails ? { storePaymentMethod: true } : {};\n }\n\n // For regular card, non-zero auth payments, we store the payment method based on the checkbox value.\n // const includeStorePaymentMethod = this.props.enableStoreDetails && typeof this.state.storePaymentMethod !== 'undefined';\n const includeStorePaymentMethod = this.props.showStoreDetailsCheckbox && typeof this.state.storePaymentMethod !== 'undefined';\n return includeStorePaymentMethod ? { storePaymentMethod: Boolean(this.state.storePaymentMethod) } : {};\n }\n\n get isValid() {\n return !!this.state.isValid;\n }\n\n get icon() {\n return this.props.icon ?? this.resources.getImage()(this.props.brand);\n }\n\n get brands(): { icon: any; name: string }[] {\n const { brands, brandsConfiguration } = this.props;\n if (brands) {\n return brands.map(brand => {\n const brandIcon = brandsConfiguration[brand]?.icon ?? this.props.modules.resources.getImage()(brand);\n return { icon: brandIcon, name: brand };\n });\n }\n\n return [];\n }\n\n get displayName(): string {\n if (this.props.storedPaymentMethodId) {\n return `•••• ${this.props.lastFour}`;\n }\n\n return this.props.name || CardElement.type;\n }\n\n get accessibleName(): string {\n // Use display name, unless it's a stored payment method, there inform user\n return (\n (this.props.name || CardElement.type) +\n (this.props.storedPaymentMethodId\n ? ' ' + this.props.i18n.get('creditCard.storedCard.description.ariaLabel').replace('%@', this.props.lastFour)\n : '')\n );\n }\n\n get browserInfo() {\n return collectBrowserInfo();\n }\n\n protected override payButton = (props: PayButtonFunctionProps) => {\n const isZeroAuth = this.props.amount?.value === 0;\n const isStoredCard = this.props.storedPaymentMethodId?.length > 0;\n return (\n <PayButton\n {...props}\n amount={this.props.amount}\n secondaryAmount={this.props.secondaryAmount}\n label={isZeroAuth && !isStoredCard ? this.props.i18n.get('payButton.saveDetails') : ''}\n onClick={this.submit}\n />\n );\n };\n\n private renderCardInput(isCardPrimaryInput = true): h.JSX.Element {\n return (\n <CardInput\n setComponentRef={this.setComponentRef}\n {...this.props}\n {...this.state}\n onChange={this.setState}\n onSubmit={this.submit}\n handleKeyPress={this.handleKeyPress}\n payButton={this.payButton}\n onBrand={this.onBrand}\n onBinValue={this.onBinValue}\n brand={this.props.brand}\n brandsIcons={this.brands}\n isPayButtonPrimaryVariant={isCardPrimaryInput}\n resources={this.resources}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onValidationErrorAnalytics={this.onValidationErrorAnalytics}\n onConfigSuccess={this.onConfigSuccess}\n />\n );\n }\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>\n <ClickToPayWrapper\n amount={this.props.amount}\n configuration={this.props.clickToPayConfiguration}\n clickToPayService={this.clickToPayService}\n isStandaloneComponent={false}\n setClickToPayRef={this.setClickToPayRef}\n onSetStatus={this.setElementStatus}\n onSubmit={this.handleClickToPaySubmit}\n onError={this.handleError}\n >\n {isCardPrimaryInput => this.renderCardInput(isCardPrimaryInput)}\n </ClickToPayWrapper>\n </SRPanelProvider>\n </CoreProvider>\n );\n }\n}\n\nexport default CardElement;\n"],"names":["CardElement","UIElement","static","TxVariants","scheme","clickToPayService","clickToPayRef","constructor","checkout","props","super","_disableClickToPay","this","createClickToPayService","configuration","clickToPayConfiguration","environment","initialize","showFormInstruction","doBinLookup","reject","from","CardInputDefaultProps","setStatus","status","componentRef","setClickToPayRef","ref","formatProps","enableStoreDetails","session","showStoreDetailsCheckbox","amount","value","storedCardID","storedPaymentMethodId","id","isEcommerceStoredCard","supportedShopperInteractions","includes","AdyenCheckoutError","IMPLEMENTATION_ERROR","holderNameRequired","hasHolderName","hasCVC","brand","hideCVC","billingAddressRequired","billingAddressMode","onAddressLookup","card","countryCode","toLowerCase","socialSecurityNumberMode","brandsConfiguration","icon","installmentOptions","disableOtpAutoFocus","shopperEmail","core","options","telephoneNumber","locale","i18n","replace","formatData","cardBrand","state","selectedBrandValue","paymentMethod","type","data","fundingSource","billingAddress","socialSecurityNumber","storePaymentMethodPayload","hasValidInstallmentsObject","installments","browserInfo","origin","window","location","updateStyles","stylesObj","setFocusOn","fieldName","onBrand","event","processBinLookupResponse","binLookupResponse","isReset","handleUnsupportedCard","errObj","handleClickToPaySubmit","payload","setState","valid","errors","isValid","submit","onBinLookup","obj","nuObj","submitAnalytics","analyticsObj","ANALYTICS_RENDERED_STR","ANALYTICS_CONFIGURED_STR","hasOwnProperty","isStoredPaymentMethod","onConfigSuccess","onFocus","ANALYTICS_FOCUS_STR","target","fieldTypeToSnakeCase","fieldType","ALL_SECURED_FIELDS","onBlur","ANALYTICS_UNFOCUS_STR","onValidationErrorAnalytics","ANALYTICS_VALIDATION_ERROR_STR","validationErrorCode","errorCode","validationErrorMessage","getErrorMessageFromCode","SF_ErrorCodes","onBinValue","triggerBinLookUp","length","storePaymentMethod","Boolean","resources","getImage","brands","map","modules","name","displayName","lastFour","accessibleName","get","collectBrowserInfo","payButton","isZeroAuth","isStoredCard","h","PayButton","secondaryAmount","label","onClick","renderCardInput","isCardPrimaryInput","CardInput","setComponentRef","onChange","onSubmit","handleKeyPress","brandsIcons","isPayButtonPrimaryVariant","render","CoreProvider","loadingContext","SRPanelProvider","srPanel","ClickToPayWrapper","isStandaloneComponent","onSetStatus","setElementStatus","onError","handleError"],"mappings":"m6CAmCO,MAAMA,UAAoBC,EAC7BC,YAAqBC,EAAWC,OAEfC,kBAKTC,cAAgB,KAExBC,WAAAA,CAAYC,EAAiBC,GACzBC,MAAMF,EAAUC,GAEZA,IAAUA,EAAME,qBAChBC,KAAKP,kBAAoBQ,EAAwBD,KAAKH,MAAMK,cAAeF,KAAKH,MAAMM,wBAAyBH,KAAKH,MAAMO,aACrHJ,KAAKP,mBAAmBY,aAErC,CAEAf,oBAAgC,CAC5BgB,qBAAqB,EACrBP,oBAAoB,EACpBQ,aAAa,KAEVC,EAAO,CAAC,OAAQ,oBAAoBC,KAAKC,IAGzCC,SAAAA,CAAUC,EAAyBf,GAOtC,OANIG,KAA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