@adyen/adyen-web 6.45.0 → 6.45.1

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 (232) hide show
  1. package/dist/cjs/adyen.css +12 -12
  2. package/dist/cjs/adyen.css.map +1 -1
  3. package/dist/cjs/index.cjs +2 -2
  4. package/dist/cjs/index.cjs.map +1 -1
  5. package/dist/cjs/index.d.cts +1983 -1924
  6. package/dist/es/adyen.css +12 -12
  7. package/dist/es/adyen.css.map +1 -1
  8. package/dist/es/components/ANCV/components/ANCVInput.js +1 -1
  9. package/dist/es/components/ANCV/components/ANCVInput.js.map +1 -1
  10. package/dist/es/components/Ach/Ach.js +1 -1
  11. package/dist/es/components/Ach/Ach.js.map +1 -1
  12. package/dist/es/components/Ach/components/AchComponent.js +1 -1
  13. package/dist/es/components/Ach/components/AchComponent.js.map +1 -1
  14. package/dist/es/components/AmazonPay/AmazonPay.js +1 -1
  15. package/dist/es/components/AmazonPay/AmazonPay.js.map +1 -1
  16. package/dist/es/components/BacsDD/BacsDD.js +1 -1
  17. package/dist/es/components/BacsDD/BacsDD.js.map +1 -1
  18. package/dist/es/components/BacsDD/components/BacsInput.js +1 -1
  19. package/dist/es/components/BacsDD/components/BacsInput.js.map +1 -1
  20. package/dist/es/components/BankTransfer/BankTransfer.js +1 -1
  21. package/dist/es/components/BankTransfer/BankTransfer.js.map +1 -1
  22. package/dist/es/components/BankTransfer/components/BankTransferInput/BankTransferInput.js +1 -1
  23. package/dist/es/components/BankTransfer/components/BankTransferInput/BankTransferInput.js.map +1 -1
  24. package/dist/es/components/Blik/Blik.js +1 -1
  25. package/dist/es/components/Blik/Blik.js.map +1 -1
  26. package/dist/es/components/Blik/components/BlikInput.js +1 -1
  27. package/dist/es/components/Blik/components/BlikInput.js.map +1 -1
  28. package/dist/es/components/Card/Card.js +1 -1
  29. package/dist/es/components/Card/Card.js.map +1 -1
  30. package/dist/es/components/Card/components/CardInput/types.js.map +1 -1
  31. package/dist/es/components/Card/components/ClickToPayHolder.js.map +1 -1
  32. package/dist/es/components/Card/components/ClickToPayWrapper.js +1 -1
  33. package/dist/es/components/Card/components/ClickToPayWrapper.js.map +1 -1
  34. package/dist/es/components/CashAppPay/CashAppPay.js +1 -1
  35. package/dist/es/components/CashAppPay/CashAppPay.js.map +1 -1
  36. package/dist/es/components/CustomCard/CustomCard.js +1 -1
  37. package/dist/es/components/CustomCard/CustomCard.js.map +1 -1
  38. package/dist/es/components/CustomCard/CustomCardInput/CustomCardInput.js.map +1 -1
  39. package/dist/es/components/Donation/Donation.js +1 -1
  40. package/dist/es/components/Donation/Donation.js.map +1 -1
  41. package/dist/es/components/Donation/components/DonationComponent.js +1 -1
  42. package/dist/es/components/Donation/components/DonationComponent.js.map +1 -1
  43. package/dist/es/components/Dropin/Dropin.js +1 -1
  44. package/dist/es/components/Dropin/Dropin.js.map +1 -1
  45. package/dist/es/components/Dropin/components/DropinComponent.js.map +1 -1
  46. package/dist/es/components/Giftcard/Giftcard.js.map +1 -1
  47. package/dist/es/components/Giftcard/components/GiftcardComponent.js.map +1 -1
  48. package/dist/es/components/Giropay/Giropay.js +1 -1
  49. package/dist/es/components/Giropay/Giropay.js.map +1 -1
  50. package/dist/es/components/MBWay/MBWay.js +1 -1
  51. package/dist/es/components/MBWay/MBWay.js.map +1 -1
  52. package/dist/es/components/MBWay/components/MBWayInput/MBWayInput.js +1 -1
  53. package/dist/es/components/MBWay/components/MBWayInput/MBWayInput.js.map +1 -1
  54. package/dist/es/components/Multibanco/Multibanco.js +1 -1
  55. package/dist/es/components/Multibanco/Multibanco.js.map +1 -1
  56. package/dist/es/components/PayByBankPix/PayByBankPix.js +1 -1
  57. package/dist/es/components/PayByBankPix/PayByBankPix.js.map +1 -1
  58. package/dist/es/components/PayByBankUS/PayByBankUS.js +1 -1
  59. package/dist/es/components/PayByBankUS/PayByBankUS.js.map +1 -1
  60. package/dist/es/components/PayTo/components/BSBInput.js +1 -1
  61. package/dist/es/components/PayTo/components/BSBInput.js.map +1 -1
  62. package/dist/es/components/PayTo/components/PayToNameFields.js +1 -1
  63. package/dist/es/components/PayTo/components/PayToNameFields.js.map +1 -1
  64. package/dist/es/components/PayTo/components/PayToPhone.js +1 -1
  65. package/dist/es/components/PayTo/components/PayToPhone.js.map +1 -1
  66. package/dist/es/components/Pix/Pix.js +1 -1
  67. package/dist/es/components/Pix/Pix.js.map +1 -1
  68. package/dist/es/components/Pix/components/PixInput/PixInput.js +1 -1
  69. package/dist/es/components/Pix/components/PixInput/PixInput.js.map +1 -1
  70. package/dist/es/components/PreAuthorizedDebitCanada/PreAuthorizedDebitCanada.js +1 -1
  71. package/dist/es/components/PreAuthorizedDebitCanada/PreAuthorizedDebitCanada.js.map +1 -1
  72. package/dist/es/components/PreAuthorizedDebitCanada/components/PreAuthorizedDebitCanadaComponent.js +1 -1
  73. package/dist/es/components/PreAuthorizedDebitCanada/components/PreAuthorizedDebitCanadaComponent.js.map +1 -1
  74. package/dist/es/components/Redirect/Redirect.js +1 -1
  75. package/dist/es/components/Redirect/Redirect.js.map +1 -1
  76. package/dist/es/components/Sepa/Sepa.js.map +1 -1
  77. package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  78. package/dist/es/components/Trustly/Trustly.js +1 -1
  79. package/dist/es/components/Trustly/Trustly.js.map +1 -1
  80. package/dist/es/components/helpers/IssuerListContainer/IssuerListContainer.js +1 -1
  81. package/dist/es/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
  82. package/dist/es/components/helpers/QRLoaderContainer/QRLoaderContainer.js +1 -1
  83. package/dist/es/components/helpers/QRLoaderContainer/QRLoaderContainer.js.map +1 -1
  84. package/dist/es/components/internal/Address/Specifications.js.map +1 -1
  85. package/dist/es/components/internal/Address/components/AddressSearch.js.map +1 -1
  86. package/dist/es/components/internal/Address/components/FieldContainer.js.map +1 -1
  87. package/dist/es/components/internal/BaseElement/BaseElement.js.map +1 -1
  88. package/dist/es/components/internal/ClickToPay/components/CtPLogin/CtPLoginInput.js +1 -1
  89. package/dist/es/components/internal/ClickToPay/components/CtPLogin/CtPLoginInput.js.map +1 -1
  90. package/dist/es/components/internal/ClickToPay/context/ClickToPayProvider.js.map +1 -1
  91. package/dist/es/components/internal/ClickToPay/services/sdks/AbstractSrcInitiator.js.map +1 -1
  92. package/dist/es/components/internal/ClickToPay/services/sdks/MastercardSdk.js.map +1 -1
  93. package/dist/es/components/internal/ClickToPay/services/sdks/VisaSdk.js.map +1 -1
  94. package/dist/es/components/internal/IbanInput/IbanInput.js +1 -1
  95. package/dist/es/components/internal/IbanInput/IbanInput.js.map +1 -1
  96. package/dist/es/components/internal/IbanInput/validate.js +1 -1
  97. package/dist/es/components/internal/IbanInput/validate.js.map +1 -1
  98. package/dist/es/components/internal/OpenInvoice/OpenInvoice.js +1 -1
  99. package/dist/es/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
  100. package/dist/es/components/internal/PhoneInput/PhoneInputForm.js +1 -1
  101. package/dist/es/components/internal/PhoneInput/PhoneInputForm.js.map +1 -1
  102. package/dist/es/components/internal/RedirectButton/RedirectButton.js +1 -1
  103. package/dist/es/components/internal/RedirectButton/RedirectButton.js.map +1 -1
  104. package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
  105. package/dist/es/components/internal/UIElement/UIElement.js +1 -1
  106. package/dist/es/components/internal/UIElement/UIElement.js.map +1 -1
  107. package/dist/es/components/internal/UIElement/utils.js +1 -1
  108. package/dist/es/components/internal/UIElement/utils.js.map +1 -1
  109. package/dist/es/core/config.js +1 -1
  110. package/dist/es/index.d.ts +1983 -1924
  111. package/dist/es/utils/Validator/Validator.js +1 -1
  112. package/dist/es/utils/Validator/Validator.js.map +1 -1
  113. package/dist/es/utils/useForm/reducer.js +1 -1
  114. package/dist/es/utils/useForm/reducer.js.map +1 -1
  115. package/dist/es/utils/useForm/useForm.js +1 -1
  116. package/dist/es/utils/useForm/useForm.js.map +1 -1
  117. package/dist/es/utils/useForm/useFormWithA11y.js +1 -1
  118. package/dist/es/utils/useForm/useFormWithA11y.js.map +1 -1
  119. package/dist/es-legacy/adyen.css +12 -12
  120. package/dist/es-legacy/adyen.css.map +1 -1
  121. package/dist/es-legacy/components/ANCV/components/ANCVInput.js +1 -1
  122. package/dist/es-legacy/components/ANCV/components/ANCVInput.js.map +1 -1
  123. package/dist/es-legacy/components/Ach/Ach.js +1 -1
  124. package/dist/es-legacy/components/Ach/Ach.js.map +1 -1
  125. package/dist/es-legacy/components/Ach/components/AchComponent.js +1 -1
  126. package/dist/es-legacy/components/Ach/components/AchComponent.js.map +1 -1
  127. package/dist/es-legacy/components/AmazonPay/AmazonPay.js +1 -1
  128. package/dist/es-legacy/components/AmazonPay/AmazonPay.js.map +1 -1
  129. package/dist/es-legacy/components/BacsDD/BacsDD.js +1 -1
  130. package/dist/es-legacy/components/BacsDD/BacsDD.js.map +1 -1
  131. package/dist/es-legacy/components/BacsDD/components/BacsInput.js +1 -1
  132. package/dist/es-legacy/components/BacsDD/components/BacsInput.js.map +1 -1
  133. package/dist/es-legacy/components/BankTransfer/BankTransfer.js +1 -1
  134. package/dist/es-legacy/components/BankTransfer/BankTransfer.js.map +1 -1
  135. package/dist/es-legacy/components/BankTransfer/components/BankTransferInput/BankTransferInput.js +1 -1
  136. package/dist/es-legacy/components/BankTransfer/components/BankTransferInput/BankTransferInput.js.map +1 -1
  137. package/dist/es-legacy/components/Blik/Blik.js +1 -1
  138. package/dist/es-legacy/components/Blik/Blik.js.map +1 -1
  139. package/dist/es-legacy/components/Blik/components/BlikInput.js +1 -1
  140. package/dist/es-legacy/components/Blik/components/BlikInput.js.map +1 -1
  141. package/dist/es-legacy/components/Card/Card.js +1 -1
  142. package/dist/es-legacy/components/Card/Card.js.map +1 -1
  143. package/dist/es-legacy/components/Card/components/CardInput/types.js.map +1 -1
  144. package/dist/es-legacy/components/Card/components/ClickToPayHolder.js.map +1 -1
  145. package/dist/es-legacy/components/Card/components/ClickToPayWrapper.js +1 -1
  146. package/dist/es-legacy/components/Card/components/ClickToPayWrapper.js.map +1 -1
  147. package/dist/es-legacy/components/CashAppPay/CashAppPay.js +1 -1
  148. package/dist/es-legacy/components/CashAppPay/CashAppPay.js.map +1 -1
  149. package/dist/es-legacy/components/CustomCard/CustomCard.js +1 -1
  150. package/dist/es-legacy/components/CustomCard/CustomCard.js.map +1 -1
  151. package/dist/es-legacy/components/CustomCard/CustomCardInput/CustomCardInput.js.map +1 -1
  152. package/dist/es-legacy/components/Donation/Donation.js +1 -1
  153. package/dist/es-legacy/components/Donation/Donation.js.map +1 -1
  154. package/dist/es-legacy/components/Donation/components/DonationComponent.js +1 -1
  155. package/dist/es-legacy/components/Donation/components/DonationComponent.js.map +1 -1
  156. package/dist/es-legacy/components/Dropin/Dropin.js +1 -1
  157. package/dist/es-legacy/components/Dropin/Dropin.js.map +1 -1
  158. package/dist/es-legacy/components/Dropin/components/DropinComponent.js.map +1 -1
  159. package/dist/es-legacy/components/Giftcard/Giftcard.js.map +1 -1
  160. package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js.map +1 -1
  161. package/dist/es-legacy/components/Giropay/Giropay.js +1 -1
  162. package/dist/es-legacy/components/Giropay/Giropay.js.map +1 -1
  163. package/dist/es-legacy/components/MBWay/MBWay.js +1 -1
  164. package/dist/es-legacy/components/MBWay/MBWay.js.map +1 -1
  165. package/dist/es-legacy/components/MBWay/components/MBWayInput/MBWayInput.js +1 -1
  166. package/dist/es-legacy/components/MBWay/components/MBWayInput/MBWayInput.js.map +1 -1
  167. package/dist/es-legacy/components/Multibanco/Multibanco.js +1 -1
  168. package/dist/es-legacy/components/Multibanco/Multibanco.js.map +1 -1
  169. package/dist/es-legacy/components/PayByBankPix/PayByBankPix.js +1 -1
  170. package/dist/es-legacy/components/PayByBankPix/PayByBankPix.js.map +1 -1
  171. package/dist/es-legacy/components/PayByBankUS/PayByBankUS.js +1 -1
  172. package/dist/es-legacy/components/PayByBankUS/PayByBankUS.js.map +1 -1
  173. package/dist/es-legacy/components/PayTo/components/BSBInput.js +1 -1
  174. package/dist/es-legacy/components/PayTo/components/BSBInput.js.map +1 -1
  175. package/dist/es-legacy/components/PayTo/components/PayToNameFields.js +1 -1
  176. package/dist/es-legacy/components/PayTo/components/PayToNameFields.js.map +1 -1
  177. package/dist/es-legacy/components/PayTo/components/PayToPhone.js +1 -1
  178. package/dist/es-legacy/components/PayTo/components/PayToPhone.js.map +1 -1
  179. package/dist/es-legacy/components/Pix/Pix.js +1 -1
  180. package/dist/es-legacy/components/Pix/Pix.js.map +1 -1
  181. package/dist/es-legacy/components/Pix/components/PixInput/PixInput.js +1 -1
  182. package/dist/es-legacy/components/Pix/components/PixInput/PixInput.js.map +1 -1
  183. package/dist/es-legacy/components/PreAuthorizedDebitCanada/PreAuthorizedDebitCanada.js +1 -1
  184. package/dist/es-legacy/components/PreAuthorizedDebitCanada/PreAuthorizedDebitCanada.js.map +1 -1
  185. package/dist/es-legacy/components/PreAuthorizedDebitCanada/components/PreAuthorizedDebitCanadaComponent.js +1 -1
  186. package/dist/es-legacy/components/PreAuthorizedDebitCanada/components/PreAuthorizedDebitCanadaComponent.js.map +1 -1
  187. package/dist/es-legacy/components/Redirect/Redirect.js +1 -1
  188. package/dist/es-legacy/components/Redirect/Redirect.js.map +1 -1
  189. package/dist/es-legacy/components/Sepa/Sepa.js.map +1 -1
  190. package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  191. package/dist/es-legacy/components/Trustly/Trustly.js +1 -1
  192. package/dist/es-legacy/components/Trustly/Trustly.js.map +1 -1
  193. package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js +1 -1
  194. package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
  195. package/dist/es-legacy/components/helpers/QRLoaderContainer/QRLoaderContainer.js +1 -1
  196. package/dist/es-legacy/components/helpers/QRLoaderContainer/QRLoaderContainer.js.map +1 -1
  197. package/dist/es-legacy/components/internal/Address/Specifications.js.map +1 -1
  198. package/dist/es-legacy/components/internal/Address/components/AddressSearch.js.map +1 -1
  199. package/dist/es-legacy/components/internal/Address/components/FieldContainer.js.map +1 -1
  200. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js.map +1 -1
  201. package/dist/es-legacy/components/internal/ClickToPay/components/CtPLogin/CtPLoginInput.js +1 -1
  202. package/dist/es-legacy/components/internal/ClickToPay/components/CtPLogin/CtPLoginInput.js.map +1 -1
  203. package/dist/es-legacy/components/internal/ClickToPay/context/ClickToPayProvider.js.map +1 -1
  204. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/AbstractSrcInitiator.js.map +1 -1
  205. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/MastercardSdk.js.map +1 -1
  206. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/VisaSdk.js.map +1 -1
  207. package/dist/es-legacy/components/internal/IbanInput/IbanInput.js +1 -1
  208. package/dist/es-legacy/components/internal/IbanInput/IbanInput.js.map +1 -1
  209. package/dist/es-legacy/components/internal/IbanInput/validate.js +1 -1
  210. package/dist/es-legacy/components/internal/IbanInput/validate.js.map +1 -1
  211. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js +1 -1
  212. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
  213. package/dist/es-legacy/components/internal/PhoneInput/PhoneInputForm.js +1 -1
  214. package/dist/es-legacy/components/internal/PhoneInput/PhoneInputForm.js.map +1 -1
  215. package/dist/es-legacy/components/internal/RedirectButton/RedirectButton.js +1 -1
  216. package/dist/es-legacy/components/internal/RedirectButton/RedirectButton.js.map +1 -1
  217. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
  218. package/dist/es-legacy/components/internal/UIElement/UIElement.js +1 -1
  219. package/dist/es-legacy/components/internal/UIElement/UIElement.js.map +1 -1
  220. package/dist/es-legacy/components/internal/UIElement/utils.js +1 -1
  221. package/dist/es-legacy/components/internal/UIElement/utils.js.map +1 -1
  222. package/dist/es-legacy/core/config.js +1 -1
  223. package/dist/es-legacy/utils/Validator/Validator.js +1 -1
  224. package/dist/es-legacy/utils/Validator/Validator.js.map +1 -1
  225. package/dist/es-legacy/utils/useForm/reducer.js +1 -1
  226. package/dist/es-legacy/utils/useForm/reducer.js.map +1 -1
  227. package/dist/es-legacy/utils/useForm/useForm.js +1 -1
  228. package/dist/es-legacy/utils/useForm/useForm.js.map +1 -1
  229. package/dist/es-legacy/utils/useForm/useFormWithA11y.js +1 -1
  230. package/dist/es-legacy/utils/useForm/useFormWithA11y.js.map +1 -1
  231. package/package.json +10 -10
  232. package/styles/adyen.css +12 -12
@@ -1,7 +1,7 @@
1
1
  /// <reference types="applepayjs" />
2
2
  /// <reference types="googlepay" />
3
3
  import * as preact from 'preact';
4
- import { h, TargetedMouseEvent, Ref, RefObject, Component, ComponentChildren, FunctionComponent, ComponentChild, TargetedKeyboardEvent } from 'preact';
4
+ import { Component, RefObject, Ref, ComponentChildren, h, TargetedMouseEvent, ComponentChild, FunctionComponent, TargetedKeyboardEvent } from 'preact';
5
5
  import { OrderResponseBody, OnShippingAddressChangeData, OnShippingOptionsChangeData, OnInitActions } from '@paypal/paypal-js';
6
6
 
7
7
  interface ILanguageService {
@@ -118,12 +118,15 @@ interface FieldContext {
118
118
 
119
119
  type OnAddressLookupType = (value: string, actions: {
120
120
  resolve: (value: Array<AddressLookupItem>) => void;
121
- reject: (reason?: any) => void;
121
+ reject: (reason?: RejectionReason) => void;
122
122
  }) => Promise<void>;
123
123
  type OnAddressSelectedType = (value: AddressLookupItem, actions: {
124
124
  resolve: (value: AddressLookupItem) => void;
125
- reject: (reason?: any) => void;
125
+ reject: (reason?: RejectionReason) => void;
126
126
  }) => Promise<void>;
127
+ interface RejectionReason {
128
+ errorMessage: string;
129
+ }
127
130
 
128
131
  type StringObject = {
129
132
  [key: string]: string;
@@ -140,7 +143,6 @@ interface AddressProps {
140
143
  onAddressSelected?: OnAddressSelectedType;
141
144
  addressSearchDebounceMs?: number;
142
145
  requiredFields?: string[];
143
- ref?: any;
144
146
  specifications?: AddressSpecifications;
145
147
  validationRules?: ValidatorRules;
146
148
  visibility?: string;
@@ -262,1506 +264,1904 @@ interface InstallmentOptions {
262
264
  [key: string]: InstallmentOption;
263
265
  }
264
266
 
265
- type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'action' | 'link' | 'iconOnly';
266
- interface ButtonProps {
267
- status?: string;
268
- /**
269
- * Class name modifiers will be used as: `adyen-checkout__button--${modifier}`
270
- */
271
- classNameModifiers?: string[];
272
- variant?: ButtonVariant;
273
- disabled?: boolean;
274
- label?: string | h.JSX.Element;
275
- onClickCompletedLabel?: string | h.JSX.Element;
276
- id?: string;
277
- ariaLabel?: string;
278
- ariaLabelledBy?: string;
279
- ariaDescribedBy?: string;
280
- ariaExpanded?: boolean;
281
- ariaControls?: string;
282
- secondaryLabel?: string;
283
- icon?: string;
284
- onClickCompletedIcon?: string;
285
- inline?: boolean;
286
- href?: string;
287
- target?: string;
288
- rel?: string;
289
- onClick?: (e: TargetedMouseEvent<HTMLButtonElement | HTMLAnchorElement>, callbacks?: {
290
- complete?: () => void;
291
- }) => void;
292
- onKeyDown?: (event: KeyboardEvent) => void;
293
- buttonRef?: Ref<HTMLButtonElement>;
294
- onMouseEnter?: (event: MouseEvent) => void;
295
- onMouseLeave?: (event: MouseEvent) => void;
296
- onFocus?: (event: FocusEvent) => void;
297
- onBlur?: (event: FocusEvent) => void;
267
+ interface TouchStartEventObj {
268
+ fieldType: string;
269
+ name?: string;
298
270
  }
299
271
 
300
- interface PayButtonProps extends ButtonProps {
301
- /**
302
- * Class name modifiers will be used as: `adyen-checkout__image--${modifier}`
303
- */
304
- classNameModifiers?: string[];
305
- /**
306
- * Custom amount that can be passed to the button.
307
- * This is useful when the amount is not available in the amount provider, such as Giftcard scenario where
308
- * we need to display the remaining amount
309
- */
310
- customAmount?: PaymentAmount;
272
+ type PlaceholderKeys$1 = 'cardNumber' | 'securityCode' | 'expiryDate';
273
+ type Placeholders$1 = Partial<Record<PlaceholderKeys$1, string>>;
274
+ type GiftcardFieldsProps = {
275
+ setRootNode: (input: HTMLElement) => void;
276
+ i18n: Language;
277
+ pinRequired: boolean;
278
+ sfpState: SFPState;
279
+ getCardErrorMessage: any;
280
+ focusedElement: any;
281
+ setFocusOn: any;
311
282
  label?: string;
312
- status?: string;
313
- disabled?: boolean;
314
- icon?: string;
315
- showReview?: boolean;
316
- }
317
-
318
- type AchForm = {
319
- selectedAccountType: string;
320
- ownerName: string;
321
- routingNumber: string;
322
- accountNumber: string;
323
- accountNumberVerification: string;
324
283
  };
325
- type AchFormPrefillData = Partial<Pick<AchForm, 'ownerName'>>;
326
284
 
327
- interface AchConfiguration extends UIElementProps {
328
- /**
329
- * Pre-fill ACH form with shopper data
330
- */
331
- data?: AchFormPrefillData;
332
- /**
333
- * Adds placeholder text to the input fields
334
- */
335
- placeholders?: AchPlaceholders;
336
- /**
337
- * Set to false to hide the "Account Holder Name" field if you want to pass the data yourself
338
- * @default true
339
- */
340
- hasHolderName?: boolean;
341
- /**
342
- * Enables storing the payment method using the Checkbox
343
- * @default false
344
- */
345
- enableStoreDetails?: boolean;
285
+ declare enum AnalyticsEventCategory {
286
+ info = "info",
287
+ error = "error",
288
+ log = "log"
289
+ }
290
+ declare abstract class AbstractAnalyticsEvent {
291
+ private readonly timestamp;
292
+ private readonly id;
346
293
  /**
347
- * storedPaymentMethodId coming from a stored ACH in /paymentMethods response
348
- * @internal
294
+ * Component tx variant or identifier
295
+ * @private
349
296
  */
350
- storedPaymentMethodId?: string;
297
+ private readonly component;
298
+ abstract getEventCategory(): AnalyticsEventCategory;
299
+ protected constructor(component: string);
300
+ }
301
+
302
+ /**
303
+ * SecuredFieldsProvider:
304
+ * Initialises & handles the client-side part of SecuredFields
305
+ */
306
+ declare class SecuredFieldsProvider extends Component<SFPProps, SFPState> {
307
+ private readonly csfLoadFailTimeout;
308
+ private readonly csfLoadFailTimeoutMS;
309
+ private readonly csfConfigFailTimeout;
310
+ private readonly csfConfigFailTimeoutMS;
311
+ private numCharsInField;
312
+ private rootNode;
313
+ private numDateFields;
314
+ private csf;
315
+ private readonly handleOnLoad;
316
+ private readonly handleOnConfigSuccess;
317
+ private readonly handleOnFieldValid;
318
+ private readonly handleOnAllValid;
319
+ private readonly handleOnBrand;
320
+ private readonly handleFocus;
321
+ private readonly handleOnError;
322
+ private readonly handleOnAutoComplete;
323
+ private readonly handleOnNoDataRequired;
324
+ private readonly handleOnTouchstartIOS;
325
+ private readonly handleKeyDown;
326
+ state: SFPState;
327
+ props: SFPProps;
328
+ private issuingCountryCode;
329
+ constructor(props: SFPProps);
330
+ static readonly defaultProps: {
331
+ type: string;
332
+ keypadFix: boolean;
333
+ rootNode: any;
334
+ loadingContext: any;
335
+ brands: any[];
336
+ showWarnings: boolean;
337
+ autoFocus: boolean;
338
+ trimTrailingSeparator: boolean;
339
+ onChange: () => void;
340
+ onLoad: () => void;
341
+ onConfigSuccess: () => void;
342
+ onAllValid: () => void;
343
+ onFieldValid: () => void;
344
+ onBrand: () => void;
345
+ onError: () => void;
346
+ onBinValue: () => void;
347
+ onFocus: () => void;
348
+ onAutoComplete: () => void;
349
+ handleKeyDown: () => void;
350
+ styles: {};
351
+ };
352
+ componentDidMount(): void;
353
+ componentDidUpdate(): void;
354
+ componentWillUnmount(): void;
355
+ private initializeCSF;
356
+ private checkForKCPFields;
357
+ getChildContext(): object;
358
+ handleUnsupportedCard(errObj: CardErrorData): boolean;
359
+ setFocusOn(frame: SFFieldType): void;
360
+ updateStyles(stylesObj: StylesObject): void;
361
+ sfIsOptionalOrHidden(fieldType: string): boolean;
362
+ destroy(): void;
363
+ getRootNode(): HTMLElement;
364
+ showValidation(): void;
351
365
  /**
352
- * bankAccountNumber coming from a stored ACH in /paymentMethods response
353
- * @internal
366
+ * Map SF errors to ValidationRuleResult-like objects, for CardInput component
354
367
  */
355
- bankAccountNumber?: string;
356
- }
357
- interface AchPlaceholders {
358
- accountTypeSelector?: string;
359
- ownerName?: string;
360
- routingNumber?: string;
361
- accountNumber?: string;
362
- accountNumberVerification?: string;
368
+ mapErrorsToValidationRuleResult(): SFStateErrorObj;
369
+ processBinLookupResponse(binLookupResponse: BinLookupResponse, resetObject: SingleBrandResetObject): void;
370
+ private readonly setRootNode;
371
+ render(props: any, state: SFPState): any;
363
372
  }
364
373
 
365
- declare const SUPPORTED_LOCALES_EU: readonly ["en_GB", "de_DE", "fr_FR", "it_IT", "es_ES"];
366
- declare const SUPPORTED_LOCALES_US: readonly ["en_US"];
367
-
368
- declare enum TxVariants {
369
- /** internal */
370
- address = "address",
371
- bankTransfer_IBAN = "bankTransfer_IBAN",
372
- bankTransfer_BE = "bankTransfer_BE",
373
- bankTransfer_NL = "bankTransfer_NL",
374
- bankTransfer_PL = "bankTransfer_PL",
375
- bankTransfer_FR = "bankTransfer_FR",
376
- bankTransfer_CH = "bankTransfer_CH",
377
- bankTransfer_IE = "bankTransfer_IE",
378
- bankTransfer_GB = "bankTransfer_GB",
379
- bankTransfer_DE = "bankTransfer_DE",
380
- bankTransfer_AE = "bankTransfer_AE",
381
- bankTransfer_AT = "bankTransfer_AT",
382
- bankTransfer_AU = "bankTransfer_AU",
383
- bankTransfer_BG = "bankTransfer_BG",
384
- bankTransfer_CA = "bankTransfer_CA",
385
- bankTransfer_EE = "bankTransfer_EE",
386
- bankTransfer_ES = "bankTransfer_ES",
387
- bankTransfer_FI = "bankTransfer_FI",
388
- bankTransfer_HK = "bankTransfer_HK",
389
- bankTransfer_HU = "bankTransfer_HU",
390
- bankTransfer_IT = "bankTransfer_IT",
391
- bankTransfer_JP = "bankTransfer_JP",
392
- bankTransfer_LU = "bankTransfer_LU",
393
- bankTransfer_NZ = "bankTransfer_NZ",
394
- bankTransfer_PT = "bankTransfer_PT",
395
- bankTransfer_SG = "bankTransfer_SG",
396
- bankTransfer_SK = "bankTransfer_SK",
397
- bankTransfer_US = "bankTransfer_US",
398
- donation = "donation",
399
- personal_details = "personal_details",
400
- dropin = "dropin",
401
- /** internal */
402
- /** Card */
403
- bcmc = "bcmc",
404
- card = "card",
405
- scheme = "scheme",
406
- storedCard = "storedCard",
407
- customCard = "customcard",
408
- /** Card */
409
- /** ThreeDS */
410
- threeDS2Challenge = "threeDS2Challenge",
411
- threeDS2Fingerprint = "threeDS2Fingerprint",
412
- threeDS2DeviceFingerprint = "threeDS2DeviceFingerprint",
413
- /** ThreeDS */
414
- /** Direct debit */
415
- ach = "ach",
416
- directdebit_GB = "directdebit_GB",
417
- sepadirectdebit = "sepadirectdebit",
418
- eft_directdebit_CA = "eft_directdebit_CA",
419
- /** Direct debit */
420
- /** Open Invoice */
421
- affirm = "affirm",
422
- afterpay = "afterpay",
423
- afterpay_default = "afterpay_default",
424
- afterpay_b2b = "afterpay_b2b",
425
- atome = "atome",
426
- facilypay_3x = "facilypay_3x",
427
- facilypay_4x = "facilypay_4x",
428
- facilypay_6x = "facilypay_6x",
429
- facilypay_10x = "facilypay_10x",
430
- facilypay_12x = "facilypay_12x",
431
- ratepay = "ratepay",
432
- ratepay_directdebit = "ratepay_directdebit",
433
- /** Open Invoice */
434
- /** Wallets */
435
- amazonpay = "amazonpay",
436
- applepay = "applepay",
437
- cashapp = "cashapp",
438
- clicktopay = "clicktopay",
439
- googlepay = "googlepay",
440
- paypal = "paypal",
441
- fastlane = "fastlane",
442
- paywithgoogle = "paywithgoogle",
443
- /** Wallets */
444
- /** Voucher */
445
- boletobancario = "boletobancario",
446
- boletobancario_itau = "boletobancario_itau",
447
- boletobancario_santander = "boletobancario_santander",
448
- primeiropay_boleto = "primeiropay_boleto",
449
- doku = "doku",
450
- doku_alfamart = "doku_alfamart",
451
- doku_permata_lite_atm = "doku_permata_lite_atm",
452
- doku_indomaret = "doku_indomaret",
453
- doku_atm_mandiri_va = "doku_atm_mandiri_va",
454
- doku_sinarmas_va = "doku_sinarmas_va",
455
- doku_mandiri_va = "doku_mandiri_va",
456
- doku_cimb_va = "doku_cimb_va",
457
- doku_danamon_va = "doku_danamon_va",
458
- doku_bri_va = "doku_bri_va",
459
- doku_bni_va = "doku_bni_va",
460
- doku_bca_va = "doku_bca_va",
461
- doku_wallet = "doku_wallet",
462
- oxxo = "oxxo",
463
- /** Voucher */
464
- /** issuerList */
465
- billdesk_online = "billdesk_online",
466
- billdesk_wallet = "billdesk_wallet",
467
- dotpay = "dotpay",
468
- eps = "eps",
469
- iris = "iris",
470
- molpay_ebanking_fpx_MY = "molpay_ebanking_fpx_MY",
471
- molpay_ebanking_TH = "molpay_ebanking_TH",
472
- molpay_ebanking_VN = "molpay_ebanking_VN",
473
- onlineBanking_CZ = "onlineBanking_CZ",
474
- onlinebanking_IN = "onlinebanking_IN",
475
- onlineBanking_PL = "onlineBanking_PL",
476
- onlineBanking_SK = "onlineBanking_SK",
477
- paybybank = "paybybank",
478
- payu_IN_cashcard = "payu_IN_cashcard",
479
- payu_IN_nb = "payu_IN_nb",
480
- wallet_IN = "wallet_IN",
481
- /** issuerList */
482
- /** Dragonpay */
483
- dragonpay = "dragonpay",
484
- dragonpay_ebanking = "dragonpay_ebanking",
485
- dragonpay_otc_banking = "dragonpay_otc_banking",
486
- dragonpay_otc_non_banking = "dragonpay_otc_non_banking",
487
- dragonpay_otc_philippines = "dragonpay_otc_philippines",
488
- /** Dragonpay */
489
- /** Econtext */
490
- econtext = "econtext",
491
- econtext_atm = "econtext_atm",
492
- econtext_online = "econtext_online",
493
- econtext_seven_eleven = "econtext_seven_eleven",
494
- econtext_stores = "econtext_stores",
495
- /** Econtext */
496
- /** Redirect */
497
- giropay = "giropay",
498
- multibanco = "multibanco",
499
- redirect = "redirect",
500
- twint = "twint",
501
- vipps = "vipps",
502
- trustly = "trustly",
503
- paybybank_AIS_DD = "paybybank_AIS_DD",
504
- riverty = "riverty",
505
- paybybank_pix = "paybybank_pix",
506
- /** Redirect */
507
- /** Klarna */
508
- klarna = "klarna",
509
- klarna_account = "klarna_account",
510
- klarna_paynow = "klarna_paynow",
511
- klarna_b2b = "klarna_b2b",
512
- /** Klarna */
513
- /** QRLoader */
514
- bcmc_mobile = "bcmc_mobile",
515
- bcmc_mobile_QR = "bcmc_mobile_QR",
516
- pix = "pix",
517
- swish = "swish",
518
- wechatpay = "wechatpay",
519
- wechatpayQR = "wechatpayQR",
520
- promptpay = "promptpay",
521
- paynow = "paynow",
522
- duitnow = "duitnow",
523
- /** QRLoader */
524
- /** Await */
525
- blik = "blik",
526
- mbway = "mbway",
527
- ancv = "ancv",
528
- payto = "payto",
529
- upi = "upi",// also QR
530
- upi_qr = "upi_qr",// also QR
531
- upi_intent = "upi_intent",// also QR
532
- /** Await */
533
- /** Giftcard */
534
- giftcard = "giftcard",
535
- mealVoucher_FR = "mealVoucher_FR",
536
- mealVoucher_FR_natixis = "mealVoucher_FR_natixis",
537
- mealVoucher_FR_sodexo = "mealVoucher_FR_sodexo",
538
- mealVoucher_FR_groupeup = "mealVoucher_FR_groupeup"
539
- /** Giftcard */
374
+ type Placeholders = CardPlaceholders | Placeholders$1;
375
+ /**
376
+ * Should be the only props that can be sent to SFP (from CardInput, SecuredFieldsInput, GiftcardComponent)
377
+ */
378
+ interface SFPProps {
379
+ ref?: Ref<SecuredFieldsProvider>;
380
+ autoFocus?: boolean;
381
+ brands?: string[];
382
+ brandsConfiguration?: CardBrandsConfiguration;
383
+ clientKey: string;
384
+ componentType: string;
385
+ countryCode?: string;
386
+ forceCompat?: boolean;
387
+ hasKoreanFields?: boolean;
388
+ i18n?: Language;
389
+ implementationType?: 'components' | 'custom';
390
+ keypadFix?: boolean;
391
+ koreanAuthenticationRequired?: boolean;
392
+ legacyInputMode?: boolean;
393
+ loadingContext: string;
394
+ minimumExpiryDate?: string;
395
+ onAdditionalSFConfig?: () => void;
396
+ onAdditionalSFRemoved?: () => void;
397
+ onAllValid?: (obj: CardAllValidData) => void;
398
+ onAutoComplete?: (obj: CardAutoCompleteData) => void;
399
+ onBinValue?: (obj: CardBinValueData) => void;
400
+ onBrand?: (obj: CardBrandData) => void;
401
+ onChange?: (state: SFPState, eventDetails?: OnChangeEventDetails) => void;
402
+ onConfigSuccess?: (cbObj: CardConfigSuccessData) => void;
403
+ onError?: (error: AdyenCheckoutError) => void;
404
+ onFieldValid?: (fieldObj: CardFieldValidData) => void;
405
+ onFocus?: (obj: CardFocusData) => void;
406
+ onLoad?: (cbObj: CardLoadData) => void;
407
+ onStateUpdate?: (obj: SFPState) => void;
408
+ onSubmitAnalytics?: (event: AbstractAnalyticsEvent) => void;
409
+ handleKeyDown?: (event: KeyboardEvent) => void;
410
+ rootNode?: HTMLElement;
411
+ showWarnings?: boolean;
412
+ styles?: StylesObject;
413
+ trimTrailingSeparator?: boolean;
414
+ type: string;
415
+ render?: (helpers: {
416
+ setRootNode: (input: HTMLElement) => void;
417
+ setFocusOn: (fieldName: string) => void;
418
+ }, state: SFPState) => ComponentChildren;
419
+ resources?: Resources;
420
+ maskSecurityCode?: boolean;
421
+ exposeExpiryDate?: boolean;
422
+ disableIOSArrowKeys?: (obj: TouchStartEventObj) => void | null;
423
+ placeholders?: Placeholders;
424
+ showContextualElement?: boolean;
540
425
  }
541
-
542
- declare class AmazonPayElement extends UIElement<AmazonPayConfiguration> {
543
- static readonly type = TxVariants.amazonpay;
544
- protected static readonly defaultProps: Partial<AmazonPayConfiguration>;
545
- formatProps(props: any): any;
546
- /**
547
- * Formats the component data output
548
- */
549
- formatData(): AmazonPayElementData;
550
- protected beforeRender(configSetByMerchant?: AmazonPayConfiguration): void;
551
- getShopperDetails(): void | Promise<{
552
- declineFlowUrl?: string;
553
- } & Record<string, unknown>>;
554
- handleDeclineFlow(): void;
555
- get isValid(): boolean;
556
- get browserInfo(): BrowserInfo;
557
- submit(): void;
558
- protected componentToRender(): h.JSX.Element;
426
+ type SFPErrorMap = Partial<Record<SFFieldType, string>>;
427
+ interface SFPState {
428
+ status?: string;
429
+ brand?: string;
430
+ errors?: SFPErrorMap;
431
+ valid: SFPValid;
432
+ data: object;
433
+ cvcPolicy?: CVCPolicyType;
434
+ isSfpValid?: boolean;
435
+ autoCompleteName?: string;
436
+ billingAddress?: AddressData;
437
+ detectedUnsupportedBrands?: string[];
438
+ hasKoreanFields?: boolean;
439
+ showSocialSecurityNumber?: boolean;
440
+ expiryDatePolicy?: DatePolicyType;
441
+ socialSecurityNumber?: string;
559
442
  }
443
+ interface SingleBrandResetObject {
444
+ brand: string;
445
+ cvcPolicy: CVCPolicyType;
446
+ }
447
+ interface SFPValid {
448
+ encryptedCardNumber?: boolean;
449
+ encryptedExpiryMonth?: boolean;
450
+ encryptedExpiryYear?: boolean;
451
+ encryptedSecurityCode?: boolean;
452
+ encryptedPassword?: boolean;
453
+ encryptedPin?: boolean;
454
+ }
455
+ interface OnChangeEventDetails {
456
+ event: string;
457
+ fieldType?: string;
458
+ }
459
+ type SecuredFieldsProviderRef = RefObject<SecuredFieldsProvider>;
560
460
 
561
- type ButtonColor = 'Gold' | 'LightGray' | 'DarkGray';
562
- type Placement = 'Home' | 'Product' | 'Cart' | 'Checkout' | 'Other';
563
- type ProductType = 'PayOnly' | 'PayAndShip';
564
- type ChargePermissionType = 'OneTime' | 'Recurring';
565
- type FrequencyUnit = 'Year' | 'Month' | 'Week' | 'Day' | 'Variable';
566
- type Currency = 'EUR' | 'GBP' | 'USD';
567
- type Region = 'EU' | 'UK' | 'US';
568
- type SupportedLocale = (typeof SUPPORTED_LOCALES_EU)[number] | (typeof SUPPORTED_LOCALES_US)[number];
569
- interface AmazonPayButtonInstance {
570
- onClick(handler: () => void): void;
461
+ /** A list of all the data-cse attributes that relate to securedFields (as found in card, giftcard) */
462
+ declare const ALL_SECURED_FIELDS: readonly ["encryptedCardNumber", "encryptedExpiryDate", "encryptedExpiryMonth", "encryptedExpiryYear", "encryptedSecurityCode", "encryptedPassword"];
463
+ declare const REQUIRED = "required";
464
+ declare const OPTIONAL = "optional";
465
+ declare const HIDDEN = "hidden";
466
+ declare const BEST_GUESS_MODE = "best-guess";
467
+ declare const BIN_LOOKUP_MODE = "bin-lookup";
468
+
469
+ declare global {
470
+ interface Window {
471
+ _b$dl: boolean;
472
+ mockBinCount: number;
473
+ }
571
474
  }
572
- interface AmazonWindowObject {
573
- Pay: {
574
- renderButton(selector: string, settings: AmazonPayButtonSettings): AmazonPayButtonInstance;
575
- initCheckout(options: AmazonPayButtonSettings & {
576
- createCheckoutSessionConfig: CheckoutSessionConfig;
577
- }): void;
578
- signout(): void;
579
- bindChangeAction(selector: string, options: ChangeActionOptions): void;
580
- };
475
+ type SFFieldType = (typeof ALL_SECURED_FIELDS)[number];
476
+ type BrandModeType = typeof BIN_LOOKUP_MODE | typeof BEST_GUESS_MODE;
477
+ interface StylesObject {
478
+ base?: StyleDefinitions;
479
+ error?: StyleDefinitions;
480
+ validated?: StyleDefinitions;
481
+ placeholder?: StyleDefinitions;
581
482
  }
582
- interface RecurringMetadata {
583
- frequency: {
584
- unit: string;
585
- value: FrequencyUnit;
586
- };
587
- amount: {
588
- amount: string;
589
- currencyCode: Currency;
590
- };
483
+ interface StyleDefinitions {
484
+ background?: string;
485
+ caretColor?: string;
486
+ color?: string;
487
+ display?: string;
488
+ font?: string;
489
+ fontFamily?: string;
490
+ fontSize?: string;
491
+ fontSizeAdjust?: string;
492
+ fontSmoothing?: string;
493
+ fontStretch?: string;
494
+ fontStyle?: string;
495
+ fontVariant?: string;
496
+ fontVariantAlternates?: string;
497
+ fontVariantCaps?: string;
498
+ fontVariantEastAsian?: string;
499
+ fontVariantLigatures?: string;
500
+ fontVariantNumeric?: string;
501
+ fontWeight?: string;
502
+ letterSpacing?: string;
503
+ lineHeight?: string;
504
+ mozOsxFontSmoothing?: string;
505
+ mozTransition?: string;
506
+ outline?: string;
507
+ opacity?: string;
508
+ padding?: string;
509
+ textAlign?: string;
510
+ textShadow?: string;
511
+ transition?: string;
512
+ webkitFontSmoothing?: string;
513
+ webkitTransition?: string;
514
+ wordSpacing?: string;
591
515
  }
592
- interface AmazonPayBackendConfiguration {
593
- merchantId?: string;
594
- publicKeyId?: string;
595
- region?: Region;
596
- storeId?: string;
516
+ interface CardAllValidData {
517
+ type: string;
518
+ allValid: boolean;
519
+ rootNode: HTMLElement;
520
+ }
521
+ interface CardAutoCompleteData {
522
+ fieldType: string;
523
+ name: string;
524
+ value: string;
525
+ action: string;
526
+ }
527
+ interface CardBinLookupData {
528
+ type?: string;
529
+ detectedBrands?: string[] | null;
530
+ supportedBrands?: string[] | null;
531
+ brands?: string[];
532
+ issuingCountryCode?: string;
533
+ healthcare?: Record<string, boolean>[];
534
+ supportedBrandsRaw?: BrandObject[];
535
+ rootNode?: HTMLElement;
536
+ isReset?: boolean;
537
+ dualBrandingType?: string;
538
+ paymentMethodVariants?: (string | undefined)[];
539
+ }
540
+ interface CardBinValueData {
541
+ type: string;
542
+ binValue: string;
543
+ uuid?: string;
544
+ encryptedBin?: string;
545
+ }
546
+ interface CardBrandData {
547
+ type: string;
548
+ rootNode: HTMLElement;
549
+ brand: string;
550
+ cvcPolicy: CVCPolicyType;
551
+ expiryDatePolicy?: DatePolicyType;
552
+ cvcText: string;
553
+ showSocialSecurityNumber?: boolean;
554
+ brandImageUrl?: string;
555
+ mode?: BrandModeType;
556
+ }
557
+ interface CardConfigSuccessData {
558
+ iframesConfigured: boolean;
559
+ type: string;
560
+ rootNode: HTMLElement;
561
+ }
562
+ interface CardErrorData {
563
+ fieldType: string;
564
+ error: string;
565
+ type: string;
566
+ rootNode?: HTMLElement;
567
+ detectedBrands?: string[];
568
+ errorI18n?: string;
569
+ errorText?: string;
597
570
  }
598
- interface AmazonPayConfiguration extends UIElementProps {
599
- addressDetails?: AddressDetails;
600
- amazonPayToken?: string;
601
- amazonCheckoutSessionId?: string;
602
- amount?: PaymentAmount;
603
- buttonColor?: ButtonColor;
604
- cancelUrl?: string;
605
- chargePermissionType?: ChargePermissionType;
606
- clientKey?: string;
607
- configuration?: AmazonPayBackendConfiguration;
608
- currency?: Currency;
609
- deliverySpecifications?: DeliverySpecifications;
610
- design?: string;
611
- environment?: string;
612
- loadingContext?: string;
613
- locale?: string;
614
- merchantMetadata?: MerchantMetadata;
615
- onSubmit?(state: SubmitData, element: AmazonPayElement, actions: {
616
- resolve: (response: CheckoutAdvancedFlowResponse) => void;
617
- reject: () => void;
618
- }): void;
619
- payButton?: (props: PayButtonProps) => h.JSX.Element;
620
- placement?: Placement;
621
- productType?: ProductType;
622
- recurringMetadata?: RecurringMetadata;
623
- returnUrl?: string;
624
- showChangePaymentDetailsButton?: boolean;
625
- showOrderButton?: boolean;
626
- showSignOutButton?: boolean;
627
- signature?: string;
628
- onClick?: (resolve: (value?: unknown) => void, reject: () => void) => Promise<void>;
629
- onError?: (error: AdyenCheckoutError, component: UIElement) => void;
630
- onSignOut?: (resolve: (value?: unknown) => void, reject: () => void) => Promise<void>;
631
- /**
632
- * Used for analytics
633
- */
634
- expressPage?: 'cart' | 'minicart' | 'pdp' | 'checkout';
635
- /**
636
- * Used for analytics
637
- * @defaultValue false
638
- */
639
- isExpress?: boolean;
571
+ interface CardFieldValidData {
572
+ fieldType: string;
573
+ encryptedFieldName: string;
574
+ uid: string;
575
+ valid: boolean;
576
+ type: string;
577
+ rootNode: HTMLElement;
578
+ blob?: string;
579
+ endDigits?: string;
580
+ expiryDate?: string;
581
+ issuerBin?: number;
640
582
  }
641
- interface AmazonPayComponentProps extends AmazonPayConfiguration {
642
- showSignOutButton?: boolean;
643
- amazonCheckoutSessionId?: string;
644
- showOrderButton?: boolean;
645
- showChangePaymentDetailsButton?: boolean;
646
- setComponentRef: (ref: ComponentMethodsRef & {
647
- getSubmitFunction?: () => () => void;
648
- }) => void;
583
+ interface CardFocusData {
584
+ action: string;
585
+ focus: boolean;
586
+ numChars: number;
587
+ fieldType: string;
588
+ rootNode: HTMLElement;
589
+ type: string;
590
+ currentFocusObject: string;
649
591
  }
650
- interface AmazonPayButtonProps {
651
- amazonRef: AmazonWindowObject;
652
- buttonColor?: ButtonColor;
653
- cancelUrl?: string;
654
- chargePermissionType?: ChargePermissionType;
655
- clientKey?: string;
656
- configuration?: AmazonPayBackendConfiguration;
657
- currency?: Currency;
658
- deliverySpecifications?: DeliverySpecifications;
659
- design?: string;
660
- environment?: string;
661
- locale?: string;
662
- onClick: (resolve: (value?: unknown) => void, reject: () => void) => Promise<void>;
663
- onError?: (error: AdyenCheckoutError, component: UIElement) => void;
664
- placement?: Placement;
665
- productType?: ProductType;
666
- recurringMetadata?: RecurringMetadata;
667
- ref: RefObject<{
668
- initCheckout(): void;
669
- }>;
670
- returnUrl?: string;
671
- showPayButton: boolean;
592
+ interface CardLoadData {
593
+ iframesLoaded: boolean;
672
594
  }
673
- interface SignOutButtonProps {
674
- amazonRef: AmazonWindowObject;
675
- onSignOut: (resolve: (value?: unknown) => void, reject: () => void) => Promise<void>;
595
+ type CVCPolicyType = typeof REQUIRED | typeof OPTIONAL | typeof HIDDEN;
596
+ type DatePolicyType = typeof REQUIRED | typeof OPTIONAL | typeof HIDDEN;
597
+ interface BrandConfiguration {
598
+ name?: string;
599
+ icon?: string;
676
600
  }
677
- interface ChangePaymentDetailsButtonProps {
678
- amazonCheckoutSessionId: string;
679
- amazonRef: AmazonWindowObject;
601
+ interface CardBrandsConfiguration {
602
+ [key: string]: BrandConfiguration;
680
603
  }
681
- interface ChangeActionOptions {
682
- amazonCheckoutSessionId: string;
683
- changeAction: 'changeAddress' | 'changePayment';
604
+
605
+ interface RiskModuleOptions {
606
+ enabled: boolean;
607
+ onComplete?: (data: any) => void;
608
+ onError?: (error: any) => void;
609
+ node?: string;
684
610
  }
685
- interface OrderButtonProps {
686
- amazonCheckoutSessionId: string;
687
- clientKey: string;
688
- chargePermissionType?: ChargePermissionType;
689
- onError: (error: AdyenCheckoutError, component: UIElement) => void;
690
- recurringMetadata: RecurringMetadata;
691
- ref: RefObject<{
692
- createOrder(): void;
693
- }>;
694
- region: Region;
695
- returnUrl: string;
696
- publicKeyId: string;
611
+ interface RiskModuleProps extends BaseElementProps {
612
+ risk: RiskModuleOptions;
613
+ loadingContext: string;
697
614
  }
698
- interface AmazonPayElementData {
699
- paymentMethod: {
700
- type: string;
701
- checkoutSessionId?: string;
615
+ declare class RiskElement extends BaseElement<RiskModuleProps> {
616
+ static readonly type = "risk";
617
+ static readonly defaultProps: {
618
+ risk: {
619
+ enabled: boolean;
620
+ onComplete: () => void;
621
+ onError: () => void;
622
+ node: string;
623
+ };
702
624
  };
703
- browserInfo: BrowserInfo;
625
+ private nodeRiskContainer;
626
+ constructor(checkout: ICore, props?: any);
627
+ formatProps(props: any): any;
628
+ onComplete: (result: any) => void;
629
+ onError: (error: any) => void;
630
+ get isValid(): any;
631
+ get data(): any;
632
+ get enabled(): boolean;
633
+ cleanUp: () => void;
634
+ componentWillUnmount(): void;
635
+ render(): h.JSX.Element;
704
636
  }
705
- interface AmazonPayButtonSettings {
706
- buttonColor?: ButtonColor;
707
- design?: string;
708
- /**
709
- * Amazon Pay merchant account identifier
710
- */
711
- merchantId: string;
712
- /**
713
- * Sets button to Sandbox environment
714
- */
715
- sandbox: boolean;
716
- /**
717
- * Product type selected for checkout
718
- */
719
- productType: ProductType;
720
- /**
721
- * Placement of the Amazon Pay button on your website
722
- */
723
- placement: Placement;
637
+
638
+ interface DisclaimerMsgObject {
639
+ message: string;
640
+ linkText: string;
641
+ link: string;
642
+ }
643
+
644
+ interface AnalyticsOptions {
724
645
  /**
725
- * Language used to render the button and text on Amazon Pay hosted pages. Please note that supported language(s) is dependent on the region that your Amazon Pay account was registered for
646
+ * Enable/Disable all analytics
726
647
  */
727
- checkoutLanguage: SupportedLocale;
648
+ enabled?: boolean;
728
649
  /**
729
- * Ledger currency provided during registration for the given merchant identifier
650
+ * A wrapper to pass data needed when analytics is setup
730
651
  */
731
- ledgerCurrency: Currency;
652
+ analyticsData?: {
653
+ /**
654
+ * Relates to PMs used within Plugins
655
+ * https://docs.adyen.com/development-resources/application-information/?tab=integrator_built_2#application-information-fields
656
+ * @internal
657
+ */
658
+ applicationInfo?: ApplicationInfo;
659
+ /**
660
+ * Use a checkoutAttemptId from a previous page
661
+ */
662
+ checkoutAttemptId?: string;
663
+ };
732
664
  }
733
- interface MerchantMetadata {
734
- customInformation?: string;
735
- merchantReferenceId?: string;
736
- merchantStoreName?: string;
737
- noteToBuyer?: string;
665
+ interface ApplicationInfo {
666
+ externalPlatform: {
667
+ name: string;
668
+ version: string;
669
+ integrator: string;
670
+ };
671
+ merchantApplication: {
672
+ name: string;
673
+ version: string;
674
+ };
675
+ merchantDevice?: {
676
+ os: string;
677
+ osVersion: string;
678
+ };
738
679
  }
739
- interface AddressDetails {
740
- name?: string;
741
- addressLine1?: string;
742
- addressLine2?: string;
743
- addressLine3?: string;
744
- city?: string;
745
- districtOrCounty?: string;
746
- stateOrRegion?: string;
747
- postalCode?: string;
748
- countryCode?: string;
749
- phoneNumber?: string;
680
+
681
+ /**
682
+ * PayPal Fastlane Reference:
683
+ * https://developer.paypal.com/docs/checkout/fastlane/reference/#link-customizeyourintegration
684
+ */
685
+ /**
686
+ * Fastlane object available in the window
687
+ */
688
+ interface FastlaneWindowInstance {
689
+ identity: {
690
+ lookupCustomerByEmail: (email: string) => Promise<{
691
+ customerContextId: string;
692
+ }>;
693
+ triggerAuthenticationFlow: (customerContextId: string, options?: AuthenticationFlowOptions) => Promise<FastlaneAuthenticatedCustomerResult>;
694
+ getSession: () => Promise<{
695
+ sessionId: string;
696
+ }>;
697
+ };
698
+ profile: {
699
+ showShippingAddressSelector: () => Promise<FastlaneShippingAddressSelectorResult>;
700
+ };
701
+ setLocale: (locale: string) => void;
702
+ ConsentComponent: () => Promise<{
703
+ getRenderState: () => Promise<FastlaneConsentRenderState>;
704
+ }>;
705
+ FastlaneWatermarkComponent: (options: {
706
+ includeAdditionalInfo: boolean;
707
+ }) => Promise<{
708
+ render: (container: any) => null;
709
+ }>;
750
710
  }
751
- interface ChargeAmount {
752
- amount: string;
753
- currencyCode: Currency;
711
+ interface FastlaneConsentRenderState {
712
+ showConsent: boolean;
713
+ defaultToggleState?: boolean;
714
+ termsAndConditionsLink?: string;
715
+ termsAndConditionsVersion?: string;
716
+ privacyPolicyLink?: string;
754
717
  }
755
- type LedgerCurrencies = {
756
- [key in Region]: Currency;
757
- };
758
- interface PayloadJSON {
759
- addressDetails?: AddressDetails;
760
- chargePermissionType?: ChargePermissionType;
761
- deliverySpecifications?: DeliverySpecifications;
762
- merchantMetadata?: MerchantMetadata;
763
- paymentDetails?: {
764
- chargeAmount: ChargeAmount;
765
- paymentIntent: 'Confirm';
766
- presentmentCurrency: Currency;
767
- totalOrderAmount: ChargeAmount;
768
- };
769
- recurringMetadata?: RecurringMetadata;
770
- storeId: string;
771
- webCheckoutDetails: {
772
- checkoutCancelUrl?: string;
773
- checkoutMode?: 'ProcessOrder';
774
- checkoutResultReturnUrl?: string;
775
- checkoutReviewReturnUrl?: string;
718
+ interface FastlaneOptions {
719
+ intendedExperience: 'externalProcessorCustomConsent';
720
+ metadata?: {
721
+ geoLocOverride?: string;
776
722
  };
777
723
  }
778
- interface CheckoutDetailsRequest {
779
- checkoutSessionId: string;
780
- getDeliveryAddress?: boolean;
781
- getDeclineFlowUrl?: boolean;
782
- publicKeyId: string;
783
- region: Region;
724
+ interface AuthenticationFlowOptions {
784
725
  }
785
- interface UpdateAmazonCheckoutSessionRequest {
786
- amount: PaymentAmount;
787
- chargePermissionType?: ChargePermissionType;
788
- checkoutCancelUrl?: string;
789
- checkoutResultReturnUrl: string;
790
- checkoutSessionId: string;
791
- publicKeyId: string;
792
- recurringMetadata?: RecurringMetadata;
793
- region: Region;
726
+ interface CardPaymentSource {
727
+ brand: string;
728
+ expiry: string;
729
+ lastDigits: string;
730
+ name: string;
731
+ billingAddress: FastlaneAddress;
794
732
  }
795
- interface CheckoutSessionConfig {
796
- payloadJSON: string;
797
- signature: string;
798
- publicKeyId: string;
733
+ /**
734
+ * External types
735
+ */
736
+ interface FastlaneShippingAddressSelectorResult {
737
+ selectionChanged: boolean;
738
+ selectedAddress: FastlaneShipping;
799
739
  }
800
- interface DeliverySpecifications {
801
- specialRestrictions?: string[];
802
- addressRestrictions?: AddressRestrictions;
740
+ interface FastlaneAuthenticatedCustomerSucceeded {
741
+ authenticationState: 'succeeded';
742
+ profileData: FastlaneProfile;
803
743
  }
804
- interface AddressRestrictions {
805
- type?: 'Allowed' | 'NotAllowed';
806
- restrictions?: Restrictions;
744
+ interface FastlaneAuthenticatedCustomerFailed {
745
+ authenticationState: 'failed' | 'canceled' | 'not_found';
746
+ profileData: undefined;
807
747
  }
808
- interface Restrictions {
809
- [key: string]: {
810
- zipCodes?: string[];
811
- statesOrRegions?: string[];
748
+ type FastlaneAuthenticatedCustomerResult = FastlaneAuthenticatedCustomerSucceeded | FastlaneAuthenticatedCustomerFailed;
749
+ interface FastlaneAddress {
750
+ addressLine1: string;
751
+ addressLine2: string;
752
+ adminArea1: string;
753
+ adminArea2: string;
754
+ postalCode: string;
755
+ countryCode: string;
756
+ phone: {
757
+ nationalNumber: string;
758
+ countryCode: string;
812
759
  };
813
760
  }
814
-
815
- interface ANCVConfiguration extends UIElementProps {
816
- paymentData?: string;
817
- data: ANCVDataState;
818
- onOrderRequest?: onOrderRequestCallbackType;
819
- onOrderUpdated?: onOrderUpdatedCallbackType;
761
+ interface FastlaneShipping {
762
+ name: {
763
+ firstName: string;
764
+ lastName: string;
765
+ fullName: string;
766
+ };
767
+ address: FastlaneAddress;
768
+ phoneNumber: {
769
+ nationalNumber: string;
770
+ countryCode: string;
771
+ };
820
772
  }
821
- interface ANCVDataState {
822
- beneficiaryId: string;
773
+ interface FastlaneProfile {
774
+ name: {
775
+ firstName: string;
776
+ lastName: string;
777
+ fullName: string;
778
+ };
779
+ shippingAddress: FastlaneShipping;
780
+ card?: {
781
+ id: string;
782
+ paymentSource: {
783
+ card: CardPaymentSource;
784
+ };
785
+ };
823
786
  }
824
-
825
- type Initiative = 'web' | 'messaging';
826
- type ApplePayPaymentOrderDetails = {
827
- orderTypeIdentifier: string;
828
- orderIdentifier: string;
829
- webServiceURL: string;
830
- authenticationToken: string;
831
- };
832
- type ApplePayPaymentAuthorizationResult = ApplePayJS.ApplePayPaymentAuthorizationResult & {
833
- orderDetails?: ApplePayPaymentOrderDetails;
787
+ type FastlaneComponentConfiguration = {
788
+ paymentType: 'fastlane';
789
+ configuration: {
790
+ fastlaneSessionId: string;
791
+ email: string;
792
+ tokenId: string;
793
+ lastFour: string;
794
+ brand: string;
795
+ };
834
796
  };
835
- type ApplePayButtonType = 'add-money' | 'book' | 'buy' | 'check-out' | 'continue' | 'contribute' | 'donate' | 'order' | 'pay' | 'plain' | 'reload' | 'rent' | 'set-up' | 'subscribe' | 'support' | 'tip' | 'top-up';
836
- type ApplePayButtonStyle = 'black' | 'white' | 'white-outline';
837
- interface ApplePayConfiguration extends UIElementProps {
838
- /**
839
- * Enables the ApplePay Express Flow & also used for analytics
840
- * @defaultValue false
841
- */
842
- isExpress?: boolean;
843
- /**
844
- * Used for analytics
845
- */
846
- expressPage?: 'cart' | 'minicart' | 'pdp' | 'checkout';
847
- /**
848
- * The Apple Pay version number your website supports.
849
- * @default highest supported version by the shopper device
850
- * @see {@link https://developer.apple.com/documentation/applepayontheweb/apple-pay-on-the-web-version-history Apple Pay on the Web Version History}
851
- */
852
- version?: number;
853
- /**
854
- * Part of the 'ApplePayLineItem' object, which sets the label of the payment request
855
- * @see {@link https://developer.apple.com/documentation/applepayontheweb/applepaylineitem ApplePayLineItem docs}
856
- */
857
- totalPriceLabel?: string;
858
- /**
859
- * @default 'final'
860
- */
861
- totalPriceStatus?: ApplePayJS.ApplePayLineItemType;
862
- /**
863
- * ApplePay configuration sent by the /paymentMethods response
864
- */
865
- configuration?: {
866
- merchantName?: string;
867
- merchantId?: string;
797
+ type FastlaneCardComponentConfiguration = {
798
+ paymentType: 'card';
799
+ configuration: {
800
+ fastlaneConfiguration?: FastlaneSignupConfiguration;
868
801
  };
802
+ };
803
+ type FastlaneSignupConfiguration = FastlaneConsentRenderState & {
804
+ fastlaneSessionId?: string;
805
+ telephoneNumber?: string;
806
+ };
807
+ interface FastlaneData {
808
+ consentShown: boolean;
809
+ fastlaneSessionId: string;
810
+ consentGiven: boolean;
811
+ consentVersion?: string;
812
+ telephoneNumber?: string;
813
+ }
814
+ type FastlanePaymentMethodConfiguration = FastlaneComponentConfiguration | FastlaneCardComponentConfiguration;
815
+ interface FastlaneSDKConfiguration {
816
+ clientKey: string;
817
+ environment: CoreConfiguration['environment'];
818
+ locale?: 'en-US' | 'es-US' | 'fr-RS' | 'zh-US';
819
+ analytics?: Pick<AnalyticsOptions, 'enabled'>;
869
820
  /**
870
- * Used to override the domain name for the Apple Pay button. Useful when using ApplePay within cross-domain iframe
871
- * For more context: https://github.com/Adyen/adyen-web/pull/3340
872
- */
873
- domainName?: string;
874
- clientKey?: string;
875
- initiative?: Initiative;
876
- /**
877
- * A set of line items that explain recurring payments and/or additional charges.
878
- */
879
- lineItems?: ApplePayJS.ApplePayLineItem[];
880
- /**
881
- * The payment capabilities supported by the merchant.
882
- * The value must at least contain ApplePayMerchantCapability.supports3DS.
883
- * @default ['supports3DS']
884
- */
885
- merchantCapabilities?: ApplePayJS.ApplePayMerchantCapability[];
886
- /**
887
- * A value that indicates whether the shipping mode prevents the user from editing the shipping address.
888
- * {@link https://developer.apple.com/documentation/applepayontheweb/applepaypaymentrequest/shippingcontacteditingmode}
889
- */
890
- shippingContactEditingMode?: ApplePayJS.ApplePayShippingContactEditingMode;
891
- /**
892
- * A set of shipping method objects that describe the available shipping methods.
893
- */
894
- shippingMethods?: ApplePayJS.ApplePayShippingMethod[];
895
- /**
896
- * How the items are to be shipped.
897
- */
898
- shippingType?: ApplePayJS.ApplePayShippingType;
899
- /**
900
- * A list of ISO 3166 country codes for limiting payments to cards from specific countries.
901
- */
902
- supportedCountries?: string[];
903
- /**
904
- * The payment networks supported by the merchant.
905
- */
906
- supportedNetworks?: string[];
907
- /**
908
- * ApplePayRecurringPaymentRequest - Represents a request to set up a recurring payment, typically a subscription.
909
- * {@link https://developer.apple.com/documentation/applepayontheweb/applepayrecurringpaymentrequest}
821
+ * Used to force the Fastlane SDK to return the consent details in case the shopper is not recognized.
822
+ * Use-case: Developer is testing the flow in another country outside US, which would not get consent details.
823
+ *
824
+ * This configuration should not be used for 'live' environment
910
825
  */
911
- recurringPaymentRequest?: ApplePayJS.ApplePayRecurringPaymentRequest;
826
+ forceConsentDetails?: boolean;
827
+ }
828
+ interface FastlaneConfiguration extends UIElementProps {
912
829
  /**
913
- * The billing information that you require from the user in order to process the transaction.
830
+ * Card token ID, used to process the payment
914
831
  */
915
- requiredBillingContactFields?: ApplePayJS.ApplePayContactField[];
832
+ tokenId: string;
916
833
  /**
917
- * The shipping information that you require from the user in order to fulfill the order.
834
+ * Fastlane session ID
918
835
  */
919
- requiredShippingContactFields?: ApplePayJS.ApplePayContactField[];
836
+ fastlaneSessionId: string;
920
837
  /**
921
- * Billing contact information for the user.
838
+ * Initial last four digits displayed once the Component is rendered
922
839
  */
923
- billingContact?: ApplePayJS.ApplePayPaymentContact;
840
+ lastFour: string;
924
841
  /**
925
- * Shipping contact information for the user.
842
+ * Initial brand displayed once the Component is rendered
926
843
  */
927
- shippingContact?: ApplePayJS.ApplePayPaymentContact;
844
+ brand: string;
928
845
  /**
929
- * It can be used to render the Apple Pay Code in a new window rather than as an overlay modal
930
- * Recommended to be used in case of using Apple Pay within an iframe, where the modal may not be presented correctly over the parent website
931
- *
932
- * @defaultValue 'modal'
846
+ * Shopper's email (it will be used in the future to re-authenticate using Fastlane SDK within the Component)
933
847
  */
934
- renderApplePayCodeAs?: ApplePayWebConfiguration['renderApplePayCodeAs'];
848
+ email: string;
935
849
  /**
936
- * Optional user-defined data.
850
+ * Used internally by Drop-in. Displays the brand images inside the Drop-in payment method header
851
+ * @internal
937
852
  */
938
- applicationData?: string;
853
+ keepBrandsVisible?: boolean;
939
854
  /**
940
- * Called when the shopper clicks the Apple Pay button
855
+ * Property returned by the backend. Contains the list of brands supported by Fastlane component
856
+ * @internal
857
+ */
858
+ brands?: string[];
859
+ }
941
860
 
942
- * @param resolve - Must be called if the button should be displayed
943
- * @param reject - Must be called if the button should not be displayed
944
- * @returns
861
+ interface IAnalytics {
862
+ checkoutAttemptId?: string;
863
+ setUp({ sessionId, checkoutStage, locale }: {
864
+ sessionId?: string;
865
+ checkoutStage?: 'precheckout' | 'checkout';
866
+ locale?: string;
867
+ }): Promise<void>;
868
+ sendFlavor(flavor: 'dropin' | 'components'): Promise<void>;
869
+ sendAnalytics(event: AbstractAnalyticsEvent): void;
870
+ flush(): void;
871
+ }
872
+
873
+ type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'action' | 'link' | 'iconOnly';
874
+ interface ButtonProps {
875
+ status?: string;
876
+ /**
877
+ * Class name modifiers will be used as: `adyen-checkout__button--${modifier}`
945
878
  */
946
- onClick?: (resolve: () => void, reject: () => void) => void;
879
+ classNameModifiers?: string[];
880
+ variant?: ButtonVariant;
881
+ disabled?: boolean;
882
+ label?: string | h.JSX.Element;
883
+ onClickCompletedLabel?: string | h.JSX.Element;
884
+ id?: string;
885
+ ariaLabel?: string;
886
+ ariaLabelledBy?: string;
887
+ ariaDescribedBy?: string;
888
+ ariaExpanded?: boolean;
889
+ ariaControls?: string;
890
+ secondaryLabel?: string;
891
+ icon?: string;
892
+ onClickCompletedIcon?: string;
893
+ inline?: boolean;
894
+ href?: string;
895
+ target?: string;
896
+ rel?: string;
897
+ onClick?: (e: TargetedMouseEvent<HTMLButtonElement | HTMLAnchorElement>, callbacks?: {
898
+ complete?: () => void;
899
+ }) => void;
900
+ onKeyDown?: (event: KeyboardEvent) => void;
901
+ buttonRef?: Ref<HTMLButtonElement>;
902
+ onMouseEnter?: (event: MouseEvent) => void;
903
+ onMouseLeave?: (event: MouseEvent) => void;
904
+ onFocus?: (event: FocusEvent) => void;
905
+ onBlur?: (event: FocusEvent) => void;
906
+ }
907
+
908
+ interface PayButtonProps extends ButtonProps {
947
909
  /**
948
- * A callback function the Apple Pay SDK calls when the Apple Pay code modal or window closes.
910
+ * Class name modifiers will be used as: `adyen-checkout__image--${modifier}`
949
911
  */
950
- onApplePayCodeClose?: ApplePayWebConfiguration['onApplePayCodeClose'];
912
+ classNameModifiers?: string[];
951
913
  /**
952
- * Callback called when ApplePay authorize the payment.
953
- * Must be resolved/rejected with the action object.
954
- *
955
- * @param data - Authorization event from ApplePay, along with formatted billingAddress and deliveryAddress
956
- * @param actions - Object to continue/stop with the payment flow
957
- *
958
- * @remarks
959
- * If actions.resolve() is called, the payment flow will be triggered.
960
- * If actions.reject() is called, the overlay will display an error
914
+ * Custom amount that can be passed to the button.
915
+ * This is useful when the amount is not available in the amount provider, such as Giftcard scenario where
916
+ * we need to display the remaining amount
961
917
  */
962
- onAuthorized?: (data: {
963
- authorizedEvent: ApplePayJS.ApplePayPaymentAuthorizedEvent;
964
- billingAddress?: Partial<AddressData>;
965
- deliveryAddress?: Partial<AddressData>;
966
- }, actions: {
967
- resolve: () => void;
968
- reject: (error?: ApplePayJS.ApplePayError) => void;
969
- }) => void;
918
+ customAmount?: PaymentAmount;
919
+ label?: string;
920
+ status?: string;
921
+ disabled?: boolean;
922
+ icon?: string;
923
+ showReview?: boolean;
924
+ }
925
+
926
+ interface CardInputRef extends ComponentMethodsRef {
927
+ sfp?: SecuredFieldsProviderRef;
928
+ setFocusOn?: (field: string) => void;
929
+ processBinLookupResponse?: (binLookupResponse: BinLookupResponse, isReset: boolean) => void;
930
+ updateStyles?: (stylesObj: StylesObject) => void;
931
+ handleUnsupportedCard?: (errObj: CardErrorData) => boolean;
932
+ }
933
+ interface SFError {
934
+ isValid?: boolean;
935
+ errorMessage?: string;
936
+ errorI18n?: string;
937
+ error: string;
938
+ rootNode: HTMLElement;
939
+ detectedBrands?: string[];
940
+ }
941
+ interface SFStateErrorObj {
942
+ [key: string]: SFError;
943
+ }
944
+ declare enum AddressModeOptions {
945
+ full = "full",
946
+ partial = "partial",
947
+ none = "none"
948
+ }
949
+
950
+ interface ValidationRuleErrorObj {
951
+ [key: string]: ValidationRuleResult;
952
+ }
953
+ interface AriaAttributes {
954
+ 'aria-relevant'?: 'additions' | 'all' | 'removals' | 'text' | 'additions text';
955
+ 'aria-live'?: 'off' | 'polite' | 'assertive';
956
+ 'aria-atomic'?: 'true' | 'false';
957
+ }
958
+ interface SRPanelProps extends BaseElementProps {
959
+ enabled?: boolean;
960
+ node?: string;
961
+ showPanel?: boolean;
962
+ moveFocus?: boolean;
963
+ id?: string;
964
+ ariaAttributes?: AriaAttributes;
965
+ }
966
+ type SRPanelConfig = Pick<SRPanelProps, 'enabled' | 'node' | 'showPanel' | 'moveFocus' | 'id' | 'ariaAttributes'>;
967
+ interface GenericError {
968
+ isValid: boolean;
969
+ errorMessage: string;
970
+ error: string;
971
+ }
972
+
973
+ /**
974
+ * A panel meant to hold messages that will be read out by ScreenReaders on an aria-live="polite" basis
975
+ * Expects a string or string array of message to add to the panel to be read out
976
+ * For testing purposes can be made visible
977
+ */
978
+ declare class SRPanel extends BaseElement<SRPanelProps> {
979
+ static readonly type = "srPanel";
980
+ static readonly defaultProps: Partial<SRPanelProps>;
981
+ private readonly srPanelContainer;
982
+ private readonly id;
983
+ private readonly showPanel;
984
+ private readonly _enabled;
985
+ private readonly _moveFocus;
986
+ private componentRef;
987
+ constructor(checkout: ICore, props?: SRPanelProps);
988
+ setComponentRef: (ref: any) => void;
989
+ get enabled(): boolean;
990
+ get moveFocus(): boolean;
991
+ setAriaProps(ariaAttributes: AriaAttributes): void;
992
+ setMessages: (messages: string[] | string | null) => void;
993
+ render(): h.JSX.Element;
994
+ }
995
+
996
+ interface BaseElementProps {
997
+ order?: Order;
998
+ modules?: {
999
+ srPanel?: SRPanel;
1000
+ analytics?: IAnalytics;
1001
+ resources?: Resources;
1002
+ risk?: RiskElement;
1003
+ };
970
1004
  /**
971
- * Collect the order tracking details if available.
972
- * This callback is invoked when a successfull payment is resolved
973
- *
974
- * {@link https://developer.apple.com/documentation/applepayontheweb/applepaypaymentorderdetails}
975
- * @param resolve - Must be called with the orderDetails fields
976
- * @param reject - Must be called if something failed during the order creation. Calling 'reject' won't cancel the payment flow
1005
+ * Identifies if the Element is the DropIn element
977
1006
  */
978
- onOrderTrackingRequest?: (resolve: (orderDetails: ApplePayPaymentOrderDetails) => void, reject: () => void) => void;
1007
+ isDropin?: boolean;
1008
+ }
1009
+ type BaseElementState = {
1010
+ order?: Order;
1011
+ } & Pick<OnChangeData, 'valid' | 'errors'> & Record<string, any>;
1012
+ interface IBaseElement<P extends BaseElementProps = BaseElementProps, S extends BaseElementState = BaseElementState> {
1013
+ data: PaymentData;
1014
+ state: S;
1015
+ props: P;
1016
+ _id: string;
1017
+ _component: ComponentChild;
1018
+ render(): ComponentChild | Error;
1019
+ mount(domNode: HTMLElement | string): IBaseElement;
1020
+ update(props: Partial<P>): IBaseElement;
1021
+ unmount(): IBaseElement;
1022
+ remove(): void;
1023
+ activate(): void;
1024
+ }
1025
+
1026
+ type CoreCallbacks$1 = Pick<CoreConfiguration, 'beforeRedirect' | 'beforeSubmit' | 'onSubmit' | 'onReview' | 'onAdditionalDetails' | 'onPaymentFailed' | 'onPaymentCompleted' | 'onOrderUpdated' | 'onPaymentMethodsRequest' | 'onChange' | 'onActionHandled' | 'onError' | 'onEnterKeyPressed' | 'donation'>;
1027
+ type StatusFromAction = 'redirect' | 'loading' | 'custom';
1028
+ type UIElementProps = {
1029
+ paymentMethodId?: string;
1030
+ storedPaymentMethodId?: string;
1031
+ } & BaseElementProps & CoreCallbacks$1 & {
1032
+ environment?: string;
1033
+ session?: Session;
1034
+ onComplete?: (state: BaseElementState, element: UIElement) => void;
1035
+ isInstantPayment?: boolean;
979
1036
  /**
980
- * An event handler the system calls when it displays the payment sheet
981
- *
982
- * {@link https://developer.apple.com/documentation/applepayontheweb/applepaysession/onvalidatemerchant}
983
- * @param resolve - Must be called with an opaque message session object
984
- * @param reject - Must be called if something failed during the merchant validation
985
- * @param validationURL - The URL your server must use to validate itself and obtain a merchant session object.
1037
+ * Flags if the element is Stored payment method
1038
+ * @internal
986
1039
  */
987
- onValidateMerchant?: (resolve: (merchantSession: unknown) => void, reject: (error?: string) => void, validationURL: string) => Promise<void>;
1040
+ isStoredPaymentMethod?: boolean;
988
1041
  /**
989
- * An event handler to call when the user selects a new payment method.
990
- *
991
- * {@link https://developer.apple.com/documentation/applepayontheweb/applepaysession/onpaymentmethodselected}
992
- * @param resolve - Completes the selection of a payment method with an update.
993
- * @param reject - Completes the selection of a payment method with no update.
994
- * @param event - The event parameter contains the paymentMethod attribute.
1042
+ * Flag if the element is Stored payment method.
1043
+ * Perhaps can be deprecated and we use the one above?
1044
+ * @internal
995
1045
  */
996
- onPaymentMethodSelected?: (resolve: (paymentMethodUpdate: ApplePayJS.ApplePayPaymentMethodUpdate) => void, reject: (paymentMethodUpdate: ApplePayJS.ApplePayPaymentMethodUpdate) => void, event: ApplePayJS.ApplePayPaymentMethodSelectedEvent) => void;
1046
+ oneClick?: boolean;
997
1047
  /**
998
- * An event handler to call when the user selects a shipping contact in the payment sheet.
999
- *
1000
- * {@link https://developer.apple.com/documentation/applepayontheweb/applepaysession/onshippingcontactselected}
1001
- * @param resolve - Completes the selection of a shipping contact with an update.
1002
- * @param reject - Completes the selection of a shipping contact with no update.
1003
- * @param event - The event parameter contains the shippingContact attribute.
1048
+ * Stored payment method id
1049
+ * @internal
1004
1050
  */
1005
- onShippingContactSelected?: (resolve: (shippingContactUpdate: ApplePayJS.ApplePayShippingContactUpdate) => void, reject: (shippingContactUpdate: ApplePayJS.ApplePayShippingContactUpdate) => void, event: ApplePayJS.ApplePayShippingContactSelectedEvent) => void;
1051
+ storedPaymentMethodId?: string;
1006
1052
  /**
1007
- * Completes the selection of a shipping method with an update.
1008
- *
1009
- * {@link https://developer.apple.com/documentation/applepayontheweb/applepaysession/completeshippingmethodselection}
1010
- * @param resolve - Completes the selection of a shipping method with an update.
1011
- * @param reject - Completes the selection of a shipping method with no update.
1012
- * @param event - The event parameter contains the shippingMethod attribute.
1053
+ * Status set when creating the Component from action
1054
+ * @internal
1013
1055
  */
1014
- onShippingMethodSelected?: (resolve: (shippingMethodUpdate: ApplePayJS.ApplePayShippingMethodUpdate) => void, reject: (shippingMethodUpdate: ApplePayJS.ApplePayShippingMethodUpdate) => void, event: ApplePayJS.ApplePayShippingMethodSelectedEvent) => void;
1056
+ statusType?: StatusFromAction;
1057
+ type?: string;
1058
+ name?: string;
1059
+ icon?: string;
1060
+ amount?: PaymentAmount;
1061
+ secondaryAmount?: PaymentAmount;
1015
1062
  /**
1016
- * The initial coupon code for the payment request.
1017
- * @see {@link https://developer.apple.com/documentation/applepayontheweb/applepaypaymentrequest/couponcode couponCode docs}
1063
+ * Show/Hide pay button
1064
+ * @defaultValue true
1018
1065
  */
1019
- couponCode?: ApplePayJS.ApplePayPaymentRequest['couponCode'];
1066
+ showPayButton?: boolean;
1067
+ /** @internal */
1068
+ payButton?: (options: PayButtonProps) => h.JSX.Element;
1069
+ /** @internal */
1070
+ loadingContext?: string;
1071
+ /** @internal */
1072
+ createFromAction?: (action: PaymentAction, props: object) => UIElement;
1073
+ /** @internal */
1074
+ clientKey?: string;
1075
+ /** @internal */
1076
+ elementRef?: UIElement;
1077
+ /** @internal */
1078
+ i18n?: Language;
1020
1079
  /**
1021
- * A Boolean value that determines whether the payment sheet displays the coupon code field.
1022
- * @see {@link https://developer.apple.com/documentation/applepayontheweb/applepaypaymentrequest/supportscouponcode supportsCouponCode docs}
1080
+ * The shopper’s issuer account label. It can be available for stored payment method
1081
+ * @internal
1023
1082
  */
1024
- supportsCouponCode?: ApplePayJS.ApplePayPaymentRequest['supportsCouponCode'];
1083
+ label?: string;
1025
1084
  /**
1026
- * An event handler called by the system when the user enters or updates a coupon code.
1027
- *
1028
- * {@link https://developer.apple.com/documentation/applepayontheweb/applepaysession/oncouponcodechanged}
1029
- * @param resolve - Completes the change of a coupon code with an update.
1030
- * @param reject - Completes the change of a coupon code with no update.
1031
- * @param event - The event parameter contains the couponCode attribute.
1085
+ * Returned after the payments call, when an action is returned. It represents the payment method tx variant
1086
+ * that was used for the payment
1087
+ * @internal
1032
1088
  */
1033
- onCouponCodeChanged?: (resolve: (update: ApplePayJS.ApplePayCouponCodeUpdate) => void, reject: (update: ApplePayJS.ApplePayCouponCodeUpdate) => void, event: ApplePayJS.ApplePayCouponCodeChangedEvent) => void;
1034
- buttonColor?: ApplePayButtonStyle;
1035
- buttonType?: ApplePayButtonType;
1089
+ paymentMethodType?: string;
1036
1090
  /**
1037
- * Used to tweak the text of the button types that contain text ('Continue with', 'Book with', etc)
1091
+ * Reference to the action object found in a /payments response. This, in most cases, is passed on to the onActionHandled callback
1038
1092
  */
1039
- buttonLocale?: string;
1040
- }
1041
- interface ApplePayElementData {
1042
- paymentMethod: {
1043
- type: string;
1044
- applePayToken: string;
1045
- isExpress?: boolean;
1046
- };
1047
- billingAddress?: AddressData;
1048
- deliveryAddress?: AddressData;
1049
- }
1050
- interface ApplePaySessionRequest {
1051
- displayName: string;
1052
- domainName: string;
1053
- initiative: Initiative;
1054
- merchantIdentifier: string;
1055
- }
1056
- interface ApplePayWebConfiguration {
1057
- renderApplePayCodeAs?: 'modal' | 'window';
1058
- onApplePayCodeClose?(): void;
1093
+ originalAction?: PaymentAction;
1094
+ };
1095
+ type UIElementStatus = 'ready' | 'loading' | 'error' | 'success';
1096
+ interface ComponentMethodsRef {
1097
+ showValidation?: () => void;
1098
+ setStatus?(status: UIElementStatus): void;
1059
1099
  }
1060
1100
 
1061
- interface BankTransferResultProps {
1062
- paymentMethodType?: string;
1063
- reference?: string;
1064
- totalAmount?: {
1065
- value: number;
1066
- currency: string;
1067
- };
1068
- beneficiary?: string;
1069
- iban?: string;
1070
- bic?: string;
1071
- accountNumber?: string;
1072
- sortCode?: string;
1073
- routingNumber?: string;
1074
- branchCode?: string;
1075
- bankCode?: string;
1076
- onActionHandled?: (actionHandledObj: ActionHandledReturnObject) => void;
1101
+ declare enum TxVariants {
1102
+ /** internal */
1103
+ address = "address",
1104
+ bankTransfer_IBAN = "bankTransfer_IBAN",
1105
+ bankTransfer_BE = "bankTransfer_BE",
1106
+ bankTransfer_NL = "bankTransfer_NL",
1107
+ bankTransfer_PL = "bankTransfer_PL",
1108
+ bankTransfer_FR = "bankTransfer_FR",
1109
+ bankTransfer_CH = "bankTransfer_CH",
1110
+ bankTransfer_IE = "bankTransfer_IE",
1111
+ bankTransfer_GB = "bankTransfer_GB",
1112
+ bankTransfer_DE = "bankTransfer_DE",
1113
+ bankTransfer_AE = "bankTransfer_AE",
1114
+ bankTransfer_AT = "bankTransfer_AT",
1115
+ bankTransfer_AU = "bankTransfer_AU",
1116
+ bankTransfer_BG = "bankTransfer_BG",
1117
+ bankTransfer_CA = "bankTransfer_CA",
1118
+ bankTransfer_EE = "bankTransfer_EE",
1119
+ bankTransfer_ES = "bankTransfer_ES",
1120
+ bankTransfer_FI = "bankTransfer_FI",
1121
+ bankTransfer_HK = "bankTransfer_HK",
1122
+ bankTransfer_HU = "bankTransfer_HU",
1123
+ bankTransfer_IT = "bankTransfer_IT",
1124
+ bankTransfer_JP = "bankTransfer_JP",
1125
+ bankTransfer_LU = "bankTransfer_LU",
1126
+ bankTransfer_NZ = "bankTransfer_NZ",
1127
+ bankTransfer_PT = "bankTransfer_PT",
1128
+ bankTransfer_SG = "bankTransfer_SG",
1129
+ bankTransfer_SK = "bankTransfer_SK",
1130
+ bankTransfer_US = "bankTransfer_US",
1131
+ donation = "donation",
1132
+ personal_details = "personal_details",
1133
+ dropin = "dropin",
1134
+ /** internal */
1135
+ /** Card */
1136
+ bcmc = "bcmc",
1137
+ card = "card",
1138
+ scheme = "scheme",
1139
+ storedCard = "storedCard",
1140
+ customCard = "customcard",
1141
+ /** Card */
1142
+ /** ThreeDS */
1143
+ threeDS2Challenge = "threeDS2Challenge",
1144
+ threeDS2Fingerprint = "threeDS2Fingerprint",
1145
+ threeDS2DeviceFingerprint = "threeDS2DeviceFingerprint",
1146
+ /** ThreeDS */
1147
+ /** Direct debit */
1148
+ ach = "ach",
1149
+ directdebit_GB = "directdebit_GB",
1150
+ sepadirectdebit = "sepadirectdebit",
1151
+ eft_directdebit_CA = "eft_directdebit_CA",
1152
+ /** Direct debit */
1153
+ /** Open Invoice */
1154
+ affirm = "affirm",
1155
+ afterpay = "afterpay",
1156
+ afterpay_default = "afterpay_default",
1157
+ afterpay_b2b = "afterpay_b2b",
1158
+ atome = "atome",
1159
+ facilypay_3x = "facilypay_3x",
1160
+ facilypay_4x = "facilypay_4x",
1161
+ facilypay_6x = "facilypay_6x",
1162
+ facilypay_10x = "facilypay_10x",
1163
+ facilypay_12x = "facilypay_12x",
1164
+ ratepay = "ratepay",
1165
+ ratepay_directdebit = "ratepay_directdebit",
1166
+ /** Open Invoice */
1167
+ /** Wallets */
1168
+ amazonpay = "amazonpay",
1169
+ applepay = "applepay",
1170
+ cashapp = "cashapp",
1171
+ clicktopay = "clicktopay",
1172
+ googlepay = "googlepay",
1173
+ paypal = "paypal",
1174
+ fastlane = "fastlane",
1175
+ paywithgoogle = "paywithgoogle",
1176
+ /** Wallets */
1177
+ /** Voucher */
1178
+ boletobancario = "boletobancario",
1179
+ boletobancario_itau = "boletobancario_itau",
1180
+ boletobancario_santander = "boletobancario_santander",
1181
+ primeiropay_boleto = "primeiropay_boleto",
1182
+ doku = "doku",
1183
+ doku_alfamart = "doku_alfamart",
1184
+ doku_permata_lite_atm = "doku_permata_lite_atm",
1185
+ doku_indomaret = "doku_indomaret",
1186
+ doku_atm_mandiri_va = "doku_atm_mandiri_va",
1187
+ doku_sinarmas_va = "doku_sinarmas_va",
1188
+ doku_mandiri_va = "doku_mandiri_va",
1189
+ doku_cimb_va = "doku_cimb_va",
1190
+ doku_danamon_va = "doku_danamon_va",
1191
+ doku_bri_va = "doku_bri_va",
1192
+ doku_bni_va = "doku_bni_va",
1193
+ doku_bca_va = "doku_bca_va",
1194
+ doku_wallet = "doku_wallet",
1195
+ oxxo = "oxxo",
1196
+ /** Voucher */
1197
+ /** issuerList */
1198
+ billdesk_online = "billdesk_online",
1199
+ billdesk_wallet = "billdesk_wallet",
1200
+ dotpay = "dotpay",
1201
+ eps = "eps",
1202
+ iris = "iris",
1203
+ molpay_ebanking_fpx_MY = "molpay_ebanking_fpx_MY",
1204
+ molpay_ebanking_TH = "molpay_ebanking_TH",
1205
+ molpay_ebanking_VN = "molpay_ebanking_VN",
1206
+ onlineBanking_CZ = "onlineBanking_CZ",
1207
+ onlinebanking_IN = "onlinebanking_IN",
1208
+ onlineBanking_PL = "onlineBanking_PL",
1209
+ onlineBanking_SK = "onlineBanking_SK",
1210
+ paybybank = "paybybank",
1211
+ payu_IN_cashcard = "payu_IN_cashcard",
1212
+ payu_IN_nb = "payu_IN_nb",
1213
+ wallet_IN = "wallet_IN",
1214
+ /** issuerList */
1215
+ /** Dragonpay */
1216
+ dragonpay = "dragonpay",
1217
+ dragonpay_ebanking = "dragonpay_ebanking",
1218
+ dragonpay_otc_banking = "dragonpay_otc_banking",
1219
+ dragonpay_otc_non_banking = "dragonpay_otc_non_banking",
1220
+ dragonpay_otc_philippines = "dragonpay_otc_philippines",
1221
+ /** Dragonpay */
1222
+ /** Econtext */
1223
+ econtext = "econtext",
1224
+ econtext_atm = "econtext_atm",
1225
+ econtext_online = "econtext_online",
1226
+ econtext_seven_eleven = "econtext_seven_eleven",
1227
+ econtext_stores = "econtext_stores",
1228
+ /** Econtext */
1229
+ /** Redirect */
1230
+ giropay = "giropay",
1231
+ multibanco = "multibanco",
1232
+ redirect = "redirect",
1233
+ twint = "twint",
1234
+ vipps = "vipps",
1235
+ trustly = "trustly",
1236
+ paybybank_AIS_DD = "paybybank_AIS_DD",
1237
+ riverty = "riverty",
1238
+ paybybank_pix = "paybybank_pix",
1239
+ /** Redirect */
1240
+ /** Klarna */
1241
+ klarna = "klarna",
1242
+ klarna_account = "klarna_account",
1243
+ klarna_paynow = "klarna_paynow",
1244
+ klarna_b2b = "klarna_b2b",
1245
+ /** Klarna */
1246
+ /** QRLoader */
1247
+ bcmc_mobile = "bcmc_mobile",
1248
+ bcmc_mobile_QR = "bcmc_mobile_QR",
1249
+ pix = "pix",
1250
+ swish = "swish",
1251
+ wechatpay = "wechatpay",
1252
+ wechatpayQR = "wechatpayQR",
1253
+ promptpay = "promptpay",
1254
+ paynow = "paynow",
1255
+ duitnow = "duitnow",
1256
+ /** QRLoader */
1257
+ /** Await */
1258
+ blik = "blik",
1259
+ mbway = "mbway",
1260
+ ancv = "ancv",
1261
+ payto = "payto",
1262
+ upi = "upi",// also QR
1263
+ upi_qr = "upi_qr",// also QR
1264
+ upi_intent = "upi_intent",// also QR
1265
+ /** Await */
1266
+ /** Giftcard */
1267
+ giftcard = "giftcard",
1268
+ mealVoucher_FR = "mealVoucher_FR",
1269
+ mealVoucher_FR_natixis = "mealVoucher_FR_natixis",
1270
+ mealVoucher_FR_sodexo = "mealVoucher_FR_sodexo",
1271
+ mealVoucher_FR_groupeup = "mealVoucher_FR_groupeup"
1272
+ /** Giftcard */
1077
1273
  }
1078
1274
 
1079
- type BankTransferConfiguration = UIElementProps & BankTransferResultProps & {
1080
- /**
1081
- * Show/hide email address field
1082
- * @default true
1083
- */
1084
- showEmailAddress?: boolean;
1275
+ type AchForm = {
1276
+ selectedAccountType: string;
1277
+ ownerName: string;
1278
+ routingNumber: string;
1279
+ accountNumber: string;
1280
+ accountNumberVerification: string;
1085
1281
  };
1086
- interface BankTransferState extends UIElementProps {
1087
- data: {
1088
- shopperEmail?: string;
1089
- };
1090
- isValid: boolean;
1091
- }
1092
- interface BankTransferSchema {
1093
- shopperEmail?: string;
1094
- }
1282
+ type AchFormPrefillData = Partial<Pick<AchForm, 'ownerName'>>;
1095
1283
 
1096
- interface VoucherDetail {
1097
- label: string;
1098
- value: string;
1099
- }
1100
- interface VoucherProps {
1101
- /**
1102
- * Payment method used to generate the voucher.
1103
- */
1104
- paymentMethodType: string;
1105
- /**
1106
- * Payment method image to be displayed on the voucher.
1107
- */
1108
- imageUrl?: string;
1109
- /**
1110
- * If applicable, it will render an issuer image next to the payment method image.
1111
- */
1112
- issuerImageUrl?: string;
1113
- /**
1114
- * Voucher instructions URL.
1115
- */
1116
- instructionsUrl?: string;
1117
- /**
1118
- * Download URL for the voucher. It will display a button allowing the shopper to download it.
1119
- */
1120
- downloadUrl?: string;
1284
+ interface AchConfiguration extends UIElementProps {
1121
1285
  /**
1122
- * Text that will be displayed on the above Download button.
1286
+ * Pre-fill ACH form with shopper data
1123
1287
  */
1124
- downloadButtonText?: string;
1288
+ data?: AchFormPrefillData;
1125
1289
  /**
1126
- * Introduction text on the voucher.
1290
+ * Adds placeholder text to the input fields
1127
1291
  */
1128
- introduction?: string;
1292
+ placeholders?: AchPlaceholders;
1129
1293
  /**
1130
- * Payment reference.
1294
+ * Set to false to hide the "Account Holder Name" field if you want to pass the data yourself
1295
+ * @default true
1131
1296
  */
1132
- reference?: string;
1297
+ hasHolderName?: boolean;
1133
1298
  /**
1134
- * URL to a barcode image representing the payment reference.
1299
+ * Enables storing the payment method using the Checkbox
1300
+ * @default false
1135
1301
  */
1136
- barcode?: string;
1302
+ enableStoreDetails?: boolean;
1137
1303
  /**
1138
- * Total amount displayed on the voucher.
1304
+ * storedPaymentMethodId coming from a stored ACH in /paymentMethods response
1305
+ * @internal
1139
1306
  */
1140
- amount?: string;
1307
+ storedPaymentMethodId?: string;
1141
1308
  /**
1142
- * Any additional surcharge to the amount.
1309
+ * bankAccountNumber coming from a stored ACH in /paymentMethods response
1310
+ * @internal
1143
1311
  */
1144
- surcharge?: string;
1312
+ bankAccountNumber?: string;
1313
+ }
1314
+ interface AchPlaceholders {
1315
+ accountTypeSelector?: string;
1316
+ ownerName?: string;
1317
+ routingNumber?: string;
1318
+ accountNumber?: string;
1319
+ accountNumberVerification?: string;
1320
+ }
1321
+
1322
+ declare const SUPPORTED_LOCALES_EU: readonly ["en_GB", "de_DE", "fr_FR", "it_IT", "es_ES"];
1323
+ declare const SUPPORTED_LOCALES_US: readonly ["en_US"];
1324
+
1325
+ declare class AmazonPayElement extends UIElement<AmazonPayConfiguration> {
1326
+ static readonly type = TxVariants.amazonpay;
1327
+ protected static readonly defaultProps: Partial<AmazonPayConfiguration>;
1328
+ protected componentRef: AmazonPayComponentRef | undefined;
1329
+ formatProps(props: AmazonPayConfiguration): AmazonPayConfiguration;
1145
1330
  /**
1146
- * List of details that will be rendered on the voucher.
1331
+ * Formats the component data output
1147
1332
  */
1148
- voucherDetails?: VoucherDetail[];
1333
+ formatData(): AmazonPayElementData;
1334
+ protected beforeRender(configSetByMerchant?: AmazonPayConfiguration): void;
1335
+ getShopperDetails(): void | Promise<{
1336
+ declineFlowUrl?: string;
1337
+ } & Record<string, unknown>>;
1338
+ handleDeclineFlow(): void;
1339
+ get isValid(): boolean;
1340
+ get browserInfo(): BrowserInfo;
1341
+ submit(): void;
1342
+ protected componentToRender(): h.JSX.Element;
1343
+ }
1344
+
1345
+ type ButtonColor = 'Gold' | 'LightGray' | 'DarkGray';
1346
+ type Placement = 'Home' | 'Product' | 'Cart' | 'Checkout' | 'Other';
1347
+ type ProductType = 'PayOnly' | 'PayAndShip';
1348
+ type ChargePermissionType = 'OneTime' | 'Recurring';
1349
+ type FrequencyUnit = 'Year' | 'Month' | 'Week' | 'Day' | 'Variable';
1350
+ type Currency = 'EUR' | 'GBP' | 'USD';
1351
+ type Region = 'EU' | 'UK' | 'US';
1352
+ type SupportedLocale = (typeof SUPPORTED_LOCALES_EU)[number] | (typeof SUPPORTED_LOCALES_US)[number];
1353
+ interface AmazonPayButtonInstance {
1354
+ onClick(handler: () => void): void;
1355
+ }
1356
+ interface AmazonWindowObject {
1357
+ Pay: {
1358
+ renderButton(selector: string, settings: AmazonPayButtonSettings): AmazonPayButtonInstance;
1359
+ initCheckout(options: AmazonPayButtonSettings & {
1360
+ createCheckoutSessionConfig: CheckoutSessionConfig;
1361
+ }): void;
1362
+ signout(): void;
1363
+ bindChangeAction(selector: string, options: ChangeActionOptions): void;
1364
+ };
1365
+ }
1366
+ interface RecurringMetadata {
1367
+ frequency: {
1368
+ unit: string;
1369
+ value: FrequencyUnit;
1370
+ };
1371
+ amount: {
1372
+ amount: string;
1373
+ currencyCode: Currency;
1374
+ };
1375
+ }
1376
+ interface AmazonPayBackendConfiguration {
1377
+ merchantId?: string;
1378
+ publicKeyId?: string;
1379
+ region?: Region;
1380
+ storeId?: string;
1381
+ }
1382
+ interface AmazonPayConfiguration extends UIElementProps {
1383
+ addressDetails?: AddressDetails;
1384
+ amazonPayToken?: string;
1385
+ amazonCheckoutSessionId?: string;
1386
+ amount?: PaymentAmount;
1387
+ buttonColor?: ButtonColor;
1388
+ cancelUrl?: string;
1389
+ chargePermissionType?: ChargePermissionType;
1390
+ checkoutMode?: string;
1391
+ clientKey?: string;
1392
+ configuration?: AmazonPayBackendConfiguration;
1393
+ currency?: Currency;
1394
+ deliverySpecifications?: DeliverySpecifications;
1395
+ design?: string;
1396
+ environment?: string;
1397
+ loadingContext?: string;
1398
+ locale?: string;
1399
+ merchantMetadata?: MerchantMetadata;
1400
+ onSubmit?(state: SubmitData, element: AmazonPayElement, actions: {
1401
+ resolve: (response: CheckoutAdvancedFlowResponse) => void;
1402
+ reject: () => void;
1403
+ }): void;
1404
+ payButton?: (props: PayButtonProps) => h.JSX.Element;
1405
+ placement?: Placement;
1406
+ productType?: ProductType;
1407
+ recurringMetadata?: RecurringMetadata;
1408
+ returnUrl?: string;
1409
+ showChangePaymentDetailsButton?: boolean;
1410
+ showOrderButton?: boolean;
1411
+ showSignOutButton?: boolean;
1412
+ signature?: string;
1413
+ onClick?: (resolve: (value?: unknown) => void, reject: () => void) => Promise<void>;
1414
+ onError?: (error: AdyenCheckoutError, component: UIElement) => void;
1415
+ onSignOut?: (resolve: (value?: unknown) => void, reject: () => void) => Promise<void>;
1149
1416
  /**
1150
- * Additional CSS classes.
1417
+ * Used for analytics
1151
1418
  */
1152
- className?: string;
1419
+ expressPage?: 'cart' | 'minicart' | 'pdp' | 'checkout';
1153
1420
  /**
1154
- * Show/Hide a button to copy the payment reference. It will only show if a reference is available.
1421
+ * Used for analytics
1422
+ * @defaultValue false
1155
1423
  */
1156
- copyBtn?: boolean;
1157
- /**
1158
- * Show/Hide payment reference value.
1159
- * @default true
1424
+ isExpress?: boolean;
1425
+ }
1426
+ type AmazonPayComponentRef = ComponentMethodsRef & {
1427
+ getSubmitFunction?: () => () => void;
1428
+ };
1429
+ interface AmazonPayComponentProps extends AmazonPayConfiguration {
1430
+ showSignOutButton?: boolean;
1431
+ amazonCheckoutSessionId?: string;
1432
+ showOrderButton?: boolean;
1433
+ showChangePaymentDetailsButton?: boolean;
1434
+ setComponentRef: (ref: AmazonPayComponentRef) => void;
1435
+ }
1436
+ interface AmazonPayButtonProps {
1437
+ amazonRef: AmazonWindowObject;
1438
+ buttonColor?: ButtonColor;
1439
+ cancelUrl?: string;
1440
+ chargePermissionType?: ChargePermissionType;
1441
+ clientKey?: string;
1442
+ configuration?: AmazonPayBackendConfiguration;
1443
+ currency?: Currency;
1444
+ deliverySpecifications?: DeliverySpecifications;
1445
+ design?: string;
1446
+ environment?: string;
1447
+ locale?: string;
1448
+ onClick: (resolve: (value?: unknown) => void, reject: () => void) => Promise<void>;
1449
+ onError?: (error: AdyenCheckoutError, component: UIElement) => void;
1450
+ placement?: Placement;
1451
+ productType?: ProductType;
1452
+ recurringMetadata?: RecurringMetadata;
1453
+ ref: RefObject<{
1454
+ initCheckout(): void;
1455
+ }>;
1456
+ returnUrl?: string;
1457
+ showPayButton: boolean;
1458
+ }
1459
+ interface SignOutButtonProps {
1460
+ amazonRef: AmazonWindowObject;
1461
+ onSignOut: (resolve: (value?: unknown) => void, reject: () => void) => Promise<void>;
1462
+ }
1463
+ interface ChangePaymentDetailsButtonProps {
1464
+ amazonCheckoutSessionId: string;
1465
+ amazonRef: AmazonWindowObject;
1466
+ }
1467
+ interface ChangeActionOptions {
1468
+ amazonCheckoutSessionId: string;
1469
+ changeAction: 'changeAddress' | 'changePayment';
1470
+ }
1471
+ interface OrderButtonProps {
1472
+ amazonCheckoutSessionId: string;
1473
+ clientKey: string;
1474
+ chargePermissionType?: ChargePermissionType;
1475
+ onError: (error: AdyenCheckoutError, component: UIElement) => void;
1476
+ recurringMetadata: RecurringMetadata;
1477
+ ref: RefObject<{
1478
+ createOrder(): void;
1479
+ }>;
1480
+ region: Region;
1481
+ returnUrl: string;
1482
+ publicKeyId: string;
1483
+ }
1484
+ interface AmazonPayElementData {
1485
+ paymentMethod: {
1486
+ type: string;
1487
+ checkoutSessionId?: string;
1488
+ };
1489
+ browserInfo: BrowserInfo;
1490
+ }
1491
+ interface AmazonPayButtonSettings {
1492
+ buttonColor?: ButtonColor;
1493
+ design?: string;
1494
+ /**
1495
+ * Amazon Pay merchant account identifier
1160
1496
  */
1161
- showReferenceValue?: boolean;
1497
+ merchantId: string;
1162
1498
  /**
1163
- * Label for the payment reference.
1499
+ * Sets button to Sandbox environment
1164
1500
  */
1165
- paymentReferenceLabel?: string;
1166
- onActionHandled?: (rtnObj: ActionHandledReturnObject) => void;
1167
- }
1168
- interface VoucherConfiguration extends UIElementProps {
1169
- reference?: string;
1170
- url?: string;
1171
- paymentMethodType?: string;
1172
- }
1173
- type CommonVoucherProps = Pick<VoucherProps, 'paymentMethodType' | 'introduction' | 'imageUrl' | 'amount' | 'reference' | 'onActionHandled'>;
1174
-
1175
- interface BoletoConfiguration extends VoucherConfiguration {
1501
+ sandbox: boolean;
1176
1502
  /**
1177
- * Set to false if you have already collected the shopper's first name, last name, and CPF/CNPJ (socialSecurityNumber).
1178
- * @default true
1503
+ * Product type selected for checkout
1179
1504
  */
1180
- personalDetailsRequired?: boolean;
1505
+ productType: ProductType;
1181
1506
  /**
1182
- * Set this to false if you have already collected the shopper's street, house number or name, city, postal code, and state or province.
1183
- * @default true
1507
+ * Placement of the Amazon Pay button on your website
1184
1508
  */
1185
- billingAddressRequired?: boolean;
1509
+ placement: Placement;
1186
1510
  /**
1187
- * Set this to false if you have already collected the shopper's email address.
1188
- * @default true
1511
+ * Language used to render the button and text on Amazon Pay hosted pages. Please note that supported language(s) is dependent on the region that your Amazon Pay account was registered for
1189
1512
  */
1190
- showEmailAddress?: boolean;
1513
+ checkoutLanguage: SupportedLocale;
1191
1514
  /**
1192
- * Object to pre-fill shopper details on the form
1515
+ * Ledger currency provided during registration for the given merchant identifier
1193
1516
  */
1194
- data?: BoletoInputDataState;
1517
+ ledgerCurrency: Currency;
1195
1518
  }
1196
- interface BoletoElementProps {
1197
- type: string;
1198
- i18n: Language;
1199
- loadingContext: string;
1200
- reference?: string;
1519
+ interface MerchantMetadata {
1520
+ customInformation?: string;
1521
+ merchantReferenceId?: string;
1522
+ merchantStoreName?: string;
1523
+ noteToBuyer?: string;
1201
1524
  }
1202
- interface BoletoInputDataState {
1203
- firstName?: string;
1204
- lastName?: string;
1205
- billingAddress?: AddressData;
1206
- socialSecurityNumber?: string;
1207
- shopperEmail?: string;
1525
+ interface AddressDetails {
1526
+ name?: string;
1527
+ addressLine1?: string;
1528
+ addressLine2?: string;
1529
+ addressLine3?: string;
1530
+ city?: string;
1531
+ districtOrCounty?: string;
1532
+ stateOrRegion?: string;
1533
+ postalCode?: string;
1534
+ countryCode?: string;
1535
+ phoneNumber?: string;
1208
1536
  }
1209
- interface BoletoInputValidState {
1210
- firstName?: boolean;
1211
- lastName?: boolean;
1212
- shopperEmail?: boolean;
1213
- socialSecurityNumber?: boolean;
1214
- billingAddress?: boolean;
1537
+ interface ChargeAmount {
1538
+ amount: string;
1539
+ currencyCode: Currency;
1215
1540
  }
1216
- interface BoletoInputErrorState {
1217
- firstName?: boolean;
1218
- lastName?: boolean;
1219
- shopperEmail?: boolean;
1220
- socialSecurityNumber?: boolean;
1541
+ type LedgerCurrencies = {
1542
+ [key in Region]: Currency;
1543
+ };
1544
+ interface PayloadJSON {
1545
+ addressDetails?: AddressDetails;
1546
+ chargePermissionType?: ChargePermissionType;
1547
+ deliverySpecifications?: DeliverySpecifications;
1548
+ merchantMetadata?: MerchantMetadata;
1549
+ paymentDetails?: {
1550
+ chargeAmount: ChargeAmount;
1551
+ paymentIntent: 'Confirm';
1552
+ presentmentCurrency: Currency;
1553
+ totalOrderAmount: ChargeAmount;
1554
+ };
1555
+ recurringMetadata?: RecurringMetadata;
1556
+ storeId: string;
1557
+ webCheckoutDetails: {
1558
+ checkoutCancelUrl?: string;
1559
+ checkoutMode?: 'ProcessOrder';
1560
+ checkoutResultReturnUrl?: string;
1561
+ checkoutReviewReturnUrl?: string;
1562
+ };
1563
+ }
1564
+ interface CheckoutDetailsRequest {
1565
+ checkoutSessionId: string;
1566
+ getDeliveryAddress?: boolean;
1567
+ getDeclineFlowUrl?: boolean;
1568
+ publicKeyId: string;
1569
+ region?: Region;
1570
+ }
1571
+ interface UpdateAmazonCheckoutSessionRequest {
1572
+ amount: PaymentAmount;
1573
+ chargePermissionType?: ChargePermissionType;
1574
+ checkoutCancelUrl?: string;
1575
+ checkoutResultReturnUrl: string;
1576
+ checkoutSessionId: string;
1577
+ publicKeyId: string;
1578
+ recurringMetadata?: RecurringMetadata;
1579
+ region: Region;
1580
+ }
1581
+ interface CheckoutSessionConfig {
1582
+ payloadJSON: string;
1583
+ signature: string;
1584
+ publicKeyId: string;
1585
+ }
1586
+ interface DeliverySpecifications {
1587
+ specialRestrictions?: string[];
1588
+ addressRestrictions?: AddressRestrictions;
1589
+ }
1590
+ interface AddressRestrictions {
1591
+ type?: 'Allowed' | 'NotAllowed';
1592
+ restrictions?: Restrictions;
1593
+ }
1594
+ interface Restrictions {
1595
+ [key: string]: {
1596
+ zipCodes?: string[];
1597
+ statesOrRegions?: string[];
1598
+ };
1221
1599
  }
1222
1600
 
1223
- interface CashAppPayConfiguration extends UIElementProps {
1224
- /**
1225
- * Indicates that the payment must be stored (Ex: in case there is no checkbox but merchant wants to store it)
1226
- */
1227
- storePaymentMethod?: boolean;
1601
+ interface ANCVConfiguration extends UIElementProps {
1602
+ paymentData?: string;
1603
+ data: ANCVDataState;
1604
+ onOrderRequest?: onOrderRequestCallbackType;
1605
+ onOrderUpdated?: onOrderUpdatedCallbackType;
1606
+ }
1607
+ interface ANCVDataState {
1608
+ beneficiaryId: string;
1609
+ }
1610
+
1611
+ type Initiative = 'web' | 'messaging';
1612
+ type ApplePayPaymentOrderDetails = {
1613
+ orderTypeIdentifier: string;
1614
+ orderIdentifier: string;
1615
+ webServiceURL: string;
1616
+ authenticationToken: string;
1617
+ };
1618
+ type ApplePayPaymentAuthorizationResult = ApplePayJS.ApplePayPaymentAuthorizationResult & {
1619
+ orderDetails?: ApplePayPaymentOrderDetails;
1620
+ };
1621
+ type ApplePayButtonType = 'add-money' | 'book' | 'buy' | 'check-out' | 'continue' | 'contribute' | 'donate' | 'order' | 'pay' | 'plain' | 'reload' | 'rent' | 'set-up' | 'subscribe' | 'support' | 'tip' | 'top-up';
1622
+ type ApplePayButtonStyle = 'black' | 'white' | 'white-outline';
1623
+ interface ApplePayConfiguration extends UIElementProps {
1228
1624
  /**
1229
- * Enables storing the payment method using the Checkbox
1625
+ * Enables the ApplePay Express Flow & also used for analytics
1626
+ * @defaultValue false
1230
1627
  */
1231
- enableStoreDetails?: boolean;
1628
+ isExpress?: boolean;
1232
1629
  /**
1233
- * Callback triggered before starting the CashAppPay flow. Use case: Validate customer data, check product availability
1630
+ * Used for analytics
1234
1631
  */
1235
- onClick?(actions: {
1236
- resolve: () => void;
1237
- reject: () => void;
1238
- }): void;
1632
+ expressPage?: 'cart' | 'minicart' | 'pdp' | 'checkout';
1239
1633
  /**
1240
- * A reference to your system (for example, a cart or checkout identifier). Maximum length 1024 characters.
1241
- * https://developers.cash.app/docs/api/technical-documentation/sdks/pay-kit/technical-reference#parameters-3
1634
+ * The Apple Pay version number your website supports.
1635
+ * @default highest supported version by the shopper device
1636
+ * @see {@link https://developer.apple.com/documentation/applepayontheweb/apple-pay-on-the-web-version-history Apple Pay on the Web Version History}
1242
1637
  */
1243
- referenceId?: string;
1638
+ version?: number;
1244
1639
  /**
1245
- * The destination for the customer after approving (or declining) in Cash App for mobile redirect flow.
1246
- * https://developers.cash.app/docs/api/technical-documentation/sdks/pay-kit/technical-reference#customerrequest
1247
- * @defaultValue window.location.ref
1640
+ * Part of the 'ApplePayLineItem' object, which sets the label of the payment request
1641
+ * @see {@link https://developer.apple.com/documentation/applepayontheweb/applepaylineitem ApplePayLineItem docs}
1248
1642
  */
1249
- redirectURL?: string;
1643
+ totalPriceLabel?: string;
1250
1644
  /**
1251
- * Button customization
1252
- * https://developers.cash.app/docs/api/technical-documentation/sdks/pay-kit/use-cases#customize-the-cash-app-pay-button
1645
+ * @default 'final'
1253
1646
  */
1254
- button?: {
1255
- shape?: 'semiround' | 'round';
1256
- size?: 'medium' | 'small';
1257
- theme?: 'dark' | 'light';
1258
- width?: 'static' | 'full';
1259
- };
1647
+ totalPriceStatus?: ApplePayJS.ApplePayLineItemType;
1260
1648
  /**
1261
- * CashAppPay configuration sent by the /paymentMethods response
1649
+ * ApplePay configuration sent by the /paymentMethods response
1262
1650
  */
1263
1651
  configuration?: {
1264
- clientId: string;
1265
- scopeId: string;
1652
+ merchantName?: string;
1653
+ merchantId?: string;
1266
1654
  };
1267
1655
  /**
1268
- * If payment is tokenized, then API will return its ID
1269
- * @internal
1656
+ * Used to override the domain name for the Apple Pay button. Useful when using ApplePay within cross-domain iframe
1657
+ * For more context: https://github.com/Adyen/adyen-web/pull/3340
1270
1658
  */
1271
- storedPaymentMethodId?: string;
1659
+ domainName?: string;
1660
+ clientKey?: string;
1661
+ initiative?: Initiative;
1272
1662
  /**
1273
- * If payment is tokenized, then API will return this value
1274
- * @internal
1663
+ * A set of line items that explain recurring payments and/or additional charges.
1275
1664
  */
1276
- cashtag?: string;
1277
- }
1278
- type CashAppPayElementData = {
1279
- paymentMethod: {
1280
- type: string;
1281
- grantId?: string;
1282
- storedPaymentMethodId?: string;
1283
- };
1284
- storePaymentMethod?: boolean;
1285
- };
1286
- type CashAppPayEventData = {
1287
- cashTag?: string;
1288
- customerId?: string;
1289
- grantId?: string;
1290
- onFileGrantId?: string;
1291
- };
1292
-
1293
- interface TimeoutErrorProps {
1294
- source: string;
1295
- scheme: string;
1296
- isTimeoutTriggeredBySchemeSdk: boolean;
1297
- }
1298
- declare class TimeoutError extends Error {
1299
- scheme: string;
1300
- source: string;
1301
- isTimeoutTriggeredBySchemeSdk: boolean;
1302
- /** Currently populated only by Visa SDK if available */
1303
- correlationId?: string;
1304
- constructor(options: TimeoutErrorProps);
1305
- setCorrelationId(correlationId: string): void;
1306
- toString(): string;
1307
- }
1308
-
1309
- type ClickToPayProps = {
1665
+ lineItems?: ApplePayJS.ApplePayLineItem[];
1666
+ /**
1667
+ * The payment capabilities supported by the merchant.
1668
+ * The value must at least contain ApplePayMerchantCapability.supports3DS.
1669
+ * @default ['supports3DS']
1670
+ */
1671
+ merchantCapabilities?: ApplePayJS.ApplePayMerchantCapability[];
1310
1672
  /**
1311
- * Shopper email used to be recognized with the Network schemes
1673
+ * A value that indicates whether the shipping mode prevents the user from editing the shipping address.
1674
+ * {@link https://developer.apple.com/documentation/applepayontheweb/applepaypaymentrequest/shippingcontacteditingmode}
1312
1675
  */
1313
- shopperEmail?: string;
1676
+ shippingContactEditingMode?: ApplePayJS.ApplePayShippingContactEditingMode;
1314
1677
  /**
1315
- * Shopper telephone number used to be recognized with the Network schemes
1678
+ * A set of shipping method objects that describe the available shipping methods.
1316
1679
  */
1317
- telephoneNumber?: string;
1680
+ shippingMethods?: ApplePayJS.ApplePayShippingMethod[];
1318
1681
  /**
1319
- * Used to display the merchant name in case the DCF appears (ex: first time doing transaction in the device),
1682
+ * How the items are to be shipped.
1320
1683
  */
1321
- merchantDisplayName?: string;
1684
+ shippingType?: ApplePayJS.ApplePayShippingType;
1322
1685
  /**
1323
- * Used to ensure the correct language and user experience if DCF screen is displayed. As a fallback, it uses the main locale
1324
- * defined during the creation of the Checkout.
1325
- * Format: ISO language_country pair (e.g., en_US )
1326
- *
1327
- * @defaultValue en_US
1686
+ * A list of ISO 3166 country codes for limiting payments to cards from specific countries.
1328
1687
  */
1329
- locale?: string;
1688
+ supportedCountries?: string[];
1330
1689
  /**
1331
- * Disable autofocus on the One Time Password input field when it is either displayed or when the OTP is resent
1332
- * @defaultValue false
1690
+ * The payment networks supported by the merchant.
1333
1691
  */
1334
- disableOtpAutoFocus?: boolean;
1692
+ supportedNetworks?: string[];
1335
1693
  /**
1336
- * Callback triggered when the Click to Pay component is ready to be used
1694
+ * ApplePayRecurringPaymentRequest - Represents a request to set up a recurring payment, typically a subscription.
1695
+ * {@link https://developer.apple.com/documentation/applepayontheweb/applepayrecurringpaymentrequest}
1337
1696
  */
1338
- onReady?(): void;
1697
+ recurringPaymentRequest?: ApplePayJS.ApplePayRecurringPaymentRequest;
1339
1698
  /**
1340
- * Callback triggered when a timeout happens within Click to Pay service.
1341
- * Ex: Network schemes took too long to initialize
1699
+ * The billing information that you require from the user in order to process the transaction.
1342
1700
  */
1343
- onTimeout?(error: TimeoutError): void;
1344
- };
1345
- type ClickToPayScheme = 'mc' | 'visa';
1346
-
1347
- declare enum AnalyticsEventCategory {
1348
- info = "info",
1349
- error = "error",
1350
- log = "log"
1351
- }
1352
- declare abstract class AbstractAnalyticsEvent {
1353
- private readonly timestamp;
1354
- private readonly id;
1701
+ requiredBillingContactFields?: ApplePayJS.ApplePayContactField[];
1355
1702
  /**
1356
- * Component tx variant or identifier
1357
- * @private
1703
+ * The shipping information that you require from the user in order to fulfill the order.
1358
1704
  */
1359
- private readonly component;
1360
- abstract getEventCategory(): AnalyticsEventCategory;
1361
- protected constructor(component: string);
1362
- }
1363
-
1364
- interface AnalyticsOptions {
1705
+ requiredShippingContactFields?: ApplePayJS.ApplePayContactField[];
1365
1706
  /**
1366
- * Enable/Disable all analytics
1707
+ * Billing contact information for the user.
1367
1708
  */
1368
- enabled?: boolean;
1709
+ billingContact?: ApplePayJS.ApplePayPaymentContact;
1369
1710
  /**
1370
- * A wrapper to pass data needed when analytics is setup
1711
+ * Shipping contact information for the user.
1371
1712
  */
1372
- analyticsData?: {
1373
- /**
1374
- * Relates to PMs used within Plugins
1375
- * https://docs.adyen.com/development-resources/application-information/?tab=integrator_built_2#application-information-fields
1376
- * @internal
1377
- */
1378
- applicationInfo?: ApplicationInfo;
1379
- /**
1380
- * Use a checkoutAttemptId from a previous page
1381
- */
1382
- checkoutAttemptId?: string;
1383
- };
1384
- }
1385
- interface ApplicationInfo {
1386
- externalPlatform: {
1387
- name: string;
1388
- version: string;
1389
- integrator: string;
1390
- };
1391
- merchantApplication: {
1392
- name: string;
1393
- version: string;
1394
- };
1395
- merchantDevice?: {
1396
- os: string;
1397
- osVersion: string;
1398
- };
1399
- }
1400
-
1401
- interface IAnalytics {
1402
- checkoutAttemptId?: string;
1403
- setUp({ sessionId, checkoutStage, locale }: {
1404
- sessionId?: string;
1405
- checkoutStage?: 'precheckout' | 'checkout';
1406
- locale?: string;
1407
- }): Promise<void>;
1408
- sendFlavor(flavor: 'dropin' | 'components'): Promise<void>;
1409
- sendAnalytics(event: AbstractAnalyticsEvent): void;
1410
- flush(): void;
1411
- }
1412
-
1413
- type MastercardCheckout = {
1414
- srcDigitalCardId: string;
1415
- srcCorrelationId: string;
1416
- srcScheme: string;
1417
- };
1418
- type VisaCheckout = {
1419
- srcCheckoutPayload?: string;
1420
- srcTokenReference?: string;
1421
- srcCorrelationId: string;
1422
- srcScheme: string;
1423
- };
1424
- type ClickToPayCheckoutPayload = VisaCheckout | MastercardCheckout;
1425
-
1426
- type ClickToPayConfiguration = UIElementProps & ClickToPayProps & {
1713
+ shippingContact?: ApplePayJS.ApplePayPaymentContact;
1427
1714
  /**
1428
- * ClickToPay configuration sent by the /paymentMethods response
1715
+ * It can be used to render the Apple Pay Code in a new window rather than as an overlay modal
1716
+ * Recommended to be used in case of using Apple Pay within an iframe, where the modal may not be presented correctly over the parent website
1717
+ *
1718
+ * @defaultValue 'modal'
1429
1719
  */
1430
- configuration?: {
1431
- mcDpaId?: string;
1432
- mcSrcClientId?: string;
1433
- visaSrcInitiatorId?: string;
1434
- visaSrciDpaId?: string;
1435
- };
1436
- };
1437
- type ClickToPayPaymentData = {
1438
- paymentMethod: ClickToPayCheckoutPayload & {
1439
- type: string;
1440
- };
1441
- origin: string;
1442
- browserInfo: BrowserInfo;
1443
- };
1444
-
1445
- interface TouchStartEventObj {
1446
- fieldType: string;
1447
- name?: string;
1448
- }
1449
-
1450
- type PlaceholderKeys$1 = 'cardNumber' | 'securityCode' | 'expiryDate';
1451
- type Placeholders$1 = Partial<Record<PlaceholderKeys$1, string>>;
1452
- type GiftcardFieldsProps = {
1453
- setRootNode: (input: HTMLElement) => void;
1454
- i18n: Language;
1455
- pinRequired: boolean;
1456
- sfpState: SFPState;
1457
- getCardErrorMessage: any;
1458
- focusedElement: any;
1459
- setFocusOn: any;
1460
- label?: string;
1461
- };
1720
+ renderApplePayCodeAs?: ApplePayWebConfiguration['renderApplePayCodeAs'];
1721
+ /**
1722
+ * Optional user-defined data.
1723
+ */
1724
+ applicationData?: string;
1725
+ /**
1726
+ * Called when the shopper clicks the Apple Pay button
1462
1727
 
1463
- /**
1464
- * SecuredFieldsProvider:
1465
- * Initialises & handles the client-side part of SecuredFields
1466
- */
1467
- declare class SecuredFieldsProvider extends Component<SFPProps, SFPState> {
1468
- private csfLoadFailTimeout;
1469
- private readonly csfLoadFailTimeoutMS;
1470
- private readonly csfConfigFailTimeout;
1471
- private readonly csfConfigFailTimeoutMS;
1472
- private numCharsInField;
1473
- private rootNode;
1474
- private numDateFields;
1475
- private csf;
1476
- private readonly handleOnLoad;
1477
- private readonly handleOnConfigSuccess;
1478
- private readonly handleOnFieldValid;
1479
- private readonly handleOnAllValid;
1480
- private readonly handleOnBrand;
1481
- private readonly handleFocus;
1482
- private readonly handleOnError;
1483
- private readonly handleOnAutoComplete;
1484
- private readonly handleOnNoDataRequired;
1485
- private readonly handleOnTouchstartIOS;
1486
- private readonly handleKeyDown;
1487
- state: SFPState;
1488
- props: SFPProps;
1489
- private issuingCountryCode;
1490
- constructor(props: SFPProps);
1491
- static readonly defaultProps: {
1492
- type: string;
1493
- keypadFix: boolean;
1494
- rootNode: any;
1495
- loadingContext: any;
1496
- brands: any[];
1497
- showWarnings: boolean;
1498
- autoFocus: boolean;
1499
- trimTrailingSeparator: boolean;
1500
- onChange: () => void;
1501
- onLoad: () => void;
1502
- onConfigSuccess: () => void;
1503
- onAllValid: () => void;
1504
- onFieldValid: () => void;
1505
- onBrand: () => void;
1506
- onError: () => void;
1507
- onBinValue: () => void;
1508
- onFocus: () => void;
1509
- onAutoComplete: () => void;
1510
- handleKeyDown: () => void;
1511
- styles: {};
1512
- };
1513
- componentDidMount(): void;
1514
- componentDidUpdate(): void;
1515
- componentWillUnmount(): void;
1516
- private initializeCSF;
1517
- private checkForKCPFields;
1518
- getChildContext(): object;
1519
- handleUnsupportedCard(errObj: CardErrorData): boolean;
1520
- setFocusOn(frame: SFFieldType): void;
1521
- updateStyles(stylesObj: StylesObject): void;
1522
- sfIsOptionalOrHidden(fieldType: string): boolean;
1523
- destroy(): void;
1524
- getRootNode(): HTMLElement;
1525
- showValidation(): void;
1728
+ * @param resolve - Must be called if the button should be displayed
1729
+ * @param reject - Must be called if the button should not be displayed
1730
+ * @returns
1731
+ */
1732
+ onClick?: (resolve: () => void, reject: () => void) => void;
1733
+ /**
1734
+ * A callback function the Apple Pay SDK calls when the Apple Pay code modal or window closes.
1735
+ */
1736
+ onApplePayCodeClose?: ApplePayWebConfiguration['onApplePayCodeClose'];
1737
+ /**
1738
+ * Callback called when ApplePay authorize the payment.
1739
+ * Must be resolved/rejected with the action object.
1740
+ *
1741
+ * @param data - Authorization event from ApplePay, along with formatted billingAddress and deliveryAddress
1742
+ * @param actions - Object to continue/stop with the payment flow
1743
+ *
1744
+ * @remarks
1745
+ * If actions.resolve() is called, the payment flow will be triggered.
1746
+ * If actions.reject() is called, the overlay will display an error
1747
+ */
1748
+ onAuthorized?: (data: {
1749
+ authorizedEvent: ApplePayJS.ApplePayPaymentAuthorizedEvent;
1750
+ billingAddress?: Partial<AddressData>;
1751
+ deliveryAddress?: Partial<AddressData>;
1752
+ }, actions: {
1753
+ resolve: () => void;
1754
+ reject: (error?: ApplePayJS.ApplePayError) => void;
1755
+ }) => void;
1756
+ /**
1757
+ * Collect the order tracking details if available.
1758
+ * This callback is invoked when a successfull payment is resolved
1759
+ *
1760
+ * {@link https://developer.apple.com/documentation/applepayontheweb/applepaypaymentorderdetails}
1761
+ * @param resolve - Must be called with the orderDetails fields
1762
+ * @param reject - Must be called if something failed during the order creation. Calling 'reject' won't cancel the payment flow
1763
+ */
1764
+ onOrderTrackingRequest?: (resolve: (orderDetails: ApplePayPaymentOrderDetails) => void, reject: () => void) => void;
1526
1765
  /**
1527
- * Map SF errors to ValidationRuleResult-like objects, for CardInput component
1766
+ * An event handler the system calls when it displays the payment sheet
1767
+ *
1768
+ * {@link https://developer.apple.com/documentation/applepayontheweb/applepaysession/onvalidatemerchant}
1769
+ * @param resolve - Must be called with an opaque message session object
1770
+ * @param reject - Must be called if something failed during the merchant validation
1771
+ * @param validationURL - The URL your server must use to validate itself and obtain a merchant session object.
1528
1772
  */
1529
- mapErrorsToValidationRuleResult(): SFStateErrorObj;
1530
- processBinLookupResponse(binLookupResponse: BinLookupResponse, resetObject: SingleBrandResetObject): void;
1531
- private setRootNode;
1532
- render(props: any, state: SFPState): any;
1533
- }
1534
-
1535
- type Placeholders = CardPlaceholders | Placeholders$1;
1536
- /**
1537
- * Should be the only props that can be sent to SFP (from CardInput, SecuredFieldsInput, GiftcardComponent)
1538
- */
1539
- interface SFPProps {
1540
- ref?: Ref<SecuredFieldsProvider>;
1541
- autoFocus?: boolean;
1542
- brands?: string[];
1543
- brandsConfiguration?: CardBrandsConfiguration;
1544
- clientKey: string;
1545
- componentType: string;
1546
- countryCode?: string;
1547
- forceCompat?: boolean;
1548
- hasKoreanFields?: boolean;
1549
- i18n?: Language;
1550
- implementationType?: 'components' | 'custom';
1551
- keypadFix?: boolean;
1552
- koreanAuthenticationRequired?: boolean;
1553
- legacyInputMode?: boolean;
1554
- loadingContext: string;
1555
- minimumExpiryDate?: string;
1556
- onAdditionalSFConfig?: () => void;
1557
- onAdditionalSFRemoved?: () => void;
1558
- onAllValid?: (obj: CardAllValidData) => void;
1559
- onAutoComplete?: (obj: CardAutoCompleteData) => void;
1560
- onBinValue?: (obj: CardBinValueData) => void;
1561
- onBrand?: (obj: CardBrandData) => void;
1562
- onChange?: (state: SFPState, eventDetails?: OnChangeEventDetails) => void;
1563
- onConfigSuccess?: (cbObj: CardConfigSuccessData) => void;
1564
- onError?: (error: AdyenCheckoutError) => void;
1565
- onFieldValid?: (fieldObj: CardFieldValidData) => void;
1566
- onFocus?: (obj: CardFocusData) => void;
1567
- onLoad?: (cbObj: CardLoadData) => void;
1568
- onStateUpdate?: (obj: SFPState) => void;
1569
- onSubmitAnalytics?: (event: AbstractAnalyticsEvent) => void;
1570
- handleKeyDown?: (event: KeyboardEvent) => void;
1571
- rootNode?: HTMLElement;
1572
- showWarnings?: boolean;
1573
- styles?: StylesObject;
1574
- trimTrailingSeparator?: boolean;
1575
- type: string;
1576
- render?: (helpers: {
1577
- setRootNode: (input: HTMLElement) => void;
1578
- setFocusOn: (fieldName: string) => void;
1579
- }, state: SFPState) => ComponentChildren;
1580
- resources?: Resources;
1581
- maskSecurityCode?: boolean;
1582
- exposeExpiryDate?: boolean;
1583
- disableIOSArrowKeys?: (obj: TouchStartEventObj) => void | null;
1584
- placeholders?: Placeholders;
1585
- showContextualElement?: boolean;
1773
+ onValidateMerchant?: (resolve: (merchantSession: unknown) => void, reject: (error?: string) => void, validationURL: string) => Promise<void>;
1774
+ /**
1775
+ * An event handler to call when the user selects a new payment method.
1776
+ *
1777
+ * {@link https://developer.apple.com/documentation/applepayontheweb/applepaysession/onpaymentmethodselected}
1778
+ * @param resolve - Completes the selection of a payment method with an update.
1779
+ * @param reject - Completes the selection of a payment method with no update.
1780
+ * @param event - The event parameter contains the paymentMethod attribute.
1781
+ */
1782
+ onPaymentMethodSelected?: (resolve: (paymentMethodUpdate: ApplePayJS.ApplePayPaymentMethodUpdate) => void, reject: (paymentMethodUpdate: ApplePayJS.ApplePayPaymentMethodUpdate) => void, event: ApplePayJS.ApplePayPaymentMethodSelectedEvent) => void;
1783
+ /**
1784
+ * An event handler to call when the user selects a shipping contact in the payment sheet.
1785
+ *
1786
+ * {@link https://developer.apple.com/documentation/applepayontheweb/applepaysession/onshippingcontactselected}
1787
+ * @param resolve - Completes the selection of a shipping contact with an update.
1788
+ * @param reject - Completes the selection of a shipping contact with no update.
1789
+ * @param event - The event parameter contains the shippingContact attribute.
1790
+ */
1791
+ onShippingContactSelected?: (resolve: (shippingContactUpdate: ApplePayJS.ApplePayShippingContactUpdate) => void, reject: (shippingContactUpdate: ApplePayJS.ApplePayShippingContactUpdate) => void, event: ApplePayJS.ApplePayShippingContactSelectedEvent) => void;
1792
+ /**
1793
+ * Completes the selection of a shipping method with an update.
1794
+ *
1795
+ * {@link https://developer.apple.com/documentation/applepayontheweb/applepaysession/completeshippingmethodselection}
1796
+ * @param resolve - Completes the selection of a shipping method with an update.
1797
+ * @param reject - Completes the selection of a shipping method with no update.
1798
+ * @param event - The event parameter contains the shippingMethod attribute.
1799
+ */
1800
+ onShippingMethodSelected?: (resolve: (shippingMethodUpdate: ApplePayJS.ApplePayShippingMethodUpdate) => void, reject: (shippingMethodUpdate: ApplePayJS.ApplePayShippingMethodUpdate) => void, event: ApplePayJS.ApplePayShippingMethodSelectedEvent) => void;
1801
+ /**
1802
+ * The initial coupon code for the payment request.
1803
+ * @see {@link https://developer.apple.com/documentation/applepayontheweb/applepaypaymentrequest/couponcode couponCode docs}
1804
+ */
1805
+ couponCode?: ApplePayJS.ApplePayPaymentRequest['couponCode'];
1806
+ /**
1807
+ * A Boolean value that determines whether the payment sheet displays the coupon code field.
1808
+ * @see {@link https://developer.apple.com/documentation/applepayontheweb/applepaypaymentrequest/supportscouponcode supportsCouponCode docs}
1809
+ */
1810
+ supportsCouponCode?: ApplePayJS.ApplePayPaymentRequest['supportsCouponCode'];
1811
+ /**
1812
+ * An event handler called by the system when the user enters or updates a coupon code.
1813
+ *
1814
+ * {@link https://developer.apple.com/documentation/applepayontheweb/applepaysession/oncouponcodechanged}
1815
+ * @param resolve - Completes the change of a coupon code with an update.
1816
+ * @param reject - Completes the change of a coupon code with no update.
1817
+ * @param event - The event parameter contains the couponCode attribute.
1818
+ */
1819
+ onCouponCodeChanged?: (resolve: (update: ApplePayJS.ApplePayCouponCodeUpdate) => void, reject: (update: ApplePayJS.ApplePayCouponCodeUpdate) => void, event: ApplePayJS.ApplePayCouponCodeChangedEvent) => void;
1820
+ buttonColor?: ApplePayButtonStyle;
1821
+ buttonType?: ApplePayButtonType;
1822
+ /**
1823
+ * Used to tweak the text of the button types that contain text ('Continue with', 'Book with', etc)
1824
+ */
1825
+ buttonLocale?: string;
1586
1826
  }
1587
- type SFPErrorMap = Partial<Record<SFFieldType, string>>;
1588
- interface SFPState {
1589
- status?: string;
1590
- brand?: string;
1591
- errors?: SFPErrorMap;
1592
- valid: SFPValid;
1593
- data: object;
1594
- cvcPolicy?: CVCPolicyType;
1595
- isSfpValid?: boolean;
1596
- autoCompleteName?: string;
1827
+ interface ApplePayElementData {
1828
+ paymentMethod: {
1829
+ type: string;
1830
+ applePayToken: string;
1831
+ isExpress?: boolean;
1832
+ };
1597
1833
  billingAddress?: AddressData;
1598
- detectedUnsupportedBrands?: string[];
1599
- hasKoreanFields?: boolean;
1600
- showSocialSecurityNumber?: boolean;
1601
- expiryDatePolicy?: DatePolicyType;
1602
- socialSecurityNumber?: string;
1603
- }
1604
- interface SingleBrandResetObject {
1605
- brand: string;
1606
- cvcPolicy: CVCPolicyType;
1834
+ deliveryAddress?: AddressData;
1607
1835
  }
1608
- interface SFPValid {
1609
- encryptedCardNumber?: boolean;
1610
- encryptedExpiryMonth?: boolean;
1611
- encryptedExpiryYear?: boolean;
1612
- encryptedSecurityCode?: boolean;
1613
- encryptedPassword?: boolean;
1614
- encryptedPin?: boolean;
1836
+ interface ApplePaySessionRequest {
1837
+ displayName: string;
1838
+ domainName: string;
1839
+ initiative: Initiative;
1840
+ merchantIdentifier: string;
1615
1841
  }
1616
- interface OnChangeEventDetails {
1617
- event: string;
1618
- fieldType?: string;
1842
+ interface ApplePayWebConfiguration {
1843
+ renderApplePayCodeAs?: 'modal' | 'window';
1844
+ onApplePayCodeClose?(): void;
1619
1845
  }
1620
1846
 
1621
- /** A list of all the data-cse attributes that relate to securedFields (as found in card, giftcard) */
1622
- declare const ALL_SECURED_FIELDS: readonly ["encryptedCardNumber", "encryptedExpiryDate", "encryptedExpiryMonth", "encryptedExpiryYear", "encryptedSecurityCode", "encryptedPassword"];
1623
- declare const REQUIRED = "required";
1624
- declare const OPTIONAL = "optional";
1625
- declare const HIDDEN = "hidden";
1626
- declare const BEST_GUESS_MODE = "best-guess";
1627
- declare const BIN_LOOKUP_MODE = "bin-lookup";
1628
-
1629
- declare global {
1630
- interface Window {
1631
- _b$dl: boolean;
1632
- mockBinCount: number;
1633
- }
1634
- }
1635
- type SFFieldType = (typeof ALL_SECURED_FIELDS)[number];
1636
- type BrandModeType = typeof BIN_LOOKUP_MODE | typeof BEST_GUESS_MODE;
1637
- interface StylesObject {
1638
- base?: StyleDefinitions;
1639
- error?: StyleDefinitions;
1640
- validated?: StyleDefinitions;
1641
- placeholder?: StyleDefinitions;
1847
+ interface BankTransferResultProps {
1848
+ paymentMethodType?: string;
1849
+ reference?: string;
1850
+ totalAmount?: {
1851
+ value: number;
1852
+ currency: string;
1853
+ };
1854
+ beneficiary?: string;
1855
+ iban?: string;
1856
+ bic?: string;
1857
+ accountNumber?: string;
1858
+ sortCode?: string;
1859
+ routingNumber?: string;
1860
+ branchCode?: string;
1861
+ bankCode?: string;
1862
+ onActionHandled?: (actionHandledObj: ActionHandledReturnObject) => void;
1642
1863
  }
1643
- interface StyleDefinitions {
1644
- background?: string;
1645
- caretColor?: string;
1646
- color?: string;
1647
- display?: string;
1648
- font?: string;
1649
- fontFamily?: string;
1650
- fontSize?: string;
1651
- fontSizeAdjust?: string;
1652
- fontSmoothing?: string;
1653
- fontStretch?: string;
1654
- fontStyle?: string;
1655
- fontVariant?: string;
1656
- fontVariantAlternates?: string;
1657
- fontVariantCaps?: string;
1658
- fontVariantEastAsian?: string;
1659
- fontVariantLigatures?: string;
1660
- fontVariantNumeric?: string;
1661
- fontWeight?: string;
1662
- letterSpacing?: string;
1663
- lineHeight?: string;
1664
- mozOsxFontSmoothing?: string;
1665
- mozTransition?: string;
1666
- outline?: string;
1667
- opacity?: string;
1668
- padding?: string;
1669
- textAlign?: string;
1670
- textShadow?: string;
1671
- transition?: string;
1672
- webkitFontSmoothing?: string;
1673
- webkitTransition?: string;
1674
- wordSpacing?: string;
1864
+
1865
+ type BankTransferConfiguration = UIElementProps & BankTransferResultProps & {
1866
+ /**
1867
+ * Show/hide email address field
1868
+ * @default true
1869
+ */
1870
+ showEmailAddress?: boolean;
1871
+ };
1872
+ interface BankTransferState extends UIElementProps {
1873
+ data: {
1874
+ shopperEmail?: string;
1875
+ };
1876
+ isValid: boolean;
1675
1877
  }
1676
- interface CardAllValidData {
1677
- type: string;
1678
- allValid: boolean;
1679
- rootNode: HTMLElement;
1878
+ interface BankTransferSchema {
1879
+ shopperEmail?: string;
1680
1880
  }
1681
- interface CardAutoCompleteData {
1682
- fieldType: string;
1683
- name: string;
1881
+
1882
+ interface VoucherDetail {
1883
+ label: string;
1684
1884
  value: string;
1685
- action: string;
1686
1885
  }
1687
- interface CardBinLookupData {
1688
- type?: string;
1689
- detectedBrands?: string[] | null;
1690
- supportedBrands?: string[] | null;
1691
- brands?: string[];
1692
- issuingCountryCode?: string;
1693
- healthcare?: Record<string, boolean>[];
1694
- supportedBrandsRaw?: BrandObject[];
1695
- rootNode?: HTMLElement;
1696
- isReset?: boolean;
1697
- dualBrandingType?: string;
1698
- paymentMethodVariants?: (string | undefined)[];
1886
+ interface VoucherProps {
1887
+ /**
1888
+ * Payment method used to generate the voucher.
1889
+ */
1890
+ paymentMethodType: string;
1891
+ /**
1892
+ * Payment method image to be displayed on the voucher.
1893
+ */
1894
+ imageUrl?: string;
1895
+ /**
1896
+ * If applicable, it will render an issuer image next to the payment method image.
1897
+ */
1898
+ issuerImageUrl?: string;
1899
+ /**
1900
+ * Voucher instructions URL.
1901
+ */
1902
+ instructionsUrl?: string;
1903
+ /**
1904
+ * Download URL for the voucher. It will display a button allowing the shopper to download it.
1905
+ */
1906
+ downloadUrl?: string;
1907
+ /**
1908
+ * Text that will be displayed on the above Download button.
1909
+ */
1910
+ downloadButtonText?: string;
1911
+ /**
1912
+ * Introduction text on the voucher.
1913
+ */
1914
+ introduction?: string;
1915
+ /**
1916
+ * Payment reference.
1917
+ */
1918
+ reference?: string;
1919
+ /**
1920
+ * URL to a barcode image representing the payment reference.
1921
+ */
1922
+ barcode?: string;
1923
+ /**
1924
+ * Total amount displayed on the voucher.
1925
+ */
1926
+ amount?: string;
1927
+ /**
1928
+ * Any additional surcharge to the amount.
1929
+ */
1930
+ surcharge?: string;
1931
+ /**
1932
+ * List of details that will be rendered on the voucher.
1933
+ */
1934
+ voucherDetails?: VoucherDetail[];
1935
+ /**
1936
+ * Additional CSS classes.
1937
+ */
1938
+ className?: string;
1939
+ /**
1940
+ * Show/Hide a button to copy the payment reference. It will only show if a reference is available.
1941
+ */
1942
+ copyBtn?: boolean;
1943
+ /**
1944
+ * Show/Hide payment reference value.
1945
+ * @default true
1946
+ */
1947
+ showReferenceValue?: boolean;
1948
+ /**
1949
+ * Label for the payment reference.
1950
+ */
1951
+ paymentReferenceLabel?: string;
1952
+ onActionHandled?: (rtnObj: ActionHandledReturnObject) => void;
1699
1953
  }
1700
- interface CardBinValueData {
1701
- type: string;
1702
- binValue: string;
1703
- uuid?: string;
1704
- encryptedBin?: string;
1954
+ interface VoucherConfiguration extends UIElementProps {
1955
+ reference?: string;
1956
+ url?: string;
1957
+ paymentMethodType?: string;
1705
1958
  }
1706
- interface CardBrandData {
1707
- type: string;
1708
- rootNode: HTMLElement;
1709
- brand: string;
1710
- cvcPolicy: CVCPolicyType;
1711
- expiryDatePolicy?: DatePolicyType;
1712
- cvcText: string;
1713
- showSocialSecurityNumber?: boolean;
1714
- brandImageUrl?: string;
1715
- mode?: BrandModeType;
1959
+ type CommonVoucherProps = Pick<VoucherProps, 'paymentMethodType' | 'introduction' | 'imageUrl' | 'amount' | 'reference' | 'onActionHandled'>;
1960
+
1961
+ interface BoletoConfiguration extends VoucherConfiguration {
1962
+ /**
1963
+ * Set to false if you have already collected the shopper's first name, last name, and CPF/CNPJ (socialSecurityNumber).
1964
+ * @default true
1965
+ */
1966
+ personalDetailsRequired?: boolean;
1967
+ /**
1968
+ * Set this to false if you have already collected the shopper's street, house number or name, city, postal code, and state or province.
1969
+ * @default true
1970
+ */
1971
+ billingAddressRequired?: boolean;
1972
+ /**
1973
+ * Set this to false if you have already collected the shopper's email address.
1974
+ * @default true
1975
+ */
1976
+ showEmailAddress?: boolean;
1977
+ /**
1978
+ * Object to pre-fill shopper details on the form
1979
+ */
1980
+ data?: BoletoInputDataState;
1716
1981
  }
1717
- interface CardConfigSuccessData {
1718
- iframesConfigured: boolean;
1982
+ interface BoletoElementProps {
1719
1983
  type: string;
1720
- rootNode: HTMLElement;
1984
+ i18n: Language;
1985
+ loadingContext: string;
1986
+ reference?: string;
1721
1987
  }
1722
- interface CardErrorData {
1723
- fieldType: string;
1724
- error: string;
1725
- type: string;
1726
- rootNode?: HTMLElement;
1727
- detectedBrands?: string[];
1728
- errorI18n?: string;
1729
- errorText?: string;
1988
+ interface BoletoInputDataState {
1989
+ firstName?: string;
1990
+ lastName?: string;
1991
+ billingAddress?: AddressData;
1992
+ socialSecurityNumber?: string;
1993
+ shopperEmail?: string;
1730
1994
  }
1731
- interface CardFieldValidData {
1732
- fieldType: string;
1733
- encryptedFieldName: string;
1734
- uid: string;
1735
- valid: boolean;
1736
- type: string;
1737
- rootNode: HTMLElement;
1738
- blob?: string;
1739
- endDigits?: string;
1740
- expiryDate?: string;
1741
- issuerBin?: number;
1995
+ interface BoletoInputValidState {
1996
+ firstName?: boolean;
1997
+ lastName?: boolean;
1998
+ shopperEmail?: boolean;
1999
+ socialSecurityNumber?: boolean;
2000
+ billingAddress?: boolean;
1742
2001
  }
1743
- interface CardFocusData {
1744
- action: string;
1745
- focus: boolean;
1746
- numChars: number;
1747
- fieldType: string;
1748
- rootNode: HTMLElement;
1749
- type: string;
1750
- currentFocusObject: string;
2002
+ interface BoletoInputErrorState {
2003
+ firstName?: boolean;
2004
+ lastName?: boolean;
2005
+ shopperEmail?: boolean;
2006
+ socialSecurityNumber?: boolean;
1751
2007
  }
1752
- interface CardLoadData {
1753
- iframesLoaded: boolean;
2008
+
2009
+ interface CashAppPayConfiguration extends UIElementProps {
2010
+ /**
2011
+ * Indicates that the payment must be stored (Ex: in case there is no checkbox but merchant wants to store it)
2012
+ */
2013
+ storePaymentMethod?: boolean;
2014
+ /**
2015
+ * Enables storing the payment method using the Checkbox
2016
+ */
2017
+ enableStoreDetails?: boolean;
2018
+ /**
2019
+ * Callback triggered before starting the CashAppPay flow. Use case: Validate customer data, check product availability
2020
+ */
2021
+ onClick?(actions: {
2022
+ resolve: () => void;
2023
+ reject: () => void;
2024
+ }): void;
2025
+ /**
2026
+ * A reference to your system (for example, a cart or checkout identifier). Maximum length 1024 characters.
2027
+ * https://developers.cash.app/docs/api/technical-documentation/sdks/pay-kit/technical-reference#parameters-3
2028
+ */
2029
+ referenceId?: string;
2030
+ /**
2031
+ * The destination for the customer after approving (or declining) in Cash App for mobile redirect flow.
2032
+ * https://developers.cash.app/docs/api/technical-documentation/sdks/pay-kit/technical-reference#customerrequest
2033
+ * @defaultValue window.location.ref
2034
+ */
2035
+ redirectURL?: string;
2036
+ /**
2037
+ * Button customization
2038
+ * https://developers.cash.app/docs/api/technical-documentation/sdks/pay-kit/use-cases#customize-the-cash-app-pay-button
2039
+ */
2040
+ button?: {
2041
+ shape?: 'semiround' | 'round';
2042
+ size?: 'medium' | 'small';
2043
+ theme?: 'dark' | 'light';
2044
+ width?: 'static' | 'full';
2045
+ };
2046
+ /**
2047
+ * CashAppPay configuration sent by the /paymentMethods response
2048
+ */
2049
+ configuration?: {
2050
+ clientId: string;
2051
+ scopeId: string;
2052
+ };
2053
+ /**
2054
+ * If payment is tokenized, then API will return its ID
2055
+ * @internal
2056
+ */
2057
+ storedPaymentMethodId?: string;
2058
+ /**
2059
+ * If payment is tokenized, then API will return this value
2060
+ * @internal
2061
+ */
2062
+ cashtag?: string;
1754
2063
  }
1755
- type CVCPolicyType = typeof REQUIRED | typeof OPTIONAL | typeof HIDDEN;
1756
- type DatePolicyType = typeof REQUIRED | typeof OPTIONAL | typeof HIDDEN;
1757
- interface BrandConfiguration {
1758
- name?: string;
1759
- icon?: string;
2064
+ type CashAppPayElementData = {
2065
+ paymentMethod: {
2066
+ type: string;
2067
+ grantId?: string;
2068
+ storedPaymentMethodId?: string;
2069
+ };
2070
+ storePaymentMethod?: boolean;
2071
+ };
2072
+ type CashAppPayEventData = {
2073
+ cashTag?: string;
2074
+ customerId?: string;
2075
+ grantId?: string;
2076
+ onFileGrantId?: string;
2077
+ };
2078
+
2079
+ interface TimeoutErrorProps {
2080
+ source: string;
2081
+ scheme: string;
2082
+ isTimeoutTriggeredBySchemeSdk: boolean;
1760
2083
  }
1761
- interface CardBrandsConfiguration {
1762
- [key: string]: BrandConfiguration;
2084
+ declare class TimeoutError extends Error {
2085
+ scheme: string;
2086
+ source: string;
2087
+ isTimeoutTriggeredBySchemeSdk: boolean;
2088
+ /** Currently populated only by Visa SDK if available */
2089
+ correlationId?: string;
2090
+ constructor(options: TimeoutErrorProps);
2091
+ setCorrelationId(correlationId: string): void;
2092
+ toString(): string;
1763
2093
  }
1764
2094
 
2095
+ type ClickToPayProps = {
2096
+ /**
2097
+ * Shopper email used to be recognized with the Network schemes
2098
+ */
2099
+ shopperEmail?: string;
2100
+ /**
2101
+ * Shopper telephone number used to be recognized with the Network schemes
2102
+ */
2103
+ telephoneNumber?: string;
2104
+ /**
2105
+ * Used to display the merchant name in case the DCF appears (ex: first time doing transaction in the device),
2106
+ */
2107
+ merchantDisplayName?: string;
2108
+ /**
2109
+ * Used to ensure the correct language and user experience if DCF screen is displayed. As a fallback, it uses the main locale
2110
+ * defined during the creation of the Checkout.
2111
+ * Format: ISO language_country pair (e.g., en_US )
2112
+ *
2113
+ * @defaultValue en_US
2114
+ */
2115
+ locale?: string;
2116
+ /**
2117
+ * Disable autofocus on the One Time Password input field when it is either displayed or when the OTP is resent
2118
+ * @defaultValue false
2119
+ */
2120
+ disableOtpAutoFocus?: boolean;
2121
+ /**
2122
+ * Callback triggered when the Click to Pay component is ready to be used
2123
+ */
2124
+ onReady?(): void;
2125
+ /**
2126
+ * Callback triggered when a timeout happens within Click to Pay service.
2127
+ * Ex: Network schemes took too long to initialize
2128
+ */
2129
+ onTimeout?(error: TimeoutError): void;
2130
+ };
2131
+ type ClickToPayScheme = 'mc' | 'visa';
2132
+
2133
+ type MastercardCheckout = {
2134
+ srcDigitalCardId: string;
2135
+ srcCorrelationId: string;
2136
+ srcScheme: string;
2137
+ };
2138
+ type VisaCheckout = {
2139
+ srcCheckoutPayload?: string;
2140
+ srcTokenReference?: string;
2141
+ srcCorrelationId: string;
2142
+ srcScheme: string;
2143
+ };
2144
+ type ClickToPayCheckoutPayload = VisaCheckout | MastercardCheckout;
2145
+
2146
+ type ClickToPayConfiguration = UIElementProps & ClickToPayProps & {
2147
+ /**
2148
+ * ClickToPay configuration sent by the /paymentMethods response
2149
+ */
2150
+ configuration?: {
2151
+ mcDpaId?: string;
2152
+ mcSrcClientId?: string;
2153
+ visaSrcInitiatorId?: string;
2154
+ visaSrciDpaId?: string;
2155
+ };
2156
+ };
2157
+ type ClickToPayPaymentData = {
2158
+ paymentMethod: ClickToPayCheckoutPayload & {
2159
+ type: string;
2160
+ };
2161
+ origin: string;
2162
+ browserInfo: BrowserInfo;
2163
+ };
2164
+
1765
2165
  declare enum ErrorEventCode {
1766
2166
  /** Trying to initialise a securedField iframe, but the iframe.contentWindow is undefined (meaning the containing element is not in the DOM */
1767
2167
  SECURED_FIELDS_IFRAME_CONTENT_WINDOW_NOT_FOUND = "500",
@@ -1927,12 +2327,9 @@ type CheckoutThreeDS2Action = {
1927
2327
  subtype: string;
1928
2328
  authorisationToken: string;
1929
2329
  };
1930
- interface FingerprintResolveData {
1931
- data: {
1932
- [key: string]: string;
1933
- paymentData: string;
1934
- };
1935
- }
2330
+ type FingerprintResolveData = {
2331
+ data: Omit<AdditionalDetailsData['data'], 'details'>;
2332
+ };
1936
2333
  interface ChallengeResolveData {
1937
2334
  data: {
1938
2335
  details: {
@@ -1981,8 +2378,8 @@ type ThreeDS2ConfigProps = {
1981
2378
  };
1982
2379
  type ThreeDS2ActionProps = CardConfiguration & Pick<ThreeDS2ConfigProps, 'isMDFlow' | 'on3DS2RedirectFlowComplete' | 'usePasskeyIFrameAttributes'>;
1983
2380
 
1984
- type CoreCallbacks$1 = Pick<CoreConfiguration, 'beforeRedirect' | 'beforeSubmit' | 'onSubmit' | 'onAdditionalDetails' | 'onPaymentFailed' | 'onPaymentCompleted' | 'onChange' | 'onActionHandled' | 'onError' | 'onEnterKeyPressed'>;
1985
- type CustomCardConfiguration = CoreCallbacks$1 & {
2381
+ type CoreCallbacks = Pick<CoreConfiguration, 'beforeRedirect' | 'beforeSubmit' | 'onSubmit' | 'onAdditionalDetails' | 'onPaymentFailed' | 'onPaymentCompleted' | 'onChange' | 'onActionHandled' | 'onError' | 'onEnterKeyPressed'>;
2382
+ type CustomCardConfiguration = CoreCallbacks & {
1986
2383
  /**
1987
2384
  * Automatically shift the focus from one field to another. Usually happens from a valid Expiry Date field to the Security Code field,
1988
2385
  * but some BINS also allow us to know that the PAN is complete, in which case we can shift focus to the date field
@@ -2193,22 +2590,22 @@ interface OpenInvoiceVisibility {
2193
2590
  }
2194
2591
  interface BankDetailsSchema {
2195
2592
  countryCode?: string;
2196
- ibanNumber?: any;
2593
+ ibanNumber?: string;
2197
2594
  ownerName?: string;
2198
2595
  }
2199
2596
  interface OpenInvoiceProps extends UIElementProps {
2200
2597
  allowedCountries?: string[];
2201
- consentCheckboxLabel: any;
2598
+ consentCheckboxLabel?: ComponentChild;
2202
2599
  countryCode?: string;
2203
- data: {
2600
+ data?: {
2204
2601
  companyDetails?: CompanyDetailsSchema;
2205
2602
  personalDetails?: PersonalDetailsSchema | null;
2206
2603
  billingAddress?: AddressData;
2207
2604
  deliveryAddress?: AddressData;
2208
2605
  bankAccount?: BankDetailsSchema;
2209
2606
  };
2210
- onChange: (state: any, element?: UIElement) => void;
2211
- payButton: any;
2607
+ onChange: (state: OpenInvoiceState, element?: UIElement) => void;
2608
+ payButton: (props: PayButtonProps) => h.JSX.Element;
2212
2609
  visibility?: OpenInvoiceVisibility;
2213
2610
  personalDetailsRequiredFields?: string[];
2214
2611
  billingAddressRequiredFields?: string[];
@@ -2241,6 +2638,12 @@ interface OpenInvoiceStateValid {
2241
2638
  personalDetails?: boolean;
2242
2639
  bankAccount?: boolean;
2243
2640
  }
2641
+ interface OpenInvoiceState {
2642
+ data: OpenInvoiceStateData;
2643
+ errors?: OpenInvoiceStateError;
2644
+ valid?: OpenInvoiceStateValid;
2645
+ isValid: boolean;
2646
+ }
2244
2647
  interface OpenInvoiceActiveFieldsets {
2245
2648
  companyDetails: boolean;
2246
2649
  personalDetails: boolean;
@@ -2382,39 +2785,14 @@ declare class Atome extends OpenInvoiceContainer {
2382
2785
  formatProps(props: OpenInvoiceConfiguration): any;
2383
2786
  }
2384
2787
 
2385
- interface RiskModuleOptions {
2386
- enabled: boolean;
2387
- onComplete?: (data: any) => void;
2388
- onError?: (error: any) => void;
2389
- node?: string;
2390
- }
2391
- interface RiskModuleProps extends BaseElementProps {
2392
- risk: RiskModuleOptions;
2393
- loadingContext: string;
2394
- }
2395
- declare class RiskElement extends BaseElement<RiskModuleProps> {
2396
- static readonly type = "risk";
2397
- static readonly defaultProps: {
2398
- risk: {
2399
- enabled: boolean;
2400
- onComplete: () => void;
2401
- onError: () => void;
2402
- node: string;
2403
- };
2788
+ interface IssuerListState {
2789
+ data: {
2790
+ issuer?: string | null;
2404
2791
  };
2405
- private nodeRiskContainer;
2406
- constructor(checkout: ICore, props?: any);
2407
- formatProps(props: any): any;
2408
- onComplete: (result: any) => void;
2409
- onError: (error: any) => void;
2410
- get isValid(): any;
2411
- get data(): any;
2412
- get enabled(): boolean;
2413
- cleanUp: () => void;
2414
- componentWillUnmount(): void;
2415
- render(): h.JSX.Element;
2792
+ valid: Record<string, boolean>;
2793
+ errors: Record<string, ValidationRuleResult | null>;
2794
+ isValid: boolean;
2416
2795
  }
2417
-
2418
2796
  interface IssuerItem {
2419
2797
  id: string;
2420
2798
  name: string;
@@ -2441,7 +2819,7 @@ interface IssuerListData {
2441
2819
  };
2442
2820
  }
2443
2821
 
2444
- declare class IssuerListContainer<TProps extends IssuerListConfiguration = IssuerListConfiguration, TData = IssuerListData> extends UIElement<TProps> {
2822
+ declare class IssuerListContainer<TProps extends IssuerListConfiguration = IssuerListConfiguration, TData extends PaymentData = IssuerListData> extends UIElement<TProps> {
2445
2823
  protected static readonly defaultProps: {
2446
2824
  showImage: boolean;
2447
2825
  issuers: any[];
@@ -2513,7 +2891,7 @@ declare class BillDeskOnlineElement extends IssuerListContainer {
2513
2891
  }) => void;
2514
2892
  environment?: string;
2515
2893
  session?: Session;
2516
- onComplete?: (state: any, element: UIElement) => void;
2894
+ onComplete?: (state: BaseElementState, element: UIElement) => void;
2517
2895
  isInstantPayment?: boolean;
2518
2896
  isStoredPaymentMethod?: boolean;
2519
2897
  oneClick?: boolean;
@@ -2528,7 +2906,7 @@ declare class BillDeskOnlineElement extends IssuerListContainer {
2528
2906
  loadingContext?: string;
2529
2907
  createFromAction?: (action: PaymentAction, props: object) => UIElement;
2530
2908
  clientKey?: string;
2531
- elementRef?: any;
2909
+ elementRef?: UIElement;
2532
2910
  i18n?: Language;
2533
2911
  label?: string;
2534
2912
  paymentMethodType?: string;
@@ -2581,7 +2959,7 @@ declare class BillDeskWalletElement extends IssuerListContainer {
2581
2959
  }) => void;
2582
2960
  environment?: string;
2583
2961
  session?: Session;
2584
- onComplete?: (state: any, element: UIElement) => void;
2962
+ onComplete?: (state: BaseElementState, element: UIElement) => void;
2585
2963
  isInstantPayment?: boolean;
2586
2964
  isStoredPaymentMethod?: boolean;
2587
2965
  oneClick?: boolean;
@@ -2596,7 +2974,7 @@ declare class BillDeskWalletElement extends IssuerListContainer {
2596
2974
  loadingContext?: string;
2597
2975
  createFromAction?: (action: PaymentAction, props: object) => UIElement;
2598
2976
  clientKey?: string;
2599
- elementRef?: any;
2977
+ elementRef?: UIElement;
2600
2978
  i18n?: Language;
2601
2979
  label?: string;
2602
2980
  paymentMethodType?: string;
@@ -2668,7 +3046,7 @@ declare class CashAppPay extends UIElement<CashAppPayConfiguration> {
2668
3046
  }) => void;
2669
3047
  environment?: string;
2670
3048
  session?: Session;
2671
- onComplete?: (state: any, element: UIElement) => void;
3049
+ onComplete?: (state: BaseElementState, element: UIElement) => void;
2672
3050
  isInstantPayment?: boolean;
2673
3051
  isStoredPaymentMethod?: boolean;
2674
3052
  oneClick?: boolean;
@@ -2683,7 +3061,7 @@ declare class CashAppPay extends UIElement<CashAppPayConfiguration> {
2683
3061
  loadingContext?: string;
2684
3062
  createFromAction?: (action: PaymentAction, props: object) => UIElement;
2685
3063
  clientKey?: string;
2686
- elementRef?: any;
3064
+ elementRef?: UIElement;
2687
3065
  i18n?: Language;
2688
3066
  label?: string;
2689
3067
  paymentMethodType?: string;
@@ -2747,7 +3125,7 @@ declare class ClickToPayElement extends UIElement<ClickToPayConfiguration> {
2747
3125
  }) => void;
2748
3126
  environment?: string;
2749
3127
  session?: Session;
2750
- onComplete?: (state: any, element: UIElement) => void;
3128
+ onComplete?: (state: BaseElementState, element: UIElement) => void;
2751
3129
  isInstantPayment?: boolean;
2752
3130
  isStoredPaymentMethod?: boolean;
2753
3131
  oneClick?: boolean;
@@ -2762,7 +3140,7 @@ declare class ClickToPayElement extends UIElement<ClickToPayConfiguration> {
2762
3140
  loadingContext?: string;
2763
3141
  createFromAction?: (action: PaymentAction, props: object) => UIElement;
2764
3142
  clientKey?: string;
2765
- elementRef?: any;
3143
+ elementRef?: UIElement;
2766
3144
  i18n?: Language;
2767
3145
  label?: string;
2768
3146
  paymentMethodType?: string;
@@ -2788,12 +3166,6 @@ declare class ClickToPayElement extends UIElement<ClickToPayConfiguration> {
2788
3166
  protected componentToRender(): h.JSX.Element;
2789
3167
  }
2790
3168
 
2791
- interface DisclaimerMsgObject {
2792
- message: string;
2793
- linkText: string;
2794
- link: string;
2795
- }
2796
-
2797
3169
  declare class BancontactElement extends CardElement {
2798
3170
  static readonly type: TxVariants;
2799
3171
  constructor(checkout: ICore, props?: CardConfiguration);
@@ -2815,7 +3187,7 @@ declare class BancontactElement extends CardElement {
2815
3187
  cvcPolicy: CVCPolicyType;
2816
3188
  autoFocus?: boolean;
2817
3189
  billingAddressAllowedCountries?: string[];
2818
- billingAddressMode?: "full" | "partial" | "none";
3190
+ billingAddressMode?: `${AddressModeOptions}`;
2819
3191
  billingAddressRequired?: boolean;
2820
3192
  billingAddressRequiredFields?: string[];
2821
3193
  brands?: string[];
@@ -2866,146 +3238,66 @@ declare class BancontactElement extends CardElement {
2866
3238
  positionHolderNameOnTop?: boolean;
2867
3239
  showBrandIcon?: boolean;
2868
3240
  showContextualElement?: boolean;
2869
- showInstallmentAmounts?: boolean;
2870
- storedPaymentMethodId?: string;
2871
- showStoreDetailsCheckbox?: boolean;
2872
- styles?: StylesObject;
2873
- supportedShopperInteractions?: string[];
2874
- trimTrailingSeparator?: boolean;
2875
- paymentMethodId?: string;
2876
- order?: Order;
2877
- modules?: {
2878
- srPanel?: SRPanel;
2879
- analytics?: IAnalytics;
2880
- resources?: Resources;
2881
- risk?: RiskElement;
2882
- };
2883
- isDropin?: boolean;
2884
- donation?: DonationOptions;
2885
- onPaymentCompleted?: (data: PaymentCompletedData, component?: UIElement) => void;
2886
- onPaymentFailed?: (data?: PaymentFailedData, component?: UIElement) => void;
2887
- beforeRedirect?: (resolve: () => void, reject: () => void, redirectData: {
2888
- url: string;
2889
- method: string;
2890
- data?: any;
2891
- }) => void;
2892
- beforeSubmit?: (state: PaymentData, component: UIElement, actions: BeforeSubmitActions) => Promise<void> | void;
2893
- onSubmit?: (state: SubmitData, component: UIElement, actions: SubmitActions) => void;
2894
- onReview?: (state: PaymentData, component: UIElement, reviewDetails: ReviewDetails) => void;
2895
- onActionHandled?: (actionHandled: ActionHandledReturnObject) => void;
2896
- onAdditionalDetails?: (state: AdditionalDetailsData, component: UIElement, actions: AdditionalDetailsActions) => void;
2897
- onChange?: (state: OnChangeData, component: UIElement) => void;
2898
- onEnterKeyPressed?: (activeElement: Element, component: UIElement) => void;
2899
- onError?: (error: AdyenCheckoutError, component?: UIElement) => void;
2900
- onOrderUpdated?: (data: {
2901
- order: Order;
2902
- }) => void;
2903
- onPaymentMethodsRequest?: (data: PaymentMethodsRequestData, actions: {
2904
- resolve: (response: PaymentMethodsResponse) => void;
2905
- reject: () => void;
2906
- }) => void;
2907
- environment?: string;
2908
- session?: Session;
2909
- onComplete?: (state: any, element: UIElement) => void;
2910
- isInstantPayment?: boolean;
2911
- isStoredPaymentMethod?: boolean;
2912
- oneClick?: boolean;
2913
- statusType?: StatusFromAction;
2914
- icon?: string;
2915
- amount?: PaymentAmount;
2916
- secondaryAmount?: PaymentAmount;
2917
- showPayButton?: boolean;
2918
- payButton?: (options: PayButtonProps) => preact.JSX.Element;
2919
- loadingContext?: string;
2920
- createFromAction?: (action: PaymentAction, props: object) => UIElement;
2921
- clientKey?: string;
2922
- elementRef?: any;
2923
- i18n?: Language;
2924
- label?: string;
2925
- paymentMethodType?: string;
2926
- originalAction?: PaymentAction;
2927
- };
2928
- onBrand: (event: any) => void;
2929
- }
2930
-
2931
- interface CampaignContentProps {
2932
- logoUrl?: string;
2933
- nonprofitDescription?: string;
2934
- nonprofitName?: string;
2935
- causeName?: string;
2936
- nonprofitUrl?: string;
2937
- bannerUrl?: string;
2938
- }
2939
-
2940
- type Donation = RoundupDonation | FixedAmountsDonation;
2941
- type DonationType = 'roundup' | 'fixedAmounts';
2942
- interface RoundupDonation {
2943
- type: 'roundup';
2944
- currency: string;
2945
- maxRoundupAmount: number;
2946
- }
2947
- interface FixedAmountsDonation {
2948
- type: 'fixedAmounts';
2949
- currency: string;
2950
- values: Array<number>;
2951
- }
2952
- interface DonationAmount {
2953
- currency: string;
2954
- value: number;
2955
- }
2956
- interface DonationPayload {
2957
- data: {
2958
- amount: DonationAmount;
2959
- };
2960
- isValid?: boolean;
2961
- }
2962
- interface DonationComponentProps extends CampaignContentProps {
2963
- donation: Donation;
2964
- /**
2965
- * The original transaction amount.
2966
- */
2967
- commercialTxAmount: number;
2968
- termsAndConditionsUrl?: string;
2969
- causeName?: string;
2970
- showCancelButton?: boolean;
2971
- onDonate: (payload: DonationPayload) => void;
2972
- onCancel?: (payload: DonationPayload) => void;
2973
- onChange?: (payload: DonationPayload) => void;
2974
- onAmountSelected: (payload: DonationPayload) => void;
2975
- }
2976
-
2977
- declare class DonationElement extends UIElement<DonationConfiguration> {
2978
- static readonly type = TxVariants.donation;
2979
- private readonly isInServiceMode;
2980
- constructor(checkout: ICore, props: DonationProps);
2981
- /**
2982
- * Type guard to determine if props are for "service" mode.
2983
- *
2984
- * The "service" mode is used in the /sessions flow:
2985
- * - if the /payments response mandates it, we consult the /sessions/donationCampaigns endpoint on behalf of the merchant, and mount any found Donation Campaigns.
2986
- *
2987
- * The opposite of this mode is the "direct" mode, used in the Advanced flow:
2988
- * - the merchant makes their own call to the /donationCampaigns endpoint and provides the Donation Campaign directly to the component.
2989
- */
2990
- private static isServiceMode;
2991
- static readonly defaultProps: {
2992
- onCancel: () => void;
2993
- onDonate: () => void;
3241
+ showInstallmentAmounts?: boolean;
3242
+ storedPaymentMethodId?: string;
3243
+ showStoreDetailsCheckbox?: boolean;
3244
+ styles?: StylesObject;
3245
+ supportedShopperInteractions?: string[];
3246
+ trimTrailingSeparator?: boolean;
3247
+ paymentMethodId?: string;
3248
+ order?: Order;
3249
+ modules?: {
3250
+ srPanel?: SRPanel;
3251
+ analytics?: IAnalytics;
3252
+ resources?: Resources;
3253
+ risk?: RiskElement;
3254
+ };
3255
+ isDropin?: boolean;
3256
+ donation?: DonationOptions;
3257
+ onPaymentCompleted?: (data: PaymentCompletedData, component?: UIElement) => void;
3258
+ onPaymentFailed?: (data?: PaymentFailedData, component?: UIElement) => void;
3259
+ beforeRedirect?: (resolve: () => void, reject: () => void, redirectData: {
3260
+ url: string;
3261
+ method: string;
3262
+ data?: any;
3263
+ }) => void;
3264
+ beforeSubmit?: (state: PaymentData, component: UIElement, actions: BeforeSubmitActions) => Promise<void> | void;
3265
+ onSubmit?: (state: SubmitData, component: UIElement, actions: SubmitActions) => void;
3266
+ onReview?: (state: PaymentData, component: UIElement, reviewDetails: ReviewDetails) => void;
3267
+ onActionHandled?: (actionHandled: ActionHandledReturnObject) => void;
3268
+ onAdditionalDetails?: (state: AdditionalDetailsData, component: UIElement, actions: AdditionalDetailsActions) => void;
3269
+ onChange?: (state: OnChangeData, component: UIElement) => void;
3270
+ onEnterKeyPressed?: (activeElement: Element, component: UIElement) => void;
3271
+ onError?: (error: AdyenCheckoutError, component?: UIElement) => void;
3272
+ onOrderUpdated?: (data: {
3273
+ order: Order;
3274
+ }) => void;
3275
+ onPaymentMethodsRequest?: (data: PaymentMethodsRequestData, actions: {
3276
+ resolve: (response: PaymentMethodsResponse) => void;
3277
+ reject: () => void;
3278
+ }) => void;
3279
+ environment?: string;
3280
+ session?: Session;
3281
+ onComplete?: (state: BaseElementState, element: UIElement) => void;
3282
+ isInstantPayment?: boolean;
3283
+ isStoredPaymentMethod?: boolean;
3284
+ oneClick?: boolean;
3285
+ statusType?: StatusFromAction;
3286
+ icon?: string;
3287
+ amount?: PaymentAmount;
3288
+ secondaryAmount?: PaymentAmount;
3289
+ showPayButton?: boolean;
3290
+ payButton?: (options: PayButtonProps) => preact.JSX.Element;
3291
+ loadingContext?: string;
3292
+ createFromAction?: (action: PaymentAction, props: object) => UIElement;
3293
+ clientKey?: string;
3294
+ elementRef?: UIElement;
3295
+ i18n?: Language;
3296
+ label?: string;
3297
+ paymentMethodType?: string;
3298
+ originalAction?: PaymentAction;
2994
3299
  };
2995
- private initialiseServiceMode;
2996
- /**
2997
- * Returns the component payment data ready to submit to the Checkout API
2998
- */
2999
- get data(): any;
3000
- /**
3001
- * Returns whether the component state is valid or not
3002
- */
3003
- get isValid(): any;
3004
- setState(newState: any): void;
3005
- donate(): void;
3006
- cancel(): void;
3007
- amountSelected(state: DonationPayload): void;
3008
- protected componentToRender(): h.JSX.Element;
3300
+ onBrand: (event: any) => void;
3009
3301
  }
3010
3302
 
3011
3303
  interface RedirectConfiguration extends UIElementProps {
@@ -3688,13 +3980,25 @@ declare class PaypalElement extends UIElement<PayPalConfiguration> {
3688
3980
  protected componentToRender(): h.JSX.Element | null;
3689
3981
  }
3690
3982
 
3983
+ /**
3984
+ * Methods that CustomCardInput exposes to the CustomCard element through the ref
3985
+ */
3986
+ interface CustomCardInputRef extends ComponentMethodsRef {
3987
+ processBinLookupResponse(binLookupResponse: BinLookupResponse, isReset?: boolean): void;
3988
+ dualBrandingChangeHandler(event: Event | string): void;
3989
+ setFocusOn(frame: SFFieldType): void;
3990
+ updateStyles(stylesObj: StylesObject): void;
3991
+ handleUnsupportedCard(errObj: CardErrorData): boolean;
3992
+ }
3993
+
3691
3994
  declare class CustomCard extends UIElement<CustomCardConfiguration> {
3692
3995
  static readonly type = TxVariants.customCard;
3996
+ protected componentRef: CustomCardInputRef | undefined;
3693
3997
  protected static readonly defaultProps: {
3694
3998
  onBinLookup: () => void;
3695
3999
  brandsConfiguration: {};
3696
4000
  };
3697
- private brand;
4001
+ private readonly brand;
3698
4002
  formatProps(props: CustomCardConfiguration): {
3699
4003
  type: TxVariants;
3700
4004
  onPaymentCompleted?: (data: PaymentCompletedData, component?: UIElement) => void;
@@ -3739,7 +4043,10 @@ declare class CustomCard extends UIElement<CustomCardConfiguration> {
3739
4043
  * Formats the component data output
3740
4044
  */
3741
4045
  formatData(): {
3742
- paymentMethod: any;
4046
+ paymentMethod: {
4047
+ brand: any;
4048
+ type: string;
4049
+ };
3743
4050
  browserInfo: BrowserInfo;
3744
4051
  origin: string;
3745
4052
  };
@@ -3752,11 +4059,17 @@ declare class CustomCard extends UIElement<CustomCardConfiguration> {
3752
4059
  onBinValue: (callbackObj: CardBinValueData) => void;
3753
4060
  get isValid(): boolean;
3754
4061
  get browserInfo(): BrowserInfo;
3755
- private onFocus;
4062
+ private readonly onFocus;
3756
4063
  protected onEnterKeyPressed: (activeElement: Element, component: UIElement) => void;
3757
4064
  protected componentToRender(): h.JSX.Element;
3758
4065
  }
3759
4066
 
4067
+ interface IbanData {
4068
+ ownerName?: string;
4069
+ ibanNumber?: string;
4070
+ countryCode?: string;
4071
+ }
4072
+
3760
4073
  interface SepaElementData {
3761
4074
  paymentMethod: {
3762
4075
  type: string;
@@ -3765,6 +4078,7 @@ interface SepaElementData {
3765
4078
  };
3766
4079
  }
3767
4080
  interface SepaConfiguration extends UIElementProps {
4081
+ data?: IbanData;
3768
4082
  }
3769
4083
 
3770
4084
  declare class SepaElement extends UIElement<SepaConfiguration> {
@@ -3773,7 +4087,9 @@ declare class SepaElement extends UIElement<SepaConfiguration> {
3773
4087
  /**
3774
4088
  * Formats props on construction time
3775
4089
  */
3776
- formatProps(props: any): any;
4090
+ formatProps(props: SepaConfiguration): SepaConfiguration & {
4091
+ holderName: boolean;
4092
+ };
3777
4093
  /**
3778
4094
  * Formats the component data output
3779
4095
  */
@@ -3888,7 +4204,7 @@ declare class WeChatPayElement extends QRLoaderContainer {
3888
4204
  }) => void;
3889
4205
  environment?: string;
3890
4206
  session?: Session;
3891
- onComplete?: (state: any, element: UIElement) => void;
4207
+ onComplete?: (state: BaseElementState, element: UIElement) => void;
3892
4208
  isInstantPayment?: boolean;
3893
4209
  isStoredPaymentMethod?: boolean;
3894
4210
  oneClick?: boolean;
@@ -3902,7 +4218,7 @@ declare class WeChatPayElement extends QRLoaderContainer {
3902
4218
  loadingContext?: string;
3903
4219
  createFromAction?: (action: PaymentAction, props: object) => UIElement;
3904
4220
  clientKey?: string;
3905
- elementRef?: any;
4221
+ elementRef?: UIElement;
3906
4222
  i18n?: Language;
3907
4223
  label?: string;
3908
4224
  paymentMethodType?: string;
@@ -3963,7 +4279,7 @@ declare class PayNowElement extends QRLoaderContainer {
3963
4279
  }) => void;
3964
4280
  environment?: string;
3965
4281
  session?: Session;
3966
- onComplete?: (state: any, element: UIElement) => void;
4282
+ onComplete?: (state: BaseElementState, element: UIElement) => void;
3967
4283
  isInstantPayment?: boolean;
3968
4284
  isStoredPaymentMethod?: boolean;
3969
4285
  oneClick?: boolean;
@@ -3977,7 +4293,7 @@ declare class PayNowElement extends QRLoaderContainer {
3977
4293
  loadingContext?: string;
3978
4294
  createFromAction?: (action: PaymentAction, props: object) => UIElement;
3979
4295
  clientKey?: string;
3980
- elementRef?: any;
4296
+ elementRef?: UIElement;
3981
4297
  i18n?: Language;
3982
4298
  label?: string;
3983
4299
  paymentMethodType?: string;
@@ -4039,7 +4355,7 @@ declare class BCMCMobileElement extends QRLoaderContainer {
4039
4355
  }) => void;
4040
4356
  environment?: string;
4041
4357
  session?: Session;
4042
- onComplete?: (state: any, element: UIElement) => void;
4358
+ onComplete?: (state: BaseElementState, element: UIElement) => void;
4043
4359
  isInstantPayment?: boolean;
4044
4360
  isStoredPaymentMethod?: boolean;
4045
4361
  oneClick?: boolean;
@@ -4053,7 +4369,7 @@ declare class BCMCMobileElement extends QRLoaderContainer {
4053
4369
  loadingContext?: string;
4054
4370
  createFromAction?: (action: PaymentAction, props: object) => UIElement;
4055
4371
  clientKey?: string;
4056
- elementRef?: any;
4372
+ elementRef?: UIElement;
4057
4373
  i18n?: Language;
4058
4374
  label?: string;
4059
4375
  paymentMethodType?: string;
@@ -4132,7 +4448,7 @@ declare class DragonpayElement extends UIElement<DragonpayConfiguraton> {
4132
4448
  }) => void;
4133
4449
  environment?: string;
4134
4450
  session?: Session;
4135
- onComplete?: (state: any, element: UIElement) => void;
4451
+ onComplete?: (state: BaseElementState, element: UIElement) => void;
4136
4452
  isInstantPayment?: boolean;
4137
4453
  isStoredPaymentMethod?: boolean;
4138
4454
  oneClick?: boolean;
@@ -4145,7 +4461,7 @@ declare class DragonpayElement extends UIElement<DragonpayConfiguraton> {
4145
4461
  payButton?: (options: PayButtonProps) => h.JSX.Element;
4146
4462
  createFromAction?: (action: PaymentAction, props: object) => UIElement;
4147
4463
  clientKey?: string;
4148
- elementRef?: any;
4464
+ elementRef?: UIElement;
4149
4465
  label?: string;
4150
4466
  paymentMethodType?: string;
4151
4467
  originalAction?: PaymentAction;
@@ -4265,7 +4581,7 @@ declare class EPSElement extends IssuerListContainer {
4265
4581
  }) => void;
4266
4582
  environment?: string;
4267
4583
  session?: Session;
4268
- onComplete?: (state: any, element: UIElement) => void;
4584
+ onComplete?: (state: BaseElementState, element: UIElement) => void;
4269
4585
  isInstantPayment?: boolean;
4270
4586
  isStoredPaymentMethod?: boolean;
4271
4587
  oneClick?: boolean;
@@ -4280,7 +4596,7 @@ declare class EPSElement extends IssuerListContainer {
4280
4596
  loadingContext?: string;
4281
4597
  createFromAction?: (action: PaymentAction, props: object) => UIElement;
4282
4598
  clientKey?: string;
4283
- elementRef?: any;
4599
+ elementRef?: UIElement;
4284
4600
  i18n?: Language;
4285
4601
  label?: string;
4286
4602
  paymentMethodType?: string;
@@ -4374,7 +4690,7 @@ declare class Giftcard extends Component<Readonly<GiftcardComponentProps>> {
4374
4690
  * Maps string error codes from SecuredFields to validation rule objects
4375
4691
  */
4376
4692
  mapErrorsToValidationObjects: () => SFStateErrorObj;
4377
- private updateTransformedErrors;
4693
+ private readonly updateTransformedErrors;
4378
4694
  onChange: (sfpState: any) => void;
4379
4695
  handleFocus: (e: any) => void;
4380
4696
  setBalance: ({ balance, transactionLimit }: {
@@ -4417,14 +4733,14 @@ declare class GiftcardElement extends UIElement<GiftCardConfiguration> {
4417
4733
  get icon(): string;
4418
4734
  get displayName(): string;
4419
4735
  private setBalanceCheckError;
4420
- private handleBalanceCheck;
4421
- private onOrderRequest;
4736
+ private readonly handleBalanceCheck;
4737
+ private readonly onOrderRequest;
4422
4738
  balanceCheck(): void;
4423
- private onBalanceCheck;
4739
+ private readonly onBalanceCheck;
4424
4740
  /**
4425
4741
  * Check if it should call onRequiringConfirmation
4426
4742
  */
4427
- private handleOnRequiringConfirmation;
4743
+ private readonly handleOnRequiringConfirmation;
4428
4744
  submit(): void;
4429
4745
  private makeSubmitCall;
4430
4746
  protected payButton: (props: PayButtonProps) => h.JSX.Element;
@@ -4526,7 +4842,7 @@ declare class PayuNetCashcardElement extends IssuerListContainer {
4526
4842
  }) => void;
4527
4843
  environment?: string;
4528
4844
  session?: Session;
4529
- onComplete?: (state: any, element: UIElement) => void;
4845
+ onComplete?: (state: BaseElementState, element: UIElement) => void;
4530
4846
  isInstantPayment?: boolean;
4531
4847
  isStoredPaymentMethod?: boolean;
4532
4848
  oneClick?: boolean;
@@ -4541,7 +4857,7 @@ declare class PayuNetCashcardElement extends IssuerListContainer {
4541
4857
  loadingContext?: string;
4542
4858
  createFromAction?: (action: PaymentAction, props: object) => UIElement;
4543
4859
  clientKey?: string;
4544
- elementRef?: any;
4860
+ elementRef?: UIElement;
4545
4861
  i18n?: Language;
4546
4862
  label?: string;
4547
4863
  paymentMethodType?: string;
@@ -4594,7 +4910,7 @@ declare class PayuNetBankingElement extends IssuerListContainer {
4594
4910
  }) => void;
4595
4911
  environment?: string;
4596
4912
  session?: Session;
4597
- onComplete?: (state: any, element: UIElement) => void;
4913
+ onComplete?: (state: BaseElementState, element: UIElement) => void;
4598
4914
  isInstantPayment?: boolean;
4599
4915
  isStoredPaymentMethod?: boolean;
4600
4916
  oneClick?: boolean;
@@ -4609,7 +4925,7 @@ declare class PayuNetBankingElement extends IssuerListContainer {
4609
4925
  loadingContext?: string;
4610
4926
  createFromAction?: (action: PaymentAction, props: object) => UIElement;
4611
4927
  clientKey?: string;
4612
- elementRef?: any;
4928
+ elementRef?: UIElement;
4613
4929
  i18n?: Language;
4614
4930
  label?: string;
4615
4931
  paymentMethodType?: string;
@@ -4675,7 +4991,7 @@ declare class SwishElement extends QRLoaderContainer {
4675
4991
  }) => void;
4676
4992
  environment?: string;
4677
4993
  session?: Session;
4678
- onComplete?: (state: any, element: UIElement) => void;
4994
+ onComplete?: (state: BaseElementState, element: UIElement) => void;
4679
4995
  isInstantPayment?: boolean;
4680
4996
  isStoredPaymentMethod?: boolean;
4681
4997
  oneClick?: boolean;
@@ -4689,7 +5005,7 @@ declare class SwishElement extends QRLoaderContainer {
4689
5005
  loadingContext?: string;
4690
5006
  createFromAction?: (action: PaymentAction, props: object) => UIElement;
4691
5007
  clientKey?: string;
4692
- elementRef?: any;
5008
+ elementRef?: UIElement;
4693
5009
  i18n?: Language;
4694
5010
  label?: string;
4695
5011
  paymentMethodType?: string;
@@ -4765,7 +5081,7 @@ declare class MBWayElement extends UIElement<AwaitConfiguration> {
4765
5081
  /**
4766
5082
  * Formats the component data output
4767
5083
  */
4768
- formatData(): object;
5084
+ formatData(): PaymentData;
4769
5085
  get isValid(): boolean;
4770
5086
  get displayName(): string;
4771
5087
  protected componentToRender(): h.JSX.Element;
@@ -5064,7 +5380,7 @@ declare class OnlineBankingINElement extends IssuerListContainer {
5064
5380
  }) => void;
5065
5381
  environment?: string;
5066
5382
  session?: Session;
5067
- onComplete?: (state: any, element: UIElement) => void;
5383
+ onComplete?: (state: BaseElementState, element: UIElement) => void;
5068
5384
  isInstantPayment?: boolean;
5069
5385
  isStoredPaymentMethod?: boolean;
5070
5386
  oneClick?: boolean;
@@ -5079,7 +5395,7 @@ declare class OnlineBankingINElement extends IssuerListContainer {
5079
5395
  loadingContext?: string;
5080
5396
  createFromAction?: (action: PaymentAction, props: object) => UIElement;
5081
5397
  clientKey?: string;
5082
- elementRef?: any;
5398
+ elementRef?: UIElement;
5083
5399
  i18n?: Language;
5084
5400
  label?: string;
5085
5401
  paymentMethodType?: string;
@@ -5261,7 +5577,7 @@ declare class WalletINElement extends IssuerListContainer {
5261
5577
  }) => void;
5262
5578
  environment?: string;
5263
5579
  session?: Session;
5264
- onComplete?: (state: any, element: UIElement) => void;
5580
+ onComplete?: (state: BaseElementState, element: UIElement) => void;
5265
5581
  isInstantPayment?: boolean;
5266
5582
  isStoredPaymentMethod?: boolean;
5267
5583
  oneClick?: boolean;
@@ -5276,7 +5592,7 @@ declare class WalletINElement extends IssuerListContainer {
5276
5592
  loadingContext?: string;
5277
5593
  createFromAction?: (action: PaymentAction, props: object) => UIElement;
5278
5594
  clientKey?: string;
5279
- elementRef?: any;
5595
+ elementRef?: UIElement;
5280
5596
  i18n?: Language;
5281
5597
  label?: string;
5282
5598
  paymentMethodType?: string;
@@ -5344,7 +5660,7 @@ declare class OnlineBankingCZElement extends IssuerListContainer {
5344
5660
  }) => void;
5345
5661
  environment?: string;
5346
5662
  session?: Session;
5347
- onComplete?: (state: any, element: UIElement) => void;
5663
+ onComplete?: (state: BaseElementState, element: UIElement) => void;
5348
5664
  isInstantPayment?: boolean;
5349
5665
  isStoredPaymentMethod?: boolean;
5350
5666
  oneClick?: boolean;
@@ -5359,7 +5675,7 @@ declare class OnlineBankingCZElement extends IssuerListContainer {
5359
5675
  loadingContext?: string;
5360
5676
  createFromAction?: (action: PaymentAction, props: object) => UIElement;
5361
5677
  clientKey?: string;
5362
- elementRef?: any;
5678
+ elementRef?: UIElement;
5363
5679
  i18n?: Language;
5364
5680
  label?: string;
5365
5681
  paymentMethodType?: string;
@@ -5417,7 +5733,7 @@ declare class OnlineBankingSKElement extends IssuerListContainer {
5417
5733
  }) => void;
5418
5734
  environment?: string;
5419
5735
  session?: Session;
5420
- onComplete?: (state: any, element: UIElement) => void;
5736
+ onComplete?: (state: BaseElementState, element: UIElement) => void;
5421
5737
  isInstantPayment?: boolean;
5422
5738
  isStoredPaymentMethod?: boolean;
5423
5739
  oneClick?: boolean;
@@ -5432,7 +5748,7 @@ declare class OnlineBankingSKElement extends IssuerListContainer {
5432
5748
  loadingContext?: string;
5433
5749
  createFromAction?: (action: PaymentAction, props: object) => UIElement;
5434
5750
  clientKey?: string;
5435
- elementRef?: any;
5751
+ elementRef?: UIElement;
5436
5752
  i18n?: Language;
5437
5753
  label?: string;
5438
5754
  paymentMethodType?: string;
@@ -5499,7 +5815,7 @@ declare class PromptPayElement extends QRLoaderContainer {
5499
5815
  }) => void;
5500
5816
  environment?: string;
5501
5817
  session?: Session;
5502
- onComplete?: (state: any, element: UIElement) => void;
5818
+ onComplete?: (state: BaseElementState, element: UIElement) => void;
5503
5819
  isInstantPayment?: boolean;
5504
5820
  isStoredPaymentMethod?: boolean;
5505
5821
  oneClick?: boolean;
@@ -5513,7 +5829,7 @@ declare class PromptPayElement extends QRLoaderContainer {
5513
5829
  loadingContext?: string;
5514
5830
  createFromAction?: (action: PaymentAction, props: object) => UIElement;
5515
5831
  clientKey?: string;
5516
- elementRef?: any;
5832
+ elementRef?: UIElement;
5517
5833
  i18n?: Language;
5518
5834
  label?: string;
5519
5835
  paymentMethodType?: string;
@@ -5574,7 +5890,7 @@ declare class DuitNowElement extends QRLoaderContainer {
5574
5890
  }) => void;
5575
5891
  environment?: string;
5576
5892
  session?: Session;
5577
- onComplete?: (state: any, element: UIElement) => void;
5893
+ onComplete?: (state: BaseElementState, element: UIElement) => void;
5578
5894
  isInstantPayment?: boolean;
5579
5895
  isStoredPaymentMethod?: boolean;
5580
5896
  oneClick?: boolean;
@@ -5588,7 +5904,7 @@ declare class DuitNowElement extends QRLoaderContainer {
5588
5904
  loadingContext?: string;
5589
5905
  createFromAction?: (action: PaymentAction, props: object) => UIElement;
5590
5906
  clientKey?: string;
5591
- elementRef?: any;
5907
+ elementRef?: UIElement;
5592
5908
  i18n?: Language;
5593
5909
  label?: string;
5594
5910
  paymentMethodType?: string;
@@ -5612,204 +5928,24 @@ declare class Riverty extends RedirectElement {
5612
5928
  type: string;
5613
5929
  subtype: string;
5614
5930
  };
5615
- browserInfo: BrowserInfo;
5616
- };
5617
- }
5618
-
5619
- declare class PayByBankUS extends RedirectElement {
5620
- static readonly type: TxVariants;
5621
- protected formatProps(props: any): any;
5622
- formatData(): {
5623
- paymentMethod: {
5624
- storedPaymentMethodId: string;
5625
- type: string;
5626
- };
5627
- browserInfo: BrowserInfo;
5628
- };
5629
- get displayName(): string;
5630
- get additionalInfo(): string;
5631
- get brands(): PaymentMethodBrand[];
5632
- protected componentToRender(): h.JSX.Element;
5633
- }
5634
-
5635
- /**
5636
- * PayPal Fastlane Reference:
5637
- * https://developer.paypal.com/docs/checkout/fastlane/reference/#link-customizeyourintegration
5638
- */
5639
- /**
5640
- * Fastlane object available in the window
5641
- */
5642
- interface FastlaneWindowInstance {
5643
- identity: {
5644
- lookupCustomerByEmail: (email: string) => Promise<{
5645
- customerContextId: string;
5646
- }>;
5647
- triggerAuthenticationFlow: (customerContextId: string, options?: AuthenticationFlowOptions) => Promise<FastlaneAuthenticatedCustomerResult>;
5648
- getSession: () => Promise<{
5649
- sessionId: string;
5650
- }>;
5651
- };
5652
- profile: {
5653
- showShippingAddressSelector: () => Promise<FastlaneShippingAddressSelectorResult>;
5654
- };
5655
- setLocale: (locale: string) => void;
5656
- ConsentComponent: () => Promise<{
5657
- getRenderState: () => Promise<FastlaneConsentRenderState>;
5658
- }>;
5659
- FastlaneWatermarkComponent: (options: {
5660
- includeAdditionalInfo: boolean;
5661
- }) => Promise<{
5662
- render: (container: any) => null;
5663
- }>;
5664
- }
5665
- interface FastlaneConsentRenderState {
5666
- showConsent: boolean;
5667
- defaultToggleState?: boolean;
5668
- termsAndConditionsLink?: string;
5669
- termsAndConditionsVersion?: string;
5670
- privacyPolicyLink?: string;
5671
- }
5672
- interface FastlaneOptions {
5673
- intendedExperience: 'externalProcessorCustomConsent';
5674
- metadata?: {
5675
- geoLocOverride?: string;
5676
- };
5677
- }
5678
- interface AuthenticationFlowOptions {
5679
- }
5680
- interface CardPaymentSource {
5681
- brand: string;
5682
- expiry: string;
5683
- lastDigits: string;
5684
- name: string;
5685
- billingAddress: FastlaneAddress;
5686
- }
5687
- /**
5688
- * External types
5689
- */
5690
- interface FastlaneShippingAddressSelectorResult {
5691
- selectionChanged: boolean;
5692
- selectedAddress: FastlaneShipping;
5693
- }
5694
- interface FastlaneAuthenticatedCustomerSucceeded {
5695
- authenticationState: 'succeeded';
5696
- profileData: FastlaneProfile;
5697
- }
5698
- interface FastlaneAuthenticatedCustomerFailed {
5699
- authenticationState: 'failed' | 'canceled' | 'not_found';
5700
- profileData: undefined;
5701
- }
5702
- type FastlaneAuthenticatedCustomerResult = FastlaneAuthenticatedCustomerSucceeded | FastlaneAuthenticatedCustomerFailed;
5703
- interface FastlaneAddress {
5704
- addressLine1: string;
5705
- addressLine2: string;
5706
- adminArea1: string;
5707
- adminArea2: string;
5708
- postalCode: string;
5709
- countryCode: string;
5710
- phone: {
5711
- nationalNumber: string;
5712
- countryCode: string;
5713
- };
5714
- }
5715
- interface FastlaneShipping {
5716
- name: {
5717
- firstName: string;
5718
- lastName: string;
5719
- fullName: string;
5720
- };
5721
- address: FastlaneAddress;
5722
- phoneNumber: {
5723
- nationalNumber: string;
5724
- countryCode: string;
5725
- };
5726
- }
5727
- interface FastlaneProfile {
5728
- name: {
5729
- firstName: string;
5730
- lastName: string;
5731
- fullName: string;
5732
- };
5733
- shippingAddress: FastlaneShipping;
5734
- card?: {
5735
- id: string;
5736
- paymentSource: {
5737
- card: CardPaymentSource;
5738
- };
5739
- };
5740
- }
5741
- type FastlaneComponentConfiguration = {
5742
- paymentType: 'fastlane';
5743
- configuration: {
5744
- fastlaneSessionId: string;
5745
- email: string;
5746
- tokenId: string;
5747
- lastFour: string;
5748
- brand: string;
5749
- };
5750
- };
5751
- type FastlaneCardComponentConfiguration = {
5752
- paymentType: 'card';
5753
- configuration: {
5754
- fastlaneConfiguration?: FastlaneSignupConfiguration;
5755
- };
5756
- };
5757
- type FastlaneSignupConfiguration = FastlaneConsentRenderState & {
5758
- fastlaneSessionId?: string;
5759
- telephoneNumber?: string;
5760
- };
5761
- interface FastlaneData {
5762
- consentShown: boolean;
5763
- fastlaneSessionId: string;
5764
- consentGiven: boolean;
5765
- consentVersion?: string;
5766
- telephoneNumber?: string;
5767
- }
5768
- type FastlanePaymentMethodConfiguration = FastlaneComponentConfiguration | FastlaneCardComponentConfiguration;
5769
- interface FastlaneSDKConfiguration {
5770
- clientKey: string;
5771
- environment: CoreConfiguration['environment'];
5772
- locale?: 'en-US' | 'es-US' | 'fr-RS' | 'zh-US';
5773
- analytics?: Pick<AnalyticsOptions, 'enabled'>;
5774
- /**
5775
- * Used to force the Fastlane SDK to return the consent details in case the shopper is not recognized.
5776
- * Use-case: Developer is testing the flow in another country outside US, which would not get consent details.
5777
- *
5778
- * This configuration should not be used for 'live' environment
5779
- */
5780
- forceConsentDetails?: boolean;
5931
+ browserInfo: BrowserInfo;
5932
+ };
5781
5933
  }
5782
- interface FastlaneConfiguration extends UIElementProps {
5783
- /**
5784
- * Card token ID, used to process the payment
5785
- */
5786
- tokenId: string;
5787
- /**
5788
- * Fastlane session ID
5789
- */
5790
- fastlaneSessionId: string;
5791
- /**
5792
- * Initial last four digits displayed once the Component is rendered
5793
- */
5794
- lastFour: string;
5795
- /**
5796
- * Initial brand displayed once the Component is rendered
5797
- */
5798
- brand: string;
5799
- /**
5800
- * Shopper's email (it will be used in the future to re-authenticate using Fastlane SDK within the Component)
5801
- */
5802
- email: string;
5803
- /**
5804
- * Used internally by Drop-in. Displays the brand images inside the Drop-in payment method header
5805
- * @internal
5806
- */
5807
- keepBrandsVisible?: boolean;
5808
- /**
5809
- * Property returned by the backend. Contains the list of brands supported by Fastlane component
5810
- * @internal
5811
- */
5812
- brands?: string[];
5934
+
5935
+ declare class PayByBankUS extends RedirectElement {
5936
+ static readonly type: TxVariants;
5937
+ protected formatProps(props: any): any;
5938
+ formatData(): {
5939
+ paymentMethod: {
5940
+ storedPaymentMethodId: string;
5941
+ type: string;
5942
+ };
5943
+ browserInfo: BrowserInfo;
5944
+ };
5945
+ get displayName(): string;
5946
+ get additionalInfo(): string;
5947
+ get brands(): PaymentMethodBrand[];
5948
+ protected componentToRender(): h.JSX.Element;
5813
5949
  }
5814
5950
 
5815
5951
  declare class Fastlane extends UIElement<FastlaneConfiguration> {
@@ -6035,7 +6171,7 @@ declare class PayToElement extends UIElement<PayToConfiguration> {
6035
6171
  }) => void;
6036
6172
  environment?: string;
6037
6173
  session?: Session;
6038
- onComplete?: (state: any, element: UIElement) => void;
6174
+ onComplete?: (state: BaseElementState, element: UIElement) => void;
6039
6175
  isInstantPayment?: boolean;
6040
6176
  isStoredPaymentMethod?: boolean;
6041
6177
  oneClick?: boolean;
@@ -6050,7 +6186,7 @@ declare class PayToElement extends UIElement<PayToConfiguration> {
6050
6186
  loadingContext?: string;
6051
6187
  createFromAction?: (action: PaymentAction, props: object) => UIElement;
6052
6188
  clientKey?: string;
6053
- elementRef?: any;
6189
+ elementRef?: UIElement;
6054
6190
  i18n?: Language;
6055
6191
  label?: string;
6056
6192
  paymentMethodType?: string;
@@ -6117,7 +6253,7 @@ interface IssuerListProps extends BaseEnrollmentProps {
6117
6253
  * @internal
6118
6254
  */
6119
6255
  onSubmitAnalytics?: (aObj: AbstractAnalyticsEvent) => void;
6120
- onChange?(payload: OnChangeData): void;
6256
+ onChange?(payload: IssuerListState): void;
6121
6257
  }
6122
6258
 
6123
6259
  interface PaymentProps extends IPayByBankPixAwait {
@@ -6552,164 +6688,85 @@ interface IDropin {
6552
6688
  closeActivePaymentMethod: () => void;
6553
6689
  }
6554
6690
 
6555
- interface SFError {
6556
- isValid?: boolean;
6557
- errorMessage?: string;
6558
- errorI18n?: string;
6559
- error: string;
6560
- rootNode: HTMLElement;
6561
- detectedBrands?: string[];
6562
- }
6563
- interface SFStateErrorObj {
6564
- [key: string]: SFError;
6691
+ interface CampaignContentProps {
6692
+ logoUrl?: string;
6693
+ nonprofitDescription?: string;
6694
+ nonprofitName?: string;
6695
+ causeName?: string;
6696
+ nonprofitUrl?: string;
6697
+ bannerUrl?: string;
6565
6698
  }
6566
6699
 
6567
- interface ValidationRuleErrorObj {
6568
- [key: string]: ValidationRuleResult;
6569
- }
6570
- interface AriaAttributes {
6571
- 'aria-relevant'?: 'additions' | 'all' | 'removals' | 'text' | 'additions text';
6572
- 'aria-live'?: 'off' | 'polite' | 'assertive';
6573
- 'aria-atomic'?: 'true' | 'false';
6574
- }
6575
- interface SRPanelProps extends BaseElementProps {
6576
- enabled?: boolean;
6577
- node?: string;
6578
- showPanel?: boolean;
6579
- moveFocus?: boolean;
6580
- id?: string;
6581
- ariaAttributes?: AriaAttributes;
6700
+ type Donation = RoundupDonation | FixedAmountsDonation;
6701
+ type DonationType = 'roundup' | 'fixedAmounts';
6702
+ interface RoundupDonation {
6703
+ type: 'roundup';
6704
+ currency: string;
6705
+ maxRoundupAmount: number;
6582
6706
  }
6583
- type SRPanelConfig = Pick<SRPanelProps, 'enabled' | 'node' | 'showPanel' | 'moveFocus' | 'id' | 'ariaAttributes'>;
6584
- interface GenericError {
6585
- isValid: boolean;
6586
- errorMessage: string;
6587
- error: string;
6707
+ interface FixedAmountsDonation {
6708
+ type: 'fixedAmounts';
6709
+ currency: string;
6710
+ values: Array<number>;
6588
6711
  }
6589
-
6590
- /**
6591
- * A panel meant to hold messages that will be read out by ScreenReaders on an aria-live="polite" basis
6592
- * Expects a string or string array of message to add to the panel to be read out
6593
- * For testing purposes can be made visible
6594
- */
6595
- declare class SRPanel extends BaseElement<SRPanelProps> {
6596
- static readonly type = "srPanel";
6597
- static readonly defaultProps: Partial<SRPanelProps>;
6598
- private readonly srPanelContainer;
6599
- private readonly id;
6600
- private readonly showPanel;
6601
- private readonly _enabled;
6602
- private readonly _moveFocus;
6603
- private componentRef;
6604
- constructor(checkout: ICore, props?: SRPanelProps);
6605
- setComponentRef: (ref: any) => void;
6606
- get enabled(): boolean;
6607
- get moveFocus(): boolean;
6608
- setAriaProps(ariaAttributes: AriaAttributes): void;
6609
- setMessages: (messages: string[] | string | null) => void;
6610
- render(): h.JSX.Element;
6712
+ interface DonationAmount {
6713
+ currency: string;
6714
+ value: number;
6611
6715
  }
6612
-
6613
- interface BaseElementProps {
6614
- order?: Order;
6615
- modules?: {
6616
- srPanel?: SRPanel;
6617
- analytics?: IAnalytics;
6618
- resources?: Resources;
6619
- risk?: RiskElement;
6716
+ interface DonationPayload {
6717
+ data: {
6718
+ amount: DonationAmount;
6620
6719
  };
6720
+ isValid?: boolean;
6721
+ }
6722
+ interface DonationComponentProps extends CampaignContentProps {
6723
+ donation: Donation;
6621
6724
  /**
6622
- * Identifies if the Element is the DropIn element
6725
+ * The original transaction amount.
6623
6726
  */
6624
- isDropin?: boolean;
6625
- }
6626
- interface IBaseElement {
6627
- data: object;
6628
- state: any;
6629
- props: any;
6630
- _id: string;
6631
- _component: any;
6632
- render(): ComponentChild | Error;
6633
- mount(domNode: HTMLElement | string): IBaseElement;
6634
- update(props: any): IBaseElement;
6635
- unmount(): IBaseElement;
6636
- remove(): void;
6637
- activate(): void;
6727
+ commercialTxAmount: number;
6728
+ termsAndConditionsUrl?: string;
6729
+ causeName?: string;
6730
+ showCancelButton?: boolean;
6731
+ onDonate: (payload: DonationPayload) => void;
6732
+ onCancel?: (payload: DonationPayload) => void;
6733
+ onChange?: (payload: DonationPayload) => void;
6734
+ onAmountSelected: (payload: DonationPayload) => void;
6735
+ setComponentRef: (ref: ComponentMethodsRef) => void;
6638
6736
  }
6639
6737
 
6640
- type CoreCallbacks = Pick<CoreConfiguration, 'beforeRedirect' | 'beforeSubmit' | 'onSubmit' | 'onReview' | 'onAdditionalDetails' | 'onPaymentFailed' | 'onPaymentCompleted' | 'onOrderUpdated' | 'onPaymentMethodsRequest' | 'onChange' | 'onActionHandled' | 'onError' | 'onEnterKeyPressed' | 'donation'>;
6641
- type StatusFromAction = 'redirect' | 'loading' | 'custom';
6642
- type UIElementProps = {
6643
- paymentMethodId?: string;
6644
- storedPaymentMethodId?: string;
6645
- } & BaseElementProps & CoreCallbacks & {
6646
- environment?: string;
6647
- session?: Session;
6648
- onComplete?: (state: any, element: UIElement) => void;
6649
- isInstantPayment?: boolean;
6650
- /**
6651
- * Flags if the element is Stored payment method
6652
- * @internal
6653
- */
6654
- isStoredPaymentMethod?: boolean;
6655
- /**
6656
- * Flag if the element is Stored payment method.
6657
- * Perhaps can be deprecated and we use the one above?
6658
- * @internal
6659
- */
6660
- oneClick?: boolean;
6661
- /**
6662
- * Stored payment method id
6663
- * @internal
6664
- */
6665
- storedPaymentMethodId?: string;
6666
- /**
6667
- * Status set when creating the Component from action
6668
- * @internal
6669
- */
6670
- statusType?: StatusFromAction;
6671
- type?: string;
6672
- name?: string;
6673
- icon?: string;
6674
- amount?: PaymentAmount;
6675
- secondaryAmount?: PaymentAmount;
6676
- /**
6677
- * Show/Hide pay button
6678
- * @defaultValue true
6679
- */
6680
- showPayButton?: boolean;
6681
- /** @internal */
6682
- payButton?: (options: PayButtonProps) => h.JSX.Element;
6683
- /** @internal */
6684
- loadingContext?: string;
6685
- /** @internal */
6686
- createFromAction?: (action: PaymentAction, props: object) => UIElement;
6687
- /** @internal */
6688
- clientKey?: string;
6689
- /** @internal */
6690
- elementRef?: any;
6691
- /** @internal */
6692
- i18n?: Language;
6738
+ declare class DonationElement extends UIElement<DonationConfiguration> {
6739
+ static readonly type = TxVariants.donation;
6740
+ private readonly isInServiceMode;
6741
+ constructor(checkout: ICore, props: DonationProps);
6693
6742
  /**
6694
- * The shopper’s issuer account label. It can be available for stored payment method
6695
- * @internal
6743
+ * Type guard to determine if props are for "service" mode.
6744
+ *
6745
+ * The "service" mode is used in the /sessions flow:
6746
+ * - if the /payments response mandates it, we consult the /sessions/donationCampaigns endpoint on behalf of the merchant, and mount any found Donation Campaigns.
6747
+ *
6748
+ * The opposite of this mode is the "direct" mode, used in the Advanced flow:
6749
+ * - the merchant makes their own call to the /donationCampaigns endpoint and provides the Donation Campaign directly to the component.
6696
6750
  */
6697
- label?: string;
6751
+ private static isServiceMode;
6752
+ static readonly defaultProps: {
6753
+ onCancel: () => void;
6754
+ onDonate: () => void;
6755
+ };
6756
+ private initialiseServiceMode;
6698
6757
  /**
6699
- * Returned after the payments call, when an action is returned. It represents the payment method tx variant
6700
- * that was used for the payment
6701
- * @internal
6758
+ * Returns the component payment data ready to submit to the Checkout API
6702
6759
  */
6703
- paymentMethodType?: string;
6760
+ get data(): any;
6704
6761
  /**
6705
- * Reference to the action object found in a /payments response. This, in most cases, is passed on to the onActionHandled callback
6762
+ * Returns whether the component state is valid or not
6706
6763
  */
6707
- originalAction?: PaymentAction;
6708
- };
6709
- type UIElementStatus = 'ready' | 'loading' | 'error' | 'success';
6710
- interface ComponentMethodsRef {
6711
- showValidation?: () => void;
6712
- setStatus?(status: UIElementStatus): void;
6764
+ get isValid(): any;
6765
+ setState(newState: any): void;
6766
+ donate(): void;
6767
+ cancel(): void;
6768
+ amountSelected(state: DonationPayload): void;
6769
+ protected componentToRender(): h.JSX.Element;
6713
6770
  }
6714
6771
 
6715
6772
  type DonationConfiguration = UIElementProps & Omit<DonationComponentProps, 'onDonate' | 'onCancel'> & {
@@ -6951,21 +7008,20 @@ type BeforeSubmitActions = {
6951
7008
  resolve: (data: PaymentData) => void;
6952
7009
  reject: () => void;
6953
7010
  };
7011
+ type OnChangeDataErrors = Record<string, {
7012
+ isValid: boolean;
7013
+ errorMessage: string;
7014
+ errorI18n: string;
7015
+ error?: string;
7016
+ rootNode?: HTMLElement;
7017
+ }>;
6954
7018
  type OnChangeData = {
6955
7019
  data: PaymentData;
6956
7020
  isValid: boolean;
6957
7021
  valid?: {
6958
7022
  [fieldKey: string]: boolean;
6959
7023
  };
6960
- errors?: {
6961
- [fieldKey: string]: {
6962
- isValid: boolean;
6963
- errorMessage: string;
6964
- errorI18n: string;
6965
- error: string;
6966
- rootNode: HTMLElement;
6967
- };
6968
- };
7024
+ errors?: OnChangeDataErrors;
6969
7025
  };
6970
7026
  interface CoreConfiguration {
6971
7027
  /**
@@ -7196,12 +7252,12 @@ interface CoreConfiguration {
7196
7252
  };
7197
7253
  }
7198
7254
 
7199
- declare abstract class BaseElement<P extends BaseElementProps> implements IBaseElement {
7255
+ declare abstract class BaseElement<P extends BaseElementProps, S extends BaseElementState = BaseElementState> implements IBaseElement<P> {
7200
7256
  readonly _id: string;
7201
7257
  readonly core: ICore;
7202
7258
  props: P;
7203
- state: any;
7204
- _component: any;
7259
+ state: S;
7260
+ _component: ComponentChild | undefined;
7205
7261
  protected _node: HTMLElement;
7206
7262
  protected static readonly defaultProps: {};
7207
7263
  constructor(checkout: ICore, props?: P);
@@ -7215,10 +7271,10 @@ declare abstract class BaseElement<P extends BaseElementProps> implements IBaseE
7215
7271
  * Executed on the `data` getter.
7216
7272
  * Returns the component data necessary for the /payments request
7217
7273
  */
7218
- protected formatData(): any;
7274
+ protected formatData(): PaymentData;
7219
7275
  protected submitAnalytics(_analyticsObj?: AbstractAnalyticsEvent): any;
7220
7276
  protected handleKeyDown(_e: TargetedKeyboardEvent<HTMLInputElement>): any;
7221
- protected setState(newState: object): void;
7277
+ protected setState(newState: S): void;
7222
7278
  /**
7223
7279
  * Returns the component payment data ready to submit to the Checkout API
7224
7280
  * Note: this does not ensure validity, check isValid first
@@ -7262,7 +7318,7 @@ declare abstract class UIElement<P extends UIElementProps = UIElementProps> exte
7262
7318
  /**
7263
7319
  * componentRef is a ref to the primary component inside the subclass that extends UIElement e.g. CardInput.tsx (which sits inside Card.tsx)
7264
7320
  */
7265
- protected componentRef: any;
7321
+ protected componentRef: ComponentMethodsRef | undefined;
7266
7322
  protected resources: Resources;
7267
7323
  /**
7268
7324
  * elementRef is a ref to the subclass that extends UIElement e.g. Card.tsx or Dropin.tsx
@@ -7318,11 +7374,11 @@ declare abstract class UIElement<P extends UIElementProps = UIElementProps> exte
7318
7374
  * - If Drop-in, will set status for Dropin component, and then it will propagate the new status for the active payment method component
7319
7375
  * - If Component, it will set its own status
7320
7376
  */
7321
- setElementStatus(status: UIElementStatus, props?: any): this;
7377
+ setElementStatus(status: UIElementStatus): this;
7322
7378
  /**
7323
7379
  * componentRef is a ref to the primary component inside that subclass e.g. CardInput.tsx
7324
7380
  */
7325
- setStatus(status: UIElementStatus, props?: any): this;
7381
+ setStatus(status: UIElementStatus): this;
7326
7382
  protected onChange(): void;
7327
7383
  protected submitAnalytics(event: AbstractAnalyticsEvent): void;
7328
7384
  submit(): void;
@@ -7330,7 +7386,7 @@ declare abstract class UIElement<P extends UIElementProps = UIElementProps> exte
7330
7386
  protected makePaymentsCall(): Promise<CheckoutAdvancedFlowResponse | CheckoutSessionPaymentResponse>;
7331
7387
  private submitUsingAdvancedFlow;
7332
7388
  private submitUsingSessionsFlow;
7333
- protected onComplete(state: any): void;
7389
+ protected onComplete(state: AdditionalDetailsData): void;
7334
7390
  protected handleError: (error: AdyenCheckoutError) => void;
7335
7391
  protected handleAdditionalDetails(state: AdditionalDetailsData): void;
7336
7392
  private makeAdditionalDetailsCall;
@@ -7668,7 +7724,7 @@ interface PaymentData extends PaymentMethodData {
7668
7724
  orderData: string;
7669
7725
  pspReference: string;
7670
7726
  };
7671
- clientStateDataIndicator: boolean;
7727
+ clientStateDataIndicator?: boolean;
7672
7728
  sessionData?: string;
7673
7729
  storePaymentMethod?: boolean;
7674
7730
  billingAddress?: AddressData;
@@ -7778,7 +7834,7 @@ interface CardConfiguration extends UIElementProps {
7778
7834
  *
7779
7835
  * - merchant set config option
7780
7836
  */
7781
- billingAddressMode?: 'full' | 'partial' | 'none';
7837
+ billingAddressMode?: `${AddressModeOptions}`;
7782
7838
  /**
7783
7839
  * Show Address fields
7784
7840
  * @defaultValue `false`
@@ -8188,13 +8244,14 @@ type DualBrandingChangeHandler = (brandValue: string) => void;
8188
8244
  declare class CardElement extends UIElement<CardConfiguration> {
8189
8245
  static readonly type: TxVariants;
8190
8246
  private readonly clickToPayService;
8247
+ protected componentRef: CardInputRef | undefined;
8191
8248
  /**
8192
8249
  * Reference to the 'ClickToPayComponent'
8193
8250
  */
8194
8251
  private clickToPayRef;
8195
8252
  constructor(checkout: ICore, props?: CardConfiguration);
8196
8253
  protected static readonly defaultProps: any;
8197
- setStatus(status: UIElementStatus, props?: any): this;
8254
+ setStatus(status: UIElementStatus): this;
8198
8255
  private readonly setClickToPayRef;
8199
8256
  protected getPaymentMethodConfigFromResponse(componentProps: CardConfiguration): RawPaymentMethod;
8200
8257
  formatProps(props: CardConfiguration): CardConfiguration;
@@ -8203,11 +8260,11 @@ declare class CardElement extends UIElement<CardConfiguration> {
8203
8260
  */
8204
8261
  formatData(): CardElementData;
8205
8262
  protected beforeRender(configSetByMerchant?: CardConfiguration): void;
8206
- updateStyles(stylesObj: any): this;
8207
- setFocusOn(fieldName: any): this;
8208
- onBrand: (event: any) => void;
8263
+ updateStyles(stylesObj: StylesObject): this;
8264
+ setFocusOn(fieldName: string): this;
8265
+ onBrand: (event: CardBrandData) => void;
8209
8266
  processBinLookupResponse(binLookupResponse: BinLookupResponse | null, isReset?: boolean): this;
8210
- handleUnsupportedCard(errObj: any): this;
8267
+ handleUnsupportedCard(errObj: CardErrorData): this;
8211
8268
  private readonly handleClickToPaySubmit;
8212
8269
  onBinLookup(obj: CardBinLookupData): void;
8213
8270
  private readonly onConfigSuccess;
@@ -8254,7 +8311,7 @@ declare class ThreeDS2DeviceFingerprint extends UIElement<ThreeDS2DeviceFingerpr
8254
8311
  dataKey: string;
8255
8312
  type: string;
8256
8313
  };
8257
- private callSubmit3DS2Fingerprint;
8314
+ private readonly callSubmit3DS2Fingerprint;
8258
8315
  protected beforeRender(): void;
8259
8316
  protected onActionHandled: (rtnObj: ActionHandledReturnObject) => void;
8260
8317
  /**
@@ -8323,7 +8380,7 @@ declare class PayMeElement extends QRLoaderContainer {
8323
8380
  }) => void;
8324
8381
  environment?: string;
8325
8382
  session?: Session;
8326
- onComplete?: (state: any, element: UIElement) => void;
8383
+ onComplete?: (state: BaseElementState, element: UIElement) => void;
8327
8384
  isInstantPayment?: boolean;
8328
8385
  isStoredPaymentMethod?: boolean;
8329
8386
  oneClick?: boolean;
@@ -8337,7 +8394,7 @@ declare class PayMeElement extends QRLoaderContainer {
8337
8394
  loadingContext?: string;
8338
8395
  createFromAction?: (action: PaymentAction, props: object) => UIElement;
8339
8396
  clientKey?: string;
8340
- elementRef?: any;
8397
+ elementRef?: UIElement;
8341
8398
  i18n?: Language;
8342
8399
  label?: string;
8343
8400
  paymentMethodType?: string;
@@ -8349,7 +8406,8 @@ declare class DropinElement extends UIElement<DropinConfiguration> implements ID
8349
8406
  static readonly type = TxVariants.dropin;
8350
8407
  protected static readonly defaultProps: DropinConfiguration;
8351
8408
  dropinRef: any;
8352
- private paymentMethodsConfiguration;
8409
+ elementRef: DropinElement;
8410
+ private readonly paymentMethodsConfiguration;
8353
8411
  /**
8354
8412
  * Reference to the component created from `handleAction` (Ex.: ThreeDS2Challenge)
8355
8413
  */
@@ -8361,7 +8419,7 @@ declare class DropinElement extends UIElement<DropinConfiguration> implements ID
8361
8419
  constructor(checkout: ICore, props?: DropinConfiguration);
8362
8420
  protected reportIntegrationFlavor(): void;
8363
8421
  protected storeElementRefOnCore(): void;
8364
- formatProps(props: any): {
8422
+ formatProps(props: DropinConfiguration): {
8365
8423
  instantPaymentTypes: InstantPaymentTypes[];
8366
8424
  paymentMethodsConfiguration?: PaymentMethodsConfiguration;
8367
8425
  paymentMethodComponents?: NewableComponent[];
@@ -8414,7 +8472,7 @@ declare class DropinElement extends UIElement<DropinConfiguration> implements ID
8414
8472
  }) => void;
8415
8473
  environment?: string;
8416
8474
  session?: Session;
8417
- onComplete?: (state: any, element: UIElement) => void;
8475
+ onComplete?: (state: BaseElementState, element: UIElement) => void;
8418
8476
  isInstantPayment?: boolean;
8419
8477
  isStoredPaymentMethod?: boolean;
8420
8478
  oneClick?: boolean;
@@ -8429,7 +8487,7 @@ declare class DropinElement extends UIElement<DropinConfiguration> implements ID
8429
8487
  loadingContext?: string;
8430
8488
  createFromAction?: (action: PaymentAction, props: object) => UIElement;
8431
8489
  clientKey?: string;
8432
- elementRef?: any;
8490
+ elementRef?: UIElement;
8433
8491
  i18n?: Language;
8434
8492
  label?: string;
8435
8493
  paymentMethodType?: string;
@@ -8437,7 +8495,8 @@ declare class DropinElement extends UIElement<DropinConfiguration> implements ID
8437
8495
  };
8438
8496
  get isValid(): boolean;
8439
8497
  showValidation(): this;
8440
- setStatus(status: any, props?: {}): this;
8498
+ setElementStatus(status: UIElementStatus, props?: Record<string, unknown>): this;
8499
+ setStatus(status: UIElementStatus, props?: Record<string, unknown>): this;
8441
8500
  get activePaymentMethod(): any;
8442
8501
  get data(): any;
8443
8502
  displayFinalAnimation(type: 'success' | 'error'): void;
@@ -8463,7 +8522,7 @@ declare class DropinElement extends UIElement<DropinConfiguration> implements ID
8463
8522
  /**
8464
8523
  * Creates the Drop-in elements
8465
8524
  */
8466
- private handleCreate;
8525
+ private readonly handleCreate;
8467
8526
  handleAction(action: PaymentAction, props?: {}): this | null;
8468
8527
  /**
8469
8528
  * handleOrder is implemented so we don't trigger a callback like in the components
@@ -8798,4 +8857,4 @@ declare namespace AdyenCheckout {
8798
8857
  }
8799
8858
 
8800
8859
  export { ANCVElement as ANCV, AchElement as Ach, AddressElement as Address, AdyenCheckout, AdyenCheckoutError, Affirm, AfterPay, AfterPayB2B, AmazonPayElement as AmazonPay, ApplePayElement as ApplePay, Atome, BacsElement as BacsDirectDebit, BancontactElement as Bancontact, BankTransferElement as BankTransfer, BCMCMobileElement as BcmcMobile, BillDeskOnlineElement as BillDeskOnline, BillDeskWalletElement as BillDeskWallet, BlikElement as Blik, BoletoElement as Boleto, CardElement as Card, CashAppPay, ClickToPayElement as ClickToPay, Core, CustomCard, DokuElement as Doku, DonationElement as Donation, DotpayElement as Dotpay, DragonpayElement as Dragonpay, DropinElement as Dropin, DuitNowElement as DuitNow, EPSElement as EPS, EcontextElement as Econtext, FacilyPay10x as FacilPay10x, FacilyPay12x as FacilPay12x, FacilyPay3x as FacilPay3x, FacilyPay4x as FacilPay4x, FacilyPay6x as FacilPay6x, Fastlane, FastlaneSDK, GiftcardElement as Giftcard, GiropayElement as Giropay, GooglePay, Iris, IrisMode, KlarnaPayments as Klarna, MBWayElement as MBWay, MealVoucherFRElement as MealVoucherFR, MolPayEBankingMYElement as MolPayEBankingMY, MolPayEBankingTHElement as MolPayEBankingTH, MolPayEbankingVNElement as MolPayEBankingVN, MultibancoElement as Multibanco, OnlineBankingCZElement as OnlineBankingCZ, OnlineBankingFI, OnlineBankingINElement as OnlineBankingIN, OnlineBankingPL, OnlineBankingSKElement as OnlineBankingSK, OxxoElement as Oxxo, PayByBank, PayByBankPixElement as PayByBankPix, PayByBankUS, PayMeElement as PayMe, PayNowElement as PayNow, PaypalElement as PayPal, PayToElement as PayTo, PayuNetCashcardElement as PayuCashcard, PayuNetBankingElement as PayuNetBanking, PersonalDetailsElement as PersonalDetails, PixElement as Pix, PreAuthorizedDebitCanada, PromptPayElement as PromptPay, RatePay, RatePayDirectDebit, RedirectElement as Redirect, Riverty, SepaElement as SepaDirectDebit, SwishElement as Swish, ThreeDS2Challenge, ThreeDS2DeviceFingerprint, TrustlyElement as Trustly, TwintElement as Twint, UIElement, UPI, VippsElement as Vipps, WalletINElement as WalletIN, WeChatPayElement as WeChat, index_d as components, initializeFastlane };
8801
- export type { ANCVConfiguration, ANCVDataState, AchConfiguration, AchPlaceholders, ActionDescriptionType, ActionHandledReturnObject, AdditionalDetailsActions, AdditionalDetailsData, AddressData, AddressField, AmazonPayBackendConfiguration, AmazonPayButtonProps, AmazonPayButtonSettings, AmazonPayComponentProps, AmazonPayConfiguration, AmazonPayElementData, AmazonWindowObject, App, ApplePayButtonStyle, ApplePayButtonType, ApplePayConfiguration, ApplePayElementData, ApplePayPaymentAuthorizationResult, ApplePayPaymentOrderDetails, ApplePaySessionRequest, ApplePayWebConfiguration, AwaitComponentProps, AwaitConfiguration, BankDetailsSchema, BankTransferConfiguration, BankTransferSchema, BankTransferState, BeforeSubmitActions, BinLookupResponse, BinLookupResponseRaw, BoletoConfiguration, BoletoElementProps, BoletoInputDataState, BoletoInputErrorState, BoletoInputValidState, BrandConfiguration, BrandObject, BrowserInfo, CReqData, CardAllValidData, CardAutoCompleteData, CardBackendConfiguration, CardBinLookupData, CardBinValueData, CardBrandData, CardBrandsConfiguration, CardConfigSuccessData, CardConfiguration, CardElementData, CardErrorData, CardFieldValidData, CardFocusData, CardLoadData, CardPlaceholders, CashAppPayConfiguration, CashAppPayElementData, CashAppPayEventData, ChallengeData, ChallengeResolveData, ChallengeWindowSize, ChangeActionOptions, ChangePaymentDetailsButtonProps, ChargeAmount, CheckoutAdvancedFlowResponse, CheckoutDetailsRequest, CheckoutSession, CheckoutSessionConfig, ClickToPayConfiguration, ClickToPayPaymentData, ClickToPayProps, ClickToPayScheme, CommonVoucherProps, ComponentFocusObject, ComponentMethodsRef, CoreConfiguration, CoreModules, Currency, CustomCardConfiguration, CustomTranslations, DecodeObject, DeliverySpecifications, DokuVoucherResultProps, DonationCampaign, DonationCampaignOptions, DonationConfiguration, DonationOptions, DonationProps, DragonpayConfiguraton, DragonpayInputData, DragonpayInputIssuerItem, DragonpayInputProps, DragonpayVoucherResultProps, DropinComponentProps, DropinComponentState, DropinConfiguration, DropinStatus, DropinStatusProps, DualBrandButtons, DualBrandSelectElement, DualBrandingChangeHandler, EcontextConfiguration, EcontextInputSchema, EcontextVoucherResultProps, ErrorCodeObject, ExtendedMerchantInfo, FastlaneAddress, FastlaneAuthenticatedCustomerResult, FastlaneConfiguration, FastlaneConsentRenderState, FastlaneData, FastlaneOptions, FastlanePaymentMethodConfiguration, FastlaneProfile, FastlaneSDKConfiguration, FastlaneShipping, FastlaneShippingAddressSelectorResult, FastlaneSignupConfiguration, FastlaneWindowInstance, FieldsetVisibility, FingerPrintData, FingerprintResolveData, FundingSource, FundingSourceKeys, GiftCardBalanceCheckErrorType, GiftCardConfiguration, GiftCardElementData, GiftCardValidationError, GooglePayConfiguration, GooglePaymentDataRequest, ICore, IDropin, InstantPaymentTypes, Intent, IrisConfiguration, IrisData, IrisState, IssuerListConfiguration, IssuerListData, KlarnaAction, KlarnaAdditionalDetailsData, KlarnaComponentRef, KlarnaConfiguration, KlarnaSdkData, KlarnaWidgetAuthorizeResponse, KlarnaWidgetProps, LedgerCurrencies, MandateFrequencyType, MandateType, OnChangeData, OpenInvoiceActiveFieldsets, OpenInvoiceConfiguration, OpenInvoiceFieldsetsRefs, OpenInvoiceProps, OpenInvoiceStateData, OpenInvoiceStateError, OpenInvoiceStateValid, OpenInvoiceVisibility, Order, OrderButtonProps, OrderStatus, PayPalConfiguration, PayToConfiguration, PayToData, PayToPlaceholdersType, PayloadJSON, PaymentAction, PaymentActionsType, PaymentAmount, PaymentCompletedData, PaymentData, PaymentFailedData, PaymentMethodBrand, PaymentMethodData, PaymentMethodDisplayMode, PaymentMethodGroup, PaymentMethodOptions, PaymentMethods, PaymentMethodsConfiguration, PaymentMethodsRequestData, PaymentMethodsResponse, PaymentResponseData, PersonalDetailsSchema, PixConfiguration, PixElementData, PostMsgParseErrorObject, PreAuthorizedDebitCanadaConfiguration, PreAuthorizedDebitCanadaPlaceholders, ProcessedPaymentStatusResponse, QRLoaderConfiguration, RawPaymentMethod, RawPaymentResponse, RawPaymentStatusResponse, RawStoredPaymentMethod, RecurringMetadata, RedirectConfiguration, Region, ResultCode, ResultObject, ResultValue, ReviewDetails, SepaConfiguration, SepaElementData, SessionsResponse, SignOutButtonProps, SocialSecurityMode, StatusFromAction, SubmitActions, SubmitData, SupportedLocale, SupportedPayPalFundingSources, ThreeDS2ActionProps, ThreeDS2ChallengeConfiguration, ThreeDS2ConfigProps, ThreeDS2DeviceFingerprintConfiguration, ThreeDS2FingerprintResponse, ThreeDS2FlowObject, ThreeDS2FlowProps, ThreeDS2Token, UIElementProps, UIElementStatus, UPIAppList, UPIConfiguration, UpdateAmazonCheckoutSessionRequest, UpiMode, UpiPaymentData, UpiType, ValidationError, VoucherConfiguration, VoucherDetail, VoucherProps, balanceCheckResponseType, onBalanceCheckCallbackType, onOrderCancelData, onOrderCancelInternalCallback, onOrderCancelType, onOrderRequestCallbackType, onOrderUpdatedCallbackType, onRequiringConfirmationCallbackType };
8860
+ export type { ANCVConfiguration, ANCVDataState, AchConfiguration, AchPlaceholders, ActionDescriptionType, ActionHandledReturnObject, AdditionalDetailsActions, AdditionalDetailsData, AddressData, AddressField, AmazonPayBackendConfiguration, AmazonPayButtonProps, AmazonPayButtonSettings, AmazonPayComponentProps, AmazonPayComponentRef, AmazonPayConfiguration, AmazonPayElementData, AmazonWindowObject, App, ApplePayButtonStyle, ApplePayButtonType, ApplePayConfiguration, ApplePayElementData, ApplePayPaymentAuthorizationResult, ApplePayPaymentOrderDetails, ApplePaySessionRequest, ApplePayWebConfiguration, AwaitComponentProps, AwaitConfiguration, BankDetailsSchema, BankTransferConfiguration, BankTransferSchema, BankTransferState, BeforeSubmitActions, BinLookupResponse, BinLookupResponseRaw, BoletoConfiguration, BoletoElementProps, BoletoInputDataState, BoletoInputErrorState, BoletoInputValidState, BrandConfiguration, BrandObject, BrowserInfo, CReqData, CardAllValidData, CardAutoCompleteData, CardBackendConfiguration, CardBinLookupData, CardBinValueData, CardBrandData, CardBrandsConfiguration, CardConfigSuccessData, CardConfiguration, CardElementData, CardErrorData, CardFieldValidData, CardFocusData, CardLoadData, CardPlaceholders, CashAppPayConfiguration, CashAppPayElementData, CashAppPayEventData, ChallengeData, ChallengeResolveData, ChallengeWindowSize, ChangeActionOptions, ChangePaymentDetailsButtonProps, ChargeAmount, CheckoutAdvancedFlowResponse, CheckoutDetailsRequest, CheckoutSession, CheckoutSessionConfig, ClickToPayConfiguration, ClickToPayPaymentData, ClickToPayProps, ClickToPayScheme, CommonVoucherProps, ComponentFocusObject, ComponentMethodsRef, CoreConfiguration, CoreModules, Currency, CustomCardConfiguration, CustomTranslations, DecodeObject, DeliverySpecifications, DokuVoucherResultProps, DonationCampaign, DonationCampaignOptions, DonationConfiguration, DonationOptions, DonationProps, DragonpayConfiguraton, DragonpayInputData, DragonpayInputIssuerItem, DragonpayInputProps, DragonpayVoucherResultProps, DropinComponentProps, DropinComponentState, DropinConfiguration, DropinStatus, DropinStatusProps, DualBrandButtons, DualBrandSelectElement, DualBrandingChangeHandler, EcontextConfiguration, EcontextInputSchema, EcontextVoucherResultProps, ErrorCodeObject, ExtendedMerchantInfo, FastlaneAddress, FastlaneAuthenticatedCustomerResult, FastlaneConfiguration, FastlaneConsentRenderState, FastlaneData, FastlaneOptions, FastlanePaymentMethodConfiguration, FastlaneProfile, FastlaneSDKConfiguration, FastlaneShipping, FastlaneShippingAddressSelectorResult, FastlaneSignupConfiguration, FastlaneWindowInstance, FieldsetVisibility, FingerPrintData, FingerprintResolveData, FundingSource, FundingSourceKeys, GiftCardBalanceCheckErrorType, GiftCardConfiguration, GiftCardElementData, GiftCardValidationError, GooglePayConfiguration, GooglePaymentDataRequest, ICore, IDropin, InstantPaymentTypes, Intent, IrisConfiguration, IrisData, IrisState, IssuerListConfiguration, IssuerListData, KlarnaAction, KlarnaAdditionalDetailsData, KlarnaComponentRef, KlarnaConfiguration, KlarnaSdkData, KlarnaWidgetAuthorizeResponse, KlarnaWidgetProps, LedgerCurrencies, MandateFrequencyType, MandateType, OnChangeData, OnChangeDataErrors, OpenInvoiceActiveFieldsets, OpenInvoiceConfiguration, OpenInvoiceFieldsetsRefs, OpenInvoiceProps, OpenInvoiceState, OpenInvoiceStateData, OpenInvoiceStateError, OpenInvoiceStateValid, OpenInvoiceVisibility, Order, OrderButtonProps, OrderStatus, PayPalConfiguration, PayToConfiguration, PayToData, PayToPlaceholdersType, PayloadJSON, PaymentAction, PaymentActionsType, PaymentAmount, PaymentCompletedData, PaymentData, PaymentFailedData, PaymentMethodBrand, PaymentMethodData, PaymentMethodDisplayMode, PaymentMethodGroup, PaymentMethodOptions, PaymentMethods, PaymentMethodsConfiguration, PaymentMethodsRequestData, PaymentMethodsResponse, PaymentResponseData, PersonalDetailsSchema, PixConfiguration, PixElementData, PostMsgParseErrorObject, PreAuthorizedDebitCanadaConfiguration, PreAuthorizedDebitCanadaPlaceholders, ProcessedPaymentStatusResponse, QRLoaderConfiguration, RawPaymentMethod, RawPaymentResponse, RawPaymentStatusResponse, RawStoredPaymentMethod, RecurringMetadata, RedirectConfiguration, Region, ResultCode, ResultObject, ResultValue, ReviewDetails, SepaConfiguration, SepaElementData, SessionsResponse, SignOutButtonProps, SocialSecurityMode, StatusFromAction, SubmitActions, SubmitData, SupportedLocale, SupportedPayPalFundingSources, ThreeDS2ActionProps, ThreeDS2ChallengeConfiguration, ThreeDS2ConfigProps, ThreeDS2DeviceFingerprintConfiguration, ThreeDS2FingerprintResponse, ThreeDS2FlowObject, ThreeDS2FlowProps, ThreeDS2Token, UIElementProps, UIElementStatus, UPIAppList, UPIConfiguration, UpdateAmazonCheckoutSessionRequest, UpiMode, UpiPaymentData, UpiType, ValidationError, VoucherConfiguration, VoucherDetail, VoucherProps, balanceCheckResponseType, onBalanceCheckCallbackType, onOrderCancelData, onOrderCancelInternalCallback, onOrderCancelType, onOrderRequestCallbackType, onOrderUpdatedCallbackType, onRequiringConfirmationCallbackType };