@paydock/client-sdk 1.105.1 → 1.105.56-beta

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 (649) hide show
  1. package/README.md +2094 -465
  2. package/bundles/index.cjs +35088 -0
  3. package/bundles/index.cjs.d.ts +4021 -0
  4. package/bundles/index.mjs +35050 -0
  5. package/bundles/index.mjs.d.ts +4021 -0
  6. package/bundles/types/api/api-base.d.ts +54 -0
  7. package/bundles/types/api/api-base.d.ts.map +1 -0
  8. package/{lib → bundles/types}/api/api-charge-internal.d.ts +2 -0
  9. package/bundles/types/api/api-charge-internal.d.ts.map +1 -0
  10. package/{lib → bundles/types}/api/api-charge.d.ts +1 -0
  11. package/bundles/types/api/api-charge.d.ts.map +1 -0
  12. package/bundles/types/api/api-checkout-internal.d.ts +57 -0
  13. package/bundles/types/api/api-checkout-internal.d.ts.map +1 -0
  14. package/bundles/types/api/api-gateway-internal.d.ts +12 -0
  15. package/bundles/types/api/api-gateway-internal.d.ts.map +1 -0
  16. package/{lib → bundles/types}/api/api-internal.d.ts +5 -0
  17. package/bundles/types/api/api-internal.d.ts.map +1 -0
  18. package/{lib → bundles/types}/api/api-service-internal.d.ts +3 -1
  19. package/bundles/types/api/api-service-internal.d.ts.map +1 -0
  20. package/{lib → bundles/types}/api/api.d.ts +1 -0
  21. package/bundles/types/api/api.d.ts.map +1 -0
  22. package/bundles/types/api/index.d.ts +2 -0
  23. package/bundles/types/api/index.d.ts.map +1 -0
  24. package/{lib → bundles/types}/canvas-3ds/canvas-3ds.d.ts +1 -0
  25. package/bundles/types/canvas-3ds/canvas-3ds.d.ts.map +1 -0
  26. package/{lib → bundles/types}/canvas-3ds/index.d.ts +1 -0
  27. package/bundles/types/canvas-3ds/index.d.ts.map +1 -0
  28. package/{lib → bundles/types}/canvas-3ds/services/gpayments-service.d.ts +4 -3
  29. package/bundles/types/canvas-3ds/services/gpayments-service.d.ts.map +1 -0
  30. package/{lib → bundles/types}/canvas-3ds/services/index.d.ts +1 -0
  31. package/bundles/types/canvas-3ds/services/index.d.ts.map +1 -0
  32. package/{lib → bundles/types}/canvas-3ds/services/standalone3ds-service.d.ts +1 -0
  33. package/bundles/types/canvas-3ds/services/standalone3ds-service.d.ts.map +1 -0
  34. package/bundles/types/checkout/checkout.d.ts +86 -0
  35. package/bundles/types/checkout/checkout.d.ts.map +1 -0
  36. package/bundles/types/checkout/helpers/instruction-handler.d.ts +23 -0
  37. package/bundles/types/checkout/helpers/instruction-handler.d.ts.map +1 -0
  38. package/bundles/types/checkout/helpers/instruction-module.d.ts +6 -0
  39. package/bundles/types/checkout/helpers/instruction-module.d.ts.map +1 -0
  40. package/bundles/types/checkout/helpers/instruction-module.decorator.d.ts +6 -0
  41. package/bundles/types/checkout/helpers/instruction-module.decorator.d.ts.map +1 -0
  42. package/bundles/types/checkout/helpers/instruction.decorator.d.ts +5 -0
  43. package/bundles/types/checkout/helpers/instruction.decorator.d.ts.map +1 -0
  44. package/bundles/types/checkout/helpers/resource-helper.d.ts +5 -0
  45. package/bundles/types/checkout/helpers/resource-helper.d.ts.map +1 -0
  46. package/bundles/types/checkout/helpers/session-helper.d.ts +5 -0
  47. package/bundles/types/checkout/helpers/session-helper.d.ts.map +1 -0
  48. package/bundles/types/checkout/index.d.ts +2 -0
  49. package/bundles/types/checkout/index.d.ts.map +1 -0
  50. package/bundles/types/checkout/instructions/index.d.ts +3 -0
  51. package/bundles/types/checkout/instructions/index.d.ts.map +1 -0
  52. package/bundles/types/checkout/instructions/v1/index.d.ts +4 -0
  53. package/bundles/types/checkout/instructions/v1/index.d.ts.map +1 -0
  54. package/bundles/types/checkout/instructions/v1/instruction.afterpay_checkout_form.show.d.ts +20 -0
  55. package/bundles/types/checkout/instructions/v1/instruction.afterpay_checkout_form.show.d.ts.map +1 -0
  56. package/bundles/types/checkout/instructions/v1/instruction.afterpay_wallet_form.show.d.ts +14 -0
  57. package/bundles/types/checkout/instructions/v1/instruction.afterpay_wallet_form.show.d.ts.map +1 -0
  58. package/bundles/types/checkout/instructions/v1/instruction.apple_pay_form.show.d.ts +18 -0
  59. package/bundles/types/checkout/instructions/v1/instruction.apple_pay_form.show.d.ts.map +1 -0
  60. package/bundles/types/checkout/instructions/v1/instruction.bank_account_form.show.d.ts +15 -0
  61. package/bundles/types/checkout/instructions/v1/instruction.bank_account_form.show.d.ts.map +1 -0
  62. package/bundles/types/checkout/instructions/v1/instruction.canvas_3ds.show.d.ts +11 -0
  63. package/bundles/types/checkout/instructions/v1/instruction.canvas_3ds.show.d.ts.map +1 -0
  64. package/bundles/types/checkout/instructions/v1/instruction.card_form.show.d.ts +19 -0
  65. package/bundles/types/checkout/instructions/v1/instruction.card_form.show.d.ts.map +1 -0
  66. package/bundles/types/checkout/instructions/v1/instruction.disable_payment_method_event.emit.d.ts +19 -0
  67. package/bundles/types/checkout/instructions/v1/instruction.disable_payment_method_event.emit.d.ts.map +1 -0
  68. package/bundles/types/checkout/instructions/v1/instruction.generic.show_message.d.ts +26 -0
  69. package/bundles/types/checkout/instructions/v1/instruction.generic.show_message.d.ts.map +1 -0
  70. package/bundles/types/checkout/instructions/v1/instruction.google_pay_form.show.d.ts +18 -0
  71. package/bundles/types/checkout/instructions/v1/instruction.google_pay_form.show.d.ts.map +1 -0
  72. package/bundles/types/checkout/instructions/v1/instruction.merchant_event.emit.d.ts +18 -0
  73. package/bundles/types/checkout/instructions/v1/instruction.merchant_event.emit.d.ts.map +1 -0
  74. package/bundles/types/checkout/instructions/v1/instruction.payment_methods.show.d.ts +18 -0
  75. package/bundles/types/checkout/instructions/v1/instruction.payment_methods.show.d.ts.map +1 -0
  76. package/bundles/types/checkout/instructions/v1/instruction.paypal_form.show.d.ts +21 -0
  77. package/bundles/types/checkout/instructions/v1/instruction.paypal_form.show.d.ts.map +1 -0
  78. package/bundles/types/checkout/instructions/v1/instruction.zip_checkout_form.show.d.ts +19 -0
  79. package/bundles/types/checkout/instructions/v1/instruction.zip_checkout_form.show.d.ts.map +1 -0
  80. package/bundles/types/checkout/layout-widgets/additionals.d.ts +3 -0
  81. package/bundles/types/checkout/layout-widgets/additionals.d.ts.map +1 -0
  82. package/bundles/types/checkout/layout-widgets/default-variables.enum.d.ts +9 -0
  83. package/bundles/types/checkout/layout-widgets/default-variables.enum.d.ts.map +1 -0
  84. package/bundles/types/checkout/layout-widgets/message.d.ts +34 -0
  85. package/bundles/types/checkout/layout-widgets/message.d.ts.map +1 -0
  86. package/bundles/types/checkout/layout-widgets/payment-methods-template.d.ts +13 -0
  87. package/bundles/types/checkout/layout-widgets/payment-methods-template.d.ts.map +1 -0
  88. package/bundles/types/checkout/layout-widgets/payment-methods.d.ts +52 -0
  89. package/bundles/types/checkout/layout-widgets/payment-methods.d.ts.map +1 -0
  90. package/bundles/types/checkout/layout-widgets/payment-template.d.ts +3 -0
  91. package/bundles/types/checkout/layout-widgets/payment-template.d.ts.map +1 -0
  92. package/{lib → bundles/types}/checkout-button/afterpay/afterpay-checkout-button.d.ts +1 -0
  93. package/bundles/types/checkout-button/afterpay/afterpay-checkout-button.d.ts.map +1 -0
  94. package/{lib → bundles/types}/checkout-button/afterpay/afterpay.runner.d.ts +3 -0
  95. package/bundles/types/checkout-button/afterpay/afterpay.runner.d.ts.map +1 -0
  96. package/{lib → bundles/types}/checkout-button/checkout-button.d.ts +1 -0
  97. package/bundles/types/checkout-button/checkout-button.d.ts.map +1 -0
  98. package/{lib → bundles/types}/checkout-button/checkout-button.interface.d.ts +1 -0
  99. package/bundles/types/checkout-button/checkout-button.interface.d.ts.map +1 -0
  100. package/{lib → bundles/types}/checkout-button/checkout-contextual-handler.d.ts +5 -0
  101. package/bundles/types/checkout-button/checkout-contextual-handler.d.ts.map +1 -0
  102. package/{lib → bundles/types}/checkout-button/index.d.ts +2 -1
  103. package/bundles/types/checkout-button/index.d.ts.map +1 -0
  104. package/{lib → bundles/types}/checkout-button/paypal/paypal-checkout-button.d.ts +1 -0
  105. package/bundles/types/checkout-button/paypal/paypal-checkout-button.d.ts.map +1 -0
  106. package/{lib → bundles/types}/checkout-button/paypal/paypal.runner.d.ts +1 -0
  107. package/bundles/types/checkout-button/paypal/paypal.runner.d.ts.map +1 -0
  108. package/{lib → bundles/types}/checkout-button/runner/base.runner.d.ts +4 -3
  109. package/bundles/types/checkout-button/runner/base.runner.d.ts.map +1 -0
  110. package/{lib → bundles/types}/checkout-button/runner/contextual.runner.d.ts +4 -2
  111. package/bundles/types/checkout-button/runner/contextual.runner.d.ts.map +1 -0
  112. package/{lib → bundles/types}/checkout-button/runner/index.d.ts +1 -0
  113. package/bundles/types/checkout-button/runner/index.d.ts.map +1 -0
  114. package/{lib → bundles/types}/checkout-button/runner/popup.runner.d.ts +5 -4
  115. package/bundles/types/checkout-button/runner/popup.runner.d.ts.map +1 -0
  116. package/{lib → bundles/types}/checkout-button/runner/redirect.runner.d.ts +2 -1
  117. package/bundles/types/checkout-button/runner/redirect.runner.d.ts.map +1 -0
  118. package/bundles/types/checkout-button/zipmoney/index.d.ts +4 -0
  119. package/bundles/types/checkout-button/zipmoney/index.d.ts.map +1 -0
  120. package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney-checkout-button.d.ts +1 -0
  121. package/bundles/types/checkout-button/zipmoney/zipmoney-checkout-button.d.ts.map +1 -0
  122. package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney-contextual.runner.d.ts +2 -1
  123. package/bundles/types/checkout-button/zipmoney/zipmoney-contextual.runner.d.ts.map +1 -0
  124. package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney-redirect.runner.d.ts +2 -1
  125. package/bundles/types/checkout-button/zipmoney/zipmoney-redirect.runner.d.ts.map +1 -0
  126. package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney.config.d.ts +1 -0
  127. package/bundles/types/checkout-button/zipmoney/zipmoney.config.d.ts.map +1 -0
  128. package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney.runner.d.ts +2 -1
  129. package/bundles/types/checkout-button/zipmoney/zipmoney.runner.d.ts.map +1 -0
  130. package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney.types.d.ts +1 -0
  131. package/bundles/types/checkout-button/zipmoney/zipmoney.types.d.ts.map +1 -0
  132. package/{lib → bundles/types}/components/ability-guard.d.ts +1 -0
  133. package/bundles/types/components/ability-guard.d.ts.map +1 -0
  134. package/{lib → bundles/types}/components/background.d.ts +1 -0
  135. package/bundles/types/components/background.d.ts.map +1 -0
  136. package/{lib → bundles/types}/components/container.d.ts +1 -0
  137. package/bundles/types/components/container.d.ts.map +1 -0
  138. package/{lib → bundles/types}/components/dispatcher.d.ts +2 -1
  139. package/bundles/types/components/dispatcher.d.ts.map +1 -0
  140. package/{lib → bundles/types}/components/element-style.d.ts +2 -1
  141. package/bundles/types/components/element-style.d.ts.map +1 -0
  142. package/{lib → bundles/types}/components/flypay-iframe-event.d.ts +1 -0
  143. package/bundles/types/components/flypay-iframe-event.d.ts.map +1 -0
  144. package/{lib/components/form-Interceptor.d.ts → bundles/types/components/form-interceptor.d.ts} +1 -0
  145. package/bundles/types/components/form-interceptor.d.ts.map +1 -0
  146. package/{lib → bundles/types}/components/http-core.d.ts +1 -0
  147. package/bundles/types/components/http-core.d.ts.map +1 -0
  148. package/{lib → bundles/types}/components/iframe-event.d.ts +6 -0
  149. package/bundles/types/components/iframe-event.d.ts.map +1 -0
  150. package/{lib → bundles/types}/components/iframe.d.ts +3 -0
  151. package/bundles/types/components/iframe.d.ts.map +1 -0
  152. package/{lib → bundles/types}/components/link.d.ts +6 -3
  153. package/bundles/types/components/link.d.ts.map +1 -0
  154. package/{lib → bundles/types}/components/loader.d.ts +1 -0
  155. package/bundles/types/components/loader.d.ts.map +1 -0
  156. package/{lib → bundles/types}/components/param.d.ts +16 -9
  157. package/bundles/types/components/param.d.ts.map +1 -0
  158. package/{lib → bundles/types}/components/popup.d.ts +1 -0
  159. package/bundles/types/components/popup.d.ts.map +1 -0
  160. package/{lib → bundles/types}/components/storage-dispatcher.d.ts +1 -0
  161. package/bundles/types/components/storage-dispatcher.d.ts.map +1 -0
  162. package/{lib → bundles/types}/components/trigger.d.ts +1 -0
  163. package/bundles/types/components/trigger.d.ts.map +1 -0
  164. package/{lib → bundles/types}/components/vault-display-iframe-event.d.ts +1 -0
  165. package/bundles/types/components/vault-display-iframe-event.d.ts.map +1 -0
  166. package/{lib → bundles/types}/components/wallet-background.d.ts +3 -1
  167. package/bundles/types/components/wallet-background.d.ts.map +1 -0
  168. package/{lib → bundles/types}/components/wallet-trigger.d.ts +1 -0
  169. package/bundles/types/components/wallet-trigger.d.ts.map +1 -0
  170. package/bundles/types/configs/env/environment.cba.d.ts +29 -0
  171. package/bundles/types/configs/env/environment.cba.d.ts.map +1 -0
  172. package/bundles/types/configs/env/environment.interface.d.ts +12 -0
  173. package/bundles/types/configs/env/environment.interface.d.ts.map +1 -0
  174. package/{lib/configs/env/env.d.ts → bundles/types/configs/env/environment.paydock.d.ts} +5 -8
  175. package/bundles/types/configs/env/environment.paydock.d.ts.map +1 -0
  176. package/bundles/types/configs/env/index.d.ts +3 -0
  177. package/bundles/types/configs/env/index.d.ts.map +1 -0
  178. package/{lib → bundles/types}/configs/sdk.d.ts +3 -2
  179. package/bundles/types/configs/sdk.d.ts.map +1 -0
  180. package/{lib → bundles/types}/constants/validators.d.ts +3 -2
  181. package/bundles/types/constants/validators.d.ts.map +1 -0
  182. package/{lib → bundles/types}/external-checkout/builder.d.ts +1 -0
  183. package/bundles/types/external-checkout/builder.d.ts.map +1 -0
  184. package/{lib → bundles/types}/external-checkout/checker.d.ts +1 -0
  185. package/bundles/types/external-checkout/checker.d.ts.map +1 -0
  186. package/bundles/types/external-checkout/index.d.ts +3 -0
  187. package/bundles/types/external-checkout/index.d.ts.map +1 -0
  188. package/{lib → bundles/types}/helper/access-token.d.ts +2 -0
  189. package/bundles/types/helper/access-token.d.ts.map +1 -0
  190. package/{lib → bundles/types}/helper/browser.d.ts +1 -0
  191. package/bundles/types/helper/browser.d.ts.map +1 -0
  192. package/bundles/types/helper/element-id.d.ts +5 -0
  193. package/bundles/types/helper/element-id.d.ts.map +1 -0
  194. package/{lib → bundles/types}/helper/event-emitter.d.ts +2 -0
  195. package/bundles/types/helper/event-emitter.d.ts.map +1 -0
  196. package/{lib → bundles/types}/helper/event.d.ts +1 -0
  197. package/bundles/types/helper/event.d.ts.map +1 -0
  198. package/{lib → bundles/types}/helper/ms.d.ts +1 -0
  199. package/bundles/types/helper/ms.d.ts.map +1 -0
  200. package/{lib → bundles/types}/helper/object.d.ts +1 -0
  201. package/bundles/types/helper/object.d.ts.map +1 -0
  202. package/bundles/types/helper/spiner.util.d.ts +6 -0
  203. package/bundles/types/helper/spiner.util.d.ts.map +1 -0
  204. package/{lib → bundles/types}/helper/url.d.ts +1 -0
  205. package/bundles/types/helper/url.d.ts.map +1 -0
  206. package/{lib → bundles/types}/helper/uuid.d.ts +1 -0
  207. package/bundles/types/helper/uuid.d.ts.map +1 -0
  208. package/bundles/types/helper/widget-logger.d.ts +9 -0
  209. package/bundles/types/helper/widget-logger.d.ts.map +1 -0
  210. package/bundles/types/index-cba.d.ts +17 -0
  211. package/bundles/types/index-cba.d.ts.map +1 -0
  212. package/bundles/types/index.d.ts +18 -0
  213. package/bundles/types/index.d.ts.map +1 -0
  214. package/{lib → bundles/types}/payment-source/builder.d.ts +1 -0
  215. package/bundles/types/payment-source/builder.d.ts.map +1 -0
  216. package/{lib → bundles/types}/payment-source/index.d.ts +1 -0
  217. package/bundles/types/payment-source/index.d.ts.map +1 -0
  218. package/{lib → bundles/types}/payment-source-widget/html-payment-source-widget.d.ts +1 -0
  219. package/bundles/types/payment-source-widget/html-payment-source-widget.d.ts.map +1 -0
  220. package/{lib → bundles/types}/payment-source-widget/index.d.ts +1 -0
  221. package/bundles/types/payment-source-widget/index.d.ts.map +1 -0
  222. package/{lib → bundles/types}/payment-source-widget/interfaces.d.ts +1 -0
  223. package/bundles/types/payment-source-widget/interfaces.d.ts.map +1 -0
  224. package/{lib → bundles/types}/payment-source-widget/payment-source-widget.d.ts +1 -0
  225. package/bundles/types/payment-source-widget/payment-source-widget.d.ts.map +1 -0
  226. package/bundles/types/paypal-data-collector/index.d.ts +23 -0
  227. package/bundles/types/paypal-data-collector/index.d.ts.map +1 -0
  228. package/bundles/types/paypal-data-collector/paypal-data-collector.d.ts +59 -0
  229. package/bundles/types/paypal-data-collector/paypal-data-collector.d.ts.map +1 -0
  230. package/bundles/types/paypal-data-collector/paypal-data-collector.interfaces.d.ts +21 -0
  231. package/bundles/types/paypal-data-collector/paypal-data-collector.interfaces.d.ts.map +1 -0
  232. package/bundles/types/paypal-data-collector/paypal-data-collector.service.d.ts +18 -0
  233. package/bundles/types/paypal-data-collector/paypal-data-collector.service.d.ts.map +1 -0
  234. package/bundles/types/paypal-save-payment-source/index.d.ts +61 -0
  235. package/bundles/types/paypal-save-payment-source/index.d.ts.map +1 -0
  236. package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.d.ts +86 -0
  237. package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.d.ts.map +1 -0
  238. package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.interfaces.d.ts +84 -0
  239. package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.interfaces.d.ts.map +1 -0
  240. package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.service.d.ts +37 -0
  241. package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.service.d.ts.map +1 -0
  242. package/bundles/types/secure-remote-commerce/click-to-pay-secure-remote-commerce.d.ts +31 -0
  243. package/bundles/types/secure-remote-commerce/click-to-pay-secure-remote-commerce.d.ts.map +1 -0
  244. package/bundles/types/secure-remote-commerce/index.d.ts +104 -0
  245. package/bundles/types/secure-remote-commerce/index.d.ts.map +1 -0
  246. package/bundles/types/secure-remote-commerce/interfaces.d.ts +159 -0
  247. package/bundles/types/secure-remote-commerce/interfaces.d.ts.map +1 -0
  248. package/bundles/types/secure-remote-commerce/providers/mastercard-src/index.d.ts +2 -0
  249. package/bundles/types/secure-remote-commerce/providers/mastercard-src/index.d.ts.map +1 -0
  250. package/{lib/secure-remote-commerce/providers/visa-src/visa-src.d.ts → bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts} +5 -7
  251. package/bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts.map +1 -0
  252. package/{lib → bundles/types}/secure-remote-commerce/providers/src-provider.d.ts +1 -0
  253. package/bundles/types/secure-remote-commerce/providers/src-provider.d.ts.map +1 -0
  254. package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts +86 -0
  255. package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts.map +1 -0
  256. package/bundles/types/shared/http/http-request.d.ts +14 -0
  257. package/bundles/types/shared/http/http-request.d.ts.map +1 -0
  258. package/bundles/types/shared/http/index.d.ts +2 -0
  259. package/bundles/types/shared/http/index.d.ts.map +1 -0
  260. package/bundles/types/shared/services/instrumentation/instrumentation.agent.d.ts +15 -0
  261. package/bundles/types/shared/services/instrumentation/instrumentation.agent.d.ts.map +1 -0
  262. package/bundles/types/shared/services/instrumentation/instrumentation.config.d.ts +66 -0
  263. package/bundles/types/shared/services/instrumentation/instrumentation.config.d.ts.map +1 -0
  264. package/bundles/types/shared/services/instrumentation/instrumentation.types.d.ts +14 -0
  265. package/bundles/types/shared/services/instrumentation/instrumentation.types.d.ts.map +1 -0
  266. package/bundles/types/shared/services/instrumentation/repositories/action.repository.d.ts +15 -0
  267. package/bundles/types/shared/services/instrumentation/repositories/action.repository.d.ts.map +1 -0
  268. package/bundles/types/shared/services/instrumentation/repositories/error.repository.d.ts +23 -0
  269. package/bundles/types/shared/services/instrumentation/repositories/error.repository.d.ts.map +1 -0
  270. package/bundles/types/shared/services/instrumentation/repositories/event.repository.d.ts +15 -0
  271. package/bundles/types/shared/services/instrumentation/repositories/event.repository.d.ts.map +1 -0
  272. package/bundles/types/shared/services/instrumentation/repositories/index.d.ts +4 -0
  273. package/bundles/types/shared/services/instrumentation/repositories/index.d.ts.map +1 -0
  274. package/{lib → bundles/types}/vault-display-widget/index.d.ts +1 -0
  275. package/bundles/types/vault-display-widget/index.d.ts.map +1 -0
  276. package/{lib → bundles/types}/vault-display-widget/vault-display-widget.d.ts +1 -0
  277. package/bundles/types/vault-display-widget/vault-display-widget.d.ts.map +1 -0
  278. package/bundles/types/wallet-buttons/helpers/flypay-v2.helper.d.ts +6 -0
  279. package/bundles/types/wallet-buttons/helpers/flypay-v2.helper.d.ts.map +1 -0
  280. package/bundles/types/wallet-buttons/index-cba.d.ts +2 -0
  281. package/bundles/types/wallet-buttons/index-cba.d.ts.map +1 -0
  282. package/{lib → bundles/types}/wallet-buttons/index.d.ts +5 -0
  283. package/bundles/types/wallet-buttons/index.d.ts.map +1 -0
  284. package/{lib → bundles/types}/wallet-buttons/interfaces.d.ts +1 -0
  285. package/bundles/types/wallet-buttons/interfaces.d.ts.map +1 -0
  286. package/{lib → bundles/types}/wallet-buttons/wallet-buttons.d.ts +5 -4
  287. package/bundles/types/wallet-buttons/wallet-buttons.d.ts.map +1 -0
  288. package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts +330 -0
  289. package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts.map +1 -0
  290. package/{lib/wallet-buttons → bundles/types/wallet-buttons/wallet-services}/afterpay.wallet-service.d.ts +2 -1
  291. package/bundles/types/wallet-buttons/wallet-services/afterpay.wallet-service.d.ts.map +1 -0
  292. package/{lib/wallet-buttons → bundles/types/wallet-buttons/wallet-services}/apple.wallet-service.d.ts +4 -3
  293. package/bundles/types/wallet-buttons/wallet-services/apple.wallet-service.d.ts.map +1 -0
  294. package/{lib/wallet-buttons → bundles/types/wallet-buttons/wallet-services}/flypay-v2.wallet-service.d.ts +5 -5
  295. package/bundles/types/wallet-buttons/wallet-services/flypay-v2.wallet-service.d.ts.map +1 -0
  296. package/{lib/wallet-buttons → bundles/types/wallet-buttons/wallet-services}/flypay.wallet-service.d.ts +7 -6
  297. package/bundles/types/wallet-buttons/wallet-services/flypay.wallet-service.d.ts.map +1 -0
  298. package/{lib/wallet-buttons → bundles/types/wallet-buttons/wallet-services}/google.wallet-service.d.ts +5 -4
  299. package/bundles/types/wallet-buttons/wallet-services/google.wallet-service.d.ts.map +1 -0
  300. package/{lib/wallet-buttons → bundles/types/wallet-buttons/wallet-services}/mastercard.wallet-service.d.ts +1 -0
  301. package/bundles/types/wallet-buttons/wallet-services/mastercard.wallet-service.d.ts.map +1 -0
  302. package/{lib/wallet-buttons → bundles/types/wallet-buttons/wallet-services}/paypal.wallet-service.d.ts +2 -1
  303. package/bundles/types/wallet-buttons/wallet-services/paypal.wallet-service.d.ts.map +1 -0
  304. package/{lib/wallet-buttons → bundles/types/wallet-buttons/wallet-services}/stripe.wallet-service.d.ts +2 -1
  305. package/bundles/types/wallet-buttons/wallet-services/stripe.wallet-service.d.ts.map +1 -0
  306. package/{lib/wallet-buttons → bundles/types/wallet-buttons/wallet-services}/wallet-service.d.ts +5 -4
  307. package/bundles/types/wallet-buttons/wallet-services/wallet-service.d.ts.map +1 -0
  308. package/bundles/types/wallet-buttons-express/base.wallet-button-express.d.ts +195 -0
  309. package/bundles/types/wallet-buttons-express/base.wallet-button-express.d.ts.map +1 -0
  310. package/bundles/types/wallet-buttons-express/enum/event.enum.d.ts +10 -0
  311. package/bundles/types/wallet-buttons-express/enum/event.enum.d.ts.map +1 -0
  312. package/bundles/types/wallet-buttons-express/index.d.ts +131 -0
  313. package/bundles/types/wallet-buttons-express/index.d.ts.map +1 -0
  314. package/bundles/types/wallet-buttons-express/interfaces/base-event-data.interface.d.ts +6 -0
  315. package/bundles/types/wallet-buttons-express/interfaces/base-event-data.interface.d.ts.map +1 -0
  316. package/bundles/types/wallet-buttons-express/interfaces/base-gateway-config.interface.d.ts +6 -0
  317. package/bundles/types/wallet-buttons-express/interfaces/base-gateway-config.interface.d.ts.map +1 -0
  318. package/bundles/types/wallet-buttons-express/interfaces/base-wallet-meta.interface.d.ts +5 -0
  319. package/bundles/types/wallet-buttons-express/interfaces/base-wallet-meta.interface.d.ts.map +1 -0
  320. package/bundles/types/wallet-buttons-express/interfaces/charge-wallet-token-meta.interface.d.ts +14 -0
  321. package/bundles/types/wallet-buttons-express/interfaces/charge-wallet-token-meta.interface.d.ts.map +1 -0
  322. package/bundles/types/wallet-buttons-express/interfaces/on-click-event-data.interface.d.ts +6 -0
  323. package/bundles/types/wallet-buttons-express/interfaces/on-click-event-data.interface.d.ts.map +1 -0
  324. package/bundles/types/wallet-buttons-express/interfaces/on-close-event-data.interface.d.ts +6 -0
  325. package/bundles/types/wallet-buttons-express/interfaces/on-close-event-data.interface.d.ts.map +1 -0
  326. package/bundles/types/wallet-buttons-express/interfaces/on-error-event-data.interface.d.ts +6 -0
  327. package/bundles/types/wallet-buttons-express/interfaces/on-error-event-data.interface.d.ts.map +1 -0
  328. package/bundles/types/wallet-buttons-express/interfaces/on-payment-error-event-data.interface.d.ts +9 -0
  329. package/bundles/types/wallet-buttons-express/interfaces/on-payment-error-event-data.interface.d.ts.map +1 -0
  330. package/bundles/types/wallet-buttons-express/interfaces/on-payment-in-review-event-data.interface.d.ts +6 -0
  331. package/bundles/types/wallet-buttons-express/interfaces/on-payment-in-review-event-data.interface.d.ts.map +1 -0
  332. package/bundles/types/wallet-buttons-express/interfaces/on-payment-successful-event-data.interface.d.ts +11 -0
  333. package/bundles/types/wallet-buttons-express/interfaces/on-payment-successful-event-data.interface.d.ts.map +1 -0
  334. package/bundles/types/wallet-buttons-express/interfaces/on-unavailable-event-data.interface.d.ts +6 -0
  335. package/bundles/types/wallet-buttons-express/interfaces/on-unavailable-event-data.interface.d.ts.map +1 -0
  336. package/bundles/types/wallet-buttons-express/interfaces/wallet-capture-request.interface.d.ts +22 -0
  337. package/bundles/types/wallet-buttons-express/interfaces/wallet-capture-request.interface.d.ts.map +1 -0
  338. package/bundles/types/wallet-buttons-express/services/apple-pay/apple-pay.wallet-button-express.d.ts +50 -0
  339. package/bundles/types/wallet-buttons-express/services/apple-pay/apple-pay.wallet-button-express.d.ts.map +1 -0
  340. package/bundles/types/wallet-buttons-express/services/apple-pay/constants/apple-pay-button-style.constant.d.ts +3 -0
  341. package/bundles/types/wallet-buttons-express/services/apple-pay/constants/apple-pay-button-style.constant.d.ts.map +1 -0
  342. package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-gateway-config.interface.d.ts +6 -0
  343. package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-gateway-config.interface.d.ts.map +1 -0
  344. package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts +17 -0
  345. package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts.map +1 -0
  346. package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-button-style.type.d.ts +2 -0
  347. package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-button-style.type.d.ts.map +1 -0
  348. package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-button-type.type.d.ts +2 -0
  349. package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-button-type.type.d.ts.map +1 -0
  350. package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-gateway-config.interface.d.ts +4 -0
  351. package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-gateway-config.interface.d.ts.map +1 -0
  352. package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts +31 -0
  353. package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts.map +1 -0
  354. package/bundles/types/wallet-buttons-express/services/paypal/paypal.wallet-button-express.d.ts +47 -0
  355. package/bundles/types/wallet-buttons-express/services/paypal/paypal.wallet-button-express.d.ts.map +1 -0
  356. package/{lib → bundles/types}/widget/configuration.d.ts +2 -1
  357. package/bundles/types/widget/configuration.d.ts.map +1 -0
  358. package/{lib → bundles/types}/widget/html-multi-widget.d.ts +6 -4
  359. package/bundles/types/widget/html-multi-widget.d.ts.map +1 -0
  360. package/{lib → bundles/types}/widget/html-widget.d.ts +1 -0
  361. package/bundles/types/widget/html-widget.d.ts.map +1 -0
  362. package/{lib → bundles/types}/widget/index.d.ts +2 -1
  363. package/bundles/types/widget/index.d.ts.map +1 -0
  364. package/{lib → bundles/types}/widget/meta.d.ts +1 -0
  365. package/bundles/types/widget/meta.d.ts.map +1 -0
  366. package/{lib → bundles/types}/widget/multi-widget.d.ts +2 -1
  367. package/bundles/types/widget/multi-widget.d.ts.map +1 -0
  368. package/{lib → bundles/types}/widget/style.d.ts +1 -0
  369. package/bundles/types/widget/style.d.ts.map +1 -0
  370. package/bundles/widget.umd.js +33407 -9468
  371. package/bundles/widget.umd.js.d.ts +4021 -0
  372. package/bundles/widget.umd.js.min.d.ts +4021 -0
  373. package/bundles/widget.umd.min.js +61 -1
  374. package/docs/api-canvas3ds.md +158 -0
  375. package/docs/api-checkout-button.md +912 -0
  376. package/docs/api-examples.md +65 -0
  377. package/docs/api-ps-widget.md +585 -0
  378. package/docs/api-vault-display.md +94 -0
  379. package/docs/api-widget.md +2499 -0
  380. package/docs/api-wrapper.md +78 -0
  381. package/docs/canvas3ds-examples.md +242 -0
  382. package/docs/cba-header.md +13 -0
  383. package/docs/cba-license.md +2 -0
  384. package/docs/checkout-examples.md +248 -0
  385. package/docs/click-to-pay-examples.md +267 -0
  386. package/docs/click-to-pay.md +339 -0
  387. package/docs/header.md +15 -0
  388. package/docs/html/layout.html +79 -0
  389. package/docs/html/marked.js +23 -0
  390. package/docs/html/style.css +365 -0
  391. package/docs/install/npm.content.md +16 -0
  392. package/docs/install/npm.example.md +24 -0
  393. package/docs/install/umd.content.md +20 -0
  394. package/docs/install/umd.example.md +6 -0
  395. package/docs/install.md +43 -0
  396. package/docs/install.readme.t.md +17 -0
  397. package/docs/install.slate.t.md +17 -0
  398. package/docs/license.md +2 -0
  399. package/docs/partials/header.hbs +3 -0
  400. package/docs/paypal-data-collector-examples.md +58 -0
  401. package/docs/paypal-data-collector.md +149 -0
  402. package/docs/paypal-save-payment-source-examples.md +63 -0
  403. package/docs/paypal-save-payment-source.md +256 -0
  404. package/docs/ps-examples.md +129 -0
  405. package/docs/vault-display-example.md +132 -0
  406. package/docs/wallet-buttons-examples.md +636 -0
  407. package/docs/wallet-buttons-express-examples.md +201 -0
  408. package/docs/wallet-buttons-express.md +786 -0
  409. package/docs/wallet-buttons.md +622 -0
  410. package/docs/wallet-cba-buttons-examples.md +388 -0
  411. package/docs/widget-examples.md +134 -0
  412. package/examples/multi-html-widget/simple.html +2 -1
  413. package/package.json +208 -80
  414. package/slate.md +227 -191
  415. package/.nvmrc +0 -1
  416. package/api.d.ts +0 -1
  417. package/api.js +0 -1
  418. package/canvas3ds.d.ts +0 -1
  419. package/canvas3ds.js +0 -1
  420. package/checkout-button.d.ts +0 -1
  421. package/checkout-button.js +0 -1
  422. package/inicialization-guide.md +0 -7
  423. package/lib/api/api-base.d.ts +0 -40
  424. package/lib/api/api-base.js +0 -101
  425. package/lib/api/api-base.js.map +0 -1
  426. package/lib/api/api-charge-internal.js +0 -30
  427. package/lib/api/api-charge-internal.js.map +0 -1
  428. package/lib/api/api-charge.js +0 -49
  429. package/lib/api/api-charge.js.map +0 -1
  430. package/lib/api/api-internal.js +0 -13
  431. package/lib/api/api-internal.js.map +0 -1
  432. package/lib/api/api-service-internal.js +0 -18
  433. package/lib/api/api-service-internal.js.map +0 -1
  434. package/lib/api/api.js +0 -62
  435. package/lib/api/api.js.map +0 -1
  436. package/lib/api/index.d.ts +0 -1
  437. package/lib/api/index.js +0 -2
  438. package/lib/api/index.js.map +0 -1
  439. package/lib/canvas-3ds/canvas-3ds.js +0 -157
  440. package/lib/canvas-3ds/canvas-3ds.js.map +0 -1
  441. package/lib/canvas-3ds/index.js +0 -2
  442. package/lib/canvas-3ds/index.js.map +0 -1
  443. package/lib/canvas-3ds/services/gpayments-service.js +0 -181
  444. package/lib/canvas-3ds/services/gpayments-service.js.map +0 -1
  445. package/lib/canvas-3ds/services/index.js +0 -2
  446. package/lib/canvas-3ds/services/index.js.map +0 -1
  447. package/lib/canvas-3ds/services/standalone3ds-service.js +0 -32
  448. package/lib/canvas-3ds/services/standalone3ds-service.js.map +0 -1
  449. package/lib/checkout-button/afterpay/afterpay-checkout-button.js +0 -50
  450. package/lib/checkout-button/afterpay/afterpay-checkout-button.js.map +0 -1
  451. package/lib/checkout-button/afterpay/afterpay.runner.js +0 -41
  452. package/lib/checkout-button/afterpay/afterpay.runner.js.map +0 -1
  453. package/lib/checkout-button/checkout-button.interface.js +0 -45
  454. package/lib/checkout-button/checkout-button.interface.js.map +0 -1
  455. package/lib/checkout-button/checkout-button.js +0 -266
  456. package/lib/checkout-button/checkout-button.js.map +0 -1
  457. package/lib/checkout-button/checkout-contextual-handler.js +0 -75
  458. package/lib/checkout-button/checkout-contextual-handler.js.map +0 -1
  459. package/lib/checkout-button/index.js +0 -85
  460. package/lib/checkout-button/index.js.map +0 -1
  461. package/lib/checkout-button/paypal/paypal-checkout-button.js +0 -25
  462. package/lib/checkout-button/paypal/paypal-checkout-button.js.map +0 -1
  463. package/lib/checkout-button/paypal/paypal.runner.js +0 -14
  464. package/lib/checkout-button/paypal/paypal.runner.js.map +0 -1
  465. package/lib/checkout-button/runner/base.runner.js +0 -13
  466. package/lib/checkout-button/runner/base.runner.js.map +0 -1
  467. package/lib/checkout-button/runner/contextual.runner.js +0 -40
  468. package/lib/checkout-button/runner/contextual.runner.js.map +0 -1
  469. package/lib/checkout-button/runner/index.js +0 -11
  470. package/lib/checkout-button/runner/index.js.map +0 -1
  471. package/lib/checkout-button/runner/popup.runner.js +0 -68
  472. package/lib/checkout-button/runner/popup.runner.js.map +0 -1
  473. package/lib/checkout-button/runner/redirect.runner.js +0 -15
  474. package/lib/checkout-button/runner/redirect.runner.js.map +0 -1
  475. package/lib/checkout-button/zipmoney/zipmoney-checkout-button.js +0 -64
  476. package/lib/checkout-button/zipmoney/zipmoney-checkout-button.js.map +0 -1
  477. package/lib/checkout-button/zipmoney/zipmoney-contextual.runner.js +0 -78
  478. package/lib/checkout-button/zipmoney/zipmoney-contextual.runner.js.map +0 -1
  479. package/lib/checkout-button/zipmoney/zipmoney-redirect.runner.js +0 -49
  480. package/lib/checkout-button/zipmoney/zipmoney-redirect.runner.js.map +0 -1
  481. package/lib/checkout-button/zipmoney/zipmoney.config.js +0 -4
  482. package/lib/checkout-button/zipmoney/zipmoney.config.js.map +0 -1
  483. package/lib/checkout-button/zipmoney/zipmoney.runner.js +0 -23
  484. package/lib/checkout-button/zipmoney/zipmoney.runner.js.map +0 -1
  485. package/lib/checkout-button/zipmoney/zipmoney.types.js +0 -1
  486. package/lib/checkout-button/zipmoney/zipmoney.types.js.map +0 -1
  487. package/lib/components/ability-guard.js +0 -44
  488. package/lib/components/ability-guard.js.map +0 -1
  489. package/lib/components/background.js +0 -193
  490. package/lib/components/background.js.map +0 -1
  491. package/lib/components/container.js +0 -63
  492. package/lib/components/container.js.map +0 -1
  493. package/lib/components/dispatcher.js +0 -39
  494. package/lib/components/dispatcher.js.map +0 -1
  495. package/lib/components/element-style.js +0 -52
  496. package/lib/components/element-style.js.map +0 -1
  497. package/lib/components/flypay-iframe-event.js +0 -28
  498. package/lib/components/flypay-iframe-event.js.map +0 -1
  499. package/lib/components/form-Interceptor.js +0 -38
  500. package/lib/components/form-Interceptor.js.map +0 -1
  501. package/lib/components/http-core.js +0 -57
  502. package/lib/components/http-core.js.map +0 -1
  503. package/lib/components/iframe-event.js +0 -75
  504. package/lib/components/iframe-event.js.map +0 -1
  505. package/lib/components/iframe.js +0 -62
  506. package/lib/components/iframe.js.map +0 -1
  507. package/lib/components/link.js +0 -59
  508. package/lib/components/link.js.map +0 -1
  509. package/lib/components/loader.js +0 -234
  510. package/lib/components/loader.js.map +0 -1
  511. package/lib/components/param.js +0 -147
  512. package/lib/components/param.js.map +0 -1
  513. package/lib/components/popup.js +0 -104
  514. package/lib/components/popup.js.map +0 -1
  515. package/lib/components/storage-dispatcher.js +0 -75
  516. package/lib/components/storage-dispatcher.js.map +0 -1
  517. package/lib/components/trigger.js +0 -49
  518. package/lib/components/trigger.js.map +0 -1
  519. package/lib/components/vault-display-iframe-event.js +0 -27
  520. package/lib/components/vault-display-iframe-event.js.map +0 -1
  521. package/lib/components/wallet-background.js +0 -63
  522. package/lib/components/wallet-background.js.map +0 -1
  523. package/lib/components/wallet-trigger.js +0 -27
  524. package/lib/components/wallet-trigger.js.map +0 -1
  525. package/lib/configs/env/env.js +0 -117
  526. package/lib/configs/env/env.js.map +0 -1
  527. package/lib/configs/sdk.js +0 -16
  528. package/lib/configs/sdk.js.map +0 -1
  529. package/lib/constants/validators.js +0 -42
  530. package/lib/constants/validators.js.map +0 -1
  531. package/lib/external-checkout/builder.js +0 -45
  532. package/lib/external-checkout/builder.js.map +0 -1
  533. package/lib/external-checkout/checker.js +0 -22
  534. package/lib/external-checkout/checker.js.map +0 -1
  535. package/lib/external-checkout/index.d.ts +0 -2
  536. package/lib/external-checkout/index.js +0 -3
  537. package/lib/external-checkout/index.js.map +0 -1
  538. package/lib/helper/access-token.js +0 -44
  539. package/lib/helper/access-token.js.map +0 -1
  540. package/lib/helper/browser.js +0 -79
  541. package/lib/helper/browser.js.map +0 -1
  542. package/lib/helper/event-emitter.js +0 -23
  543. package/lib/helper/event-emitter.js.map +0 -1
  544. package/lib/helper/event.js +0 -23
  545. package/lib/helper/event.js.map +0 -1
  546. package/lib/helper/ms.js +0 -32
  547. package/lib/helper/ms.js.map +0 -1
  548. package/lib/helper/object.js +0 -6
  549. package/lib/helper/object.js.map +0 -1
  550. package/lib/helper/url.js +0 -11
  551. package/lib/helper/url.js.map +0 -1
  552. package/lib/helper/uuid.js +0 -26
  553. package/lib/helper/uuid.js.map +0 -1
  554. package/lib/index.d.ts +0 -15
  555. package/lib/index.js +0 -15
  556. package/lib/index.js.map +0 -1
  557. package/lib/payment-source/builder.js +0 -49
  558. package/lib/payment-source/builder.js.map +0 -1
  559. package/lib/payment-source/index.js +0 -2
  560. package/lib/payment-source/index.js.map +0 -1
  561. package/lib/payment-source-widget/html-payment-source-widget.js +0 -172
  562. package/lib/payment-source-widget/html-payment-source-widget.js.map +0 -1
  563. package/lib/payment-source-widget/index.js +0 -35
  564. package/lib/payment-source-widget/index.js.map +0 -1
  565. package/lib/payment-source-widget/interfaces.js +0 -2
  566. package/lib/payment-source-widget/interfaces.js.map +0 -1
  567. package/lib/payment-source-widget/payment-source-widget.js +0 -142
  568. package/lib/payment-source-widget/payment-source-widget.js.map +0 -1
  569. package/lib/secure-remote-commerce/index.d.ts +0 -1
  570. package/lib/secure-remote-commerce/index.js +0 -2
  571. package/lib/secure-remote-commerce/index.js.map +0 -1
  572. package/lib/secure-remote-commerce/interfaces.d.ts +0 -71
  573. package/lib/secure-remote-commerce/interfaces.js +0 -28
  574. package/lib/secure-remote-commerce/interfaces.js.map +0 -1
  575. package/lib/secure-remote-commerce/providers/src-provider.js +0 -1
  576. package/lib/secure-remote-commerce/providers/src-provider.js.map +0 -1
  577. package/lib/secure-remote-commerce/providers/visa-src/helper.d.ts +0 -7
  578. package/lib/secure-remote-commerce/providers/visa-src/helper.js +0 -36
  579. package/lib/secure-remote-commerce/providers/visa-src/helper.js.map +0 -1
  580. package/lib/secure-remote-commerce/providers/visa-src/index.d.ts +0 -1
  581. package/lib/secure-remote-commerce/providers/visa-src/index.js +0 -2
  582. package/lib/secure-remote-commerce/providers/visa-src/index.js.map +0 -1
  583. package/lib/secure-remote-commerce/providers/visa-src/visa-src.js +0 -113
  584. package/lib/secure-remote-commerce/providers/visa-src/visa-src.js.map +0 -1
  585. package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.d.ts +0 -8
  586. package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.js +0 -10
  587. package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.js.map +0 -1
  588. package/lib/secure-remote-commerce/secure-remote-commerce.d.ts +0 -163
  589. package/lib/secure-remote-commerce/secure-remote-commerce.js +0 -239
  590. package/lib/secure-remote-commerce/secure-remote-commerce.js.map +0 -1
  591. package/lib/vault-display-widget/index.js +0 -14
  592. package/lib/vault-display-widget/index.js.map +0 -1
  593. package/lib/vault-display-widget/vault-display-widget.js +0 -99
  594. package/lib/vault-display-widget/vault-display-widget.js.map +0 -1
  595. package/lib/wallet-buttons/afterpay.wallet-service.js +0 -152
  596. package/lib/wallet-buttons/afterpay.wallet-service.js.map +0 -1
  597. package/lib/wallet-buttons/apple.wallet-service.js +0 -324
  598. package/lib/wallet-buttons/apple.wallet-service.js.map +0 -1
  599. package/lib/wallet-buttons/flypay-v2.wallet-service.js +0 -165
  600. package/lib/wallet-buttons/flypay-v2.wallet-service.js.map +0 -1
  601. package/lib/wallet-buttons/flypay.wallet-service.js +0 -117
  602. package/lib/wallet-buttons/flypay.wallet-service.js.map +0 -1
  603. package/lib/wallet-buttons/google.wallet-service.js +0 -301
  604. package/lib/wallet-buttons/google.wallet-service.js.map +0 -1
  605. package/lib/wallet-buttons/helpers/flypay-v2.helper.d.ts +0 -3
  606. package/lib/wallet-buttons/helpers/flypay-v2.helper.js +0 -151
  607. package/lib/wallet-buttons/helpers/flypay-v2.helper.js.map +0 -1
  608. package/lib/wallet-buttons/index.js +0 -128
  609. package/lib/wallet-buttons/index.js.map +0 -1
  610. package/lib/wallet-buttons/interfaces.js +0 -1
  611. package/lib/wallet-buttons/interfaces.js.map +0 -1
  612. package/lib/wallet-buttons/mastercard.wallet-service.js +0 -27
  613. package/lib/wallet-buttons/mastercard.wallet-service.js.map +0 -1
  614. package/lib/wallet-buttons/paypal.wallet-service.js +0 -144
  615. package/lib/wallet-buttons/paypal.wallet-service.js.map +0 -1
  616. package/lib/wallet-buttons/stripe.wallet-service.js +0 -100
  617. package/lib/wallet-buttons/stripe.wallet-service.js.map +0 -1
  618. package/lib/wallet-buttons/wallet-buttons.js +0 -479
  619. package/lib/wallet-buttons/wallet-buttons.js.map +0 -1
  620. package/lib/wallet-buttons/wallet-service.js +0 -60
  621. package/lib/wallet-buttons/wallet-service.js.map +0 -1
  622. package/lib/widget/configuration.js +0 -260
  623. package/lib/widget/configuration.js.map +0 -1
  624. package/lib/widget/html-multi-widget.js +0 -422
  625. package/lib/widget/html-multi-widget.js.map +0 -1
  626. package/lib/widget/html-widget.js +0 -127
  627. package/lib/widget/html-widget.js.map +0 -1
  628. package/lib/widget/index.js +0 -132
  629. package/lib/widget/index.js.map +0 -1
  630. package/lib/widget/meta.js +0 -8
  631. package/lib/widget/meta.js.map +0 -1
  632. package/lib/widget/multi-widget.js +0 -437
  633. package/lib/widget/multi-widget.js.map +0 -1
  634. package/lib/widget/style.js +0 -204
  635. package/lib/widget/style.js.map +0 -1
  636. package/payment-source-widget.d.ts +0 -1
  637. package/payment-source-widget.js +0 -1
  638. package/tslint.json +0 -129
  639. package/typings/globals/@auspayplus/open-payments-checkout/index.d.ts +0 -43
  640. package/typings/globals/jasmine/index.d.ts +0 -576
  641. package/typings/globals/jasmine-ajax/index.d.ts +0 -83
  642. package/typings/globals/jquery/index.d.ts +0 -3759
  643. package/typings/index.d.ts +0 -4
  644. package/vault-display-widget.d.ts +0 -1
  645. package/vault-display-widget.js +0 -1
  646. package/vendors/zipmoney.d.ts +0 -18
  647. package/vendors/zipmoney.js +0 -2
  648. package/widget.d.ts +0 -1
  649. package/widget.js +0 -1
@@ -0,0 +1,4021 @@
1
+ import { Observable, Subscriber } from 'rxjs';
2
+ import { MicroAgent } from '@newrelic/browser-agent/loaders/micro-agent';
3
+
4
+ declare class ApiCharge {
5
+ protected api: Api;
6
+ constructor(api: Api);
7
+ /**
8
+ * Current method allows to work with charge related endpoints
9
+ *
10
+ * @example
11
+ * api.charge().preAuth('payload', cb);
12
+ *
13
+ * @param {object} payload - Payload for pre authorization.
14
+ * @param {number} payload.amount - Charge amount.
15
+ * @param {string} payload.currency - Charge currency.
16
+ * @param {string} payload.token - Payment source token.
17
+ * @param {string} [payload._3ds.redirect_url] - Redirect url after 3d secure processing.
18
+ * @param {listener} [cb]
19
+ */
20
+ preAuth(payload: PreAuthBody, cb?: (data: any) => void): void | Promise<PreAuthResponse>;
21
+ }
22
+ interface PreAuthResponse {
23
+ _3ds: {
24
+ token: string;
25
+ id: string;
26
+ };
27
+ status: string;
28
+ }
29
+ interface PreAuthBody {
30
+ token: string;
31
+ amount: string | number;
32
+ currency: string;
33
+ _3ds?: {
34
+ redirect_url?: string;
35
+ };
36
+ }
37
+
38
+ declare type Configs = IConf[];
39
+ interface IConf {
40
+ env: string;
41
+ url: string;
42
+ }
43
+ interface IEnvironment {
44
+ getConf(): IConf;
45
+ getEnv(): string;
46
+ setEnv(env: string, alias?: string): void;
47
+ }
48
+
49
+ declare class Env implements IEnvironment {
50
+ private alias;
51
+ private configs;
52
+ private env;
53
+ constructor(configs: Configs, defaultEnv?: string);
54
+ setEnv(env: string, alias?: string): void;
55
+ getEnv(): string;
56
+ getConf(): IConf;
57
+ private isValidMode;
58
+ }
59
+
60
+ type HttpRequestMethod = 'DELETE' | 'GET' | 'OPTIONS' | 'POST' | 'PUT';
61
+
62
+ type AgentPrototype = Pick<(typeof MicroAgent)['prototype'], 'addPageAction' | 'noticeError'>;
63
+ type AgentMethodNames = keyof AgentPrototype;
64
+ type AgentMethodParameters<T extends AgentMethodNames> = Parameters<AgentPrototype[T]>;
65
+ declare class InstrumentationAgent extends MicroAgent {
66
+ private static agent;
67
+ private static available;
68
+ private static initialized;
69
+ private constructor();
70
+ static get instance(): InstrumentationAgent;
71
+ isAvailable(): boolean;
72
+ call: <T extends "addPageAction" | "noticeError">(method: T, ...args: AgentMethodParameters<T>) => void;
73
+ }
74
+
75
+ interface CustomEventDTO {
76
+ environment: string;
77
+ appId?: never;
78
+ timestamp?: never;
79
+ [x: string]: unknown;
80
+ }
81
+ interface ReportBaseContext {
82
+ environment: string;
83
+ sdkVersion: string | null;
84
+ description?: string;
85
+ [x: string]: SerializableValue | undefined;
86
+ }
87
+ type SerializableValue = string | number | symbol | object | null;
88
+
89
+ type ReportErrorFn = (repository: ErrorRepository, error: string | Error, ctx: ReportBaseContext & ({
90
+ className: string;
91
+ classMethod: string;
92
+ functionName?: never;
93
+ } | {
94
+ className?: never;
95
+ classMethod?: never;
96
+ functionName: string;
97
+ })) => void;
98
+ declare class ErrorRepository {
99
+ private readonly agent;
100
+ constructor();
101
+ createError(...args: Parameters<InstrumentationAgent['noticeError']>): Promise<void>;
102
+ }
103
+
104
+ type ReportEventFn = (repository: EventRepository, actionName: string, ctx: ReportBaseContext & CustomEventDTO) => void;
105
+ declare class EventRepository {
106
+ private readonly agent;
107
+ constructor();
108
+ createEvent(...args: Parameters<InstrumentationAgent['addPageAction']>): Promise<void>;
109
+ }
110
+
111
+ declare enum API_AUTH_TYPE {
112
+ PUBLIC_KEY = 0,
113
+ TOKEN = 1
114
+ }
115
+ declare class ApiBase {
116
+ protected env: Env;
117
+ auth: string;
118
+ authType: API_AUTH_TYPE;
119
+ private stoppedPooling;
120
+ constructor(auth: string, authType?: API_AUTH_TYPE);
121
+ /**
122
+ * Current method can change environment. By default environment = sandbox.
123
+ * Also we can change domain alias for this environment. By default domain_alias = paydock.com
124
+ *
125
+ * @example
126
+ * widget.setEnv('production');
127
+ * @param {string} env - sandbox, production
128
+ * @param {string} [alias] - Own domain alias
129
+ */
130
+ setEnv(env: string, alias?: string): ApiBase;
131
+ longPollingObservable<Req extends object, Res>(method: 'GET' | 'POST', url: string, requestBody: Req, sessionId: string, reconnectInterval?: number): Observable<Res>;
132
+ longPull(subscriber: Subscriber<any>, method: any, link: any, auth: any, requestBody: any, sessionId: any, reconnectInterval: any): void;
133
+ destroyLongPolling(): void;
134
+ setAuthType(): API_AUTH_TYPE;
135
+ getClient(method: Extract<HttpRequestMethod, 'GET' | 'POST'>, link: string): {
136
+ config: XMLHttpRequest;
137
+ send: (body: any, cb?: (data) => void, errorCb?: (data: any) => any) => void;
138
+ };
139
+ getClientPromise<Req extends object, Res>(method: Extract<HttpRequestMethod, 'GET' | 'POST'>, link: string): {
140
+ config: XMLHttpRequest;
141
+ send: (body: Req) => Promise<Res>;
142
+ };
143
+ parser({ text, status }: {
144
+ text: string;
145
+ status: number;
146
+ }, cb: any, errorCb: any): any;
147
+ parserPromise<Res>({ text, status }: {
148
+ text: string;
149
+ status: number;
150
+ }): Promise<Res>;
151
+ reportEvent: ReportEventFn;
152
+ reportError: ReportErrorFn;
153
+ protected newApiRequest(method: Extract<HttpRequestMethod, 'GET' | 'POST'>, link: string): XMLHttpRequest;
154
+ protected get ctx(): {
155
+ sdkVersion: string;
156
+ className: string;
157
+ environment: string;
158
+ };
159
+ }
160
+
161
+ interface BrowserDetails {
162
+ name: string;
163
+ java_enabled: string;
164
+ language: string;
165
+ screen_height: string;
166
+ screen_width: string;
167
+ time_zone: string;
168
+ color_depth: string;
169
+ }
170
+ /**
171
+ * Interface for browser details response.
172
+ * @interface BrowserDetails
173
+ *
174
+ * @param {string} [name]
175
+ * @param {string} [java_enabled]
176
+ * @param {string} [language]
177
+ * @param {string} [screen_height]
178
+ * @param {string} [screen_width]
179
+ * @param {string} [time_zone]
180
+ * @param {string} [color_depth]
181
+ * */
182
+ /**
183
+ * Class Api include method for working with paydock api
184
+ * @constructor
185
+ *
186
+ * @param {string} publicKey - PayDock users public key
187
+ * @example
188
+ * var api = new Api('publicKey');
189
+ *
190
+ *
191
+ **/
192
+ declare class Api extends ApiBase {
193
+ publicKey: String;
194
+ /** @constructs */ constructor(publicKey: string);
195
+ /**
196
+ * Method for getting browser details
197
+ *
198
+ * @example
199
+ * api.getBrowserDetails();
200
+ *
201
+ * @return {BrowserDetails} Browser details object
202
+ */
203
+ getBrowserDetails(): BrowserDetails;
204
+ /**
205
+ * Current method allows to work with charge related endpoints
206
+ *
207
+ * @example
208
+ * api.charge();
209
+ */
210
+ charge(): ApiCharge;
211
+ }
212
+
213
+ /**
214
+ * List of available form field validators dedicated to cards and their definition
215
+ *
216
+ * @const CARD_VALIDATORS
217
+ *
218
+ * @type {Record<string, string>}
219
+ *
220
+ * @param {string} CVV=cardCvvValidation
221
+ * Asserts that CVV contains zero or more digits and is a number
222
+ * @param {string} EXPIRY_DATE=expireDateValidation
223
+ * Asserts value is a date in the future with format MM/YY
224
+ * @param {string} HOLDER_NAME=cardHoldernameValidation
225
+ * Asserts value is a name that respects the
226
+ ITU-T T.50 standard (@see https://www.itu.int/rec/T-REC-T.50/en)
227
+ * @param {string} NUMBER=cardNumberValidation
228
+ Asserts the value matches a known card scheme and as a the correct length.
229
+ E.g., matches a 13, 16 or 19 digit bank card, **or**, a 13 to 25 digit Vii Gift card
230
+ * @param {string} PIN=cardPinValidation
231
+ Asserts the value is a number with exactly 4 digits
232
+ */
233
+ declare const CARD_VALIDATORS: {
234
+ readonly CVV: "cardCvvValidator";
235
+ readonly EXPIRY_DATE: "expireDateValidation";
236
+ readonly HOLDER_NAME: "cardHoldernameValidator";
237
+ readonly NUMBER: "cardNumberValidator";
238
+ readonly PIN: "cardPinValidator";
239
+ };
240
+ type CardValidatorValue = typeof CARD_VALIDATORS[keyof typeof CARD_VALIDATORS];
241
+ /**
242
+ * List of available generic form field validators and their definition
243
+ *
244
+ * @const GENERIC_VALIDATORS
245
+ *
246
+ * @type {Record<string, string>}
247
+ *
248
+ * @param {string} REQUIRED=required
249
+ * Asserts the input or form field has a value defined truthy value
250
+ */
251
+ declare const GENERIC_VALIDATORS: {
252
+ readonly REQUIRED: "required";
253
+ };
254
+ type GenericValidatorValue = typeof GENERIC_VALIDATORS[keyof typeof GENERIC_VALIDATORS];
255
+
256
+ declare const FORM_FIELD: {
257
+ CARD_NAME: string;
258
+ CARD_NUMBER: string;
259
+ EXPIRE_MONTH: string;
260
+ EXPIRE_YEAR: string;
261
+ CARD_CCV: string;
262
+ CARD_PIN: string;
263
+ ACCOUNT_NAME: string;
264
+ ACCOUNT_BSB: string;
265
+ ACCOUNT_NUMBER: string;
266
+ ACCOUNT_ROUTING: string;
267
+ ACCOUNT_HOLDER_TYPE: string;
268
+ ACCOUNT_BANK_NAME: string;
269
+ ACCOUNT_TYPE: string;
270
+ FIRST_NAME: string;
271
+ LAST_NAME: string;
272
+ EMAIL: string;
273
+ PHONE: string;
274
+ PHONE2: string;
275
+ ADDRESS_LINE1: string;
276
+ ADDRESS_LINE2: string;
277
+ ADDRESS_STATE: string;
278
+ ADDRESS_COUNTRY: string;
279
+ ADDRESS_CITY: string;
280
+ ADDRESS_POSTCODE: string;
281
+ ADDRESS_COMPANY: string;
282
+ };
283
+ declare const STYLE: {
284
+ BACKGROUND_COLOR: string;
285
+ BACKGROUND_ACTIVE_COLOR: string;
286
+ TEXT_COLOR: string;
287
+ BORDER_COLOR: string;
288
+ ICON_SIZE: string;
289
+ BUTTON_COLOR: string;
290
+ ERROR_COLOR: string;
291
+ SUCCESS_COLOR: string;
292
+ FONT_SIZE: string;
293
+ FONT_FAMILY: string;
294
+ };
295
+ declare const VAULT_DISPLAY_STYLE: {
296
+ BACKGROUND_COLOR: string;
297
+ TEXT_COLOR: string;
298
+ BORDER_COLOR: string;
299
+ BUTTON_COLOR: string;
300
+ FONT_SIZE: string;
301
+ FONT_FAMILY: string;
302
+ };
303
+ declare const TEXT: {
304
+ TITLE: string;
305
+ TITLE_H1: string;
306
+ TITLE_H2: string;
307
+ TITLE_H3: string;
308
+ TITLE_H4: string;
309
+ TITLE_H5: string;
310
+ TITLE_H6: string;
311
+ FINISH: string;
312
+ TITLE_DESCRIPTION: string;
313
+ SUBMIT_BUTTON: string;
314
+ SUBMIT_BUTTON_PROCESSING: string;
315
+ };
316
+ declare const ELEMENT: {
317
+ SUBMIT_BUTTON: string;
318
+ TABS: string;
319
+ };
320
+ declare const SUPPORTED_CARD_TYPES: {
321
+ AMEX: string;
322
+ AUSBC: string;
323
+ DINERS: string;
324
+ DISCOVER: string;
325
+ JAPCB: string;
326
+ LASER: string;
327
+ MASTERCARD: string;
328
+ SOLO: string;
329
+ VISA: string;
330
+ VISA_WHITE: string;
331
+ };
332
+ interface IIcons {
333
+ paypal_checkout_button?: string;
334
+ afterpay_checkout_button?: string;
335
+ zipmoney_checkout_button?: string;
336
+ }
337
+ interface IFormPropertyOption {
338
+ card_name?: string;
339
+ card_number?: string;
340
+ expire_month?: string;
341
+ expire_year?: string;
342
+ card_ccv?: string;
343
+ card_pin?: string;
344
+ account_name?: string;
345
+ account_bsb?: string;
346
+ account_number?: string;
347
+ account_routing?: string;
348
+ account_holder_type?: string;
349
+ account_bank_name?: string;
350
+ first_name?: string;
351
+ last_name?: string;
352
+ email?: string;
353
+ phone?: string;
354
+ phone2?: string;
355
+ address_line1?: string;
356
+ address_line2?: string;
357
+ address_state?: string;
358
+ address_country?: string;
359
+ address_city?: string;
360
+ address_postcode?: string;
361
+ address_company?: string;
362
+ }
363
+ interface IFormValues extends IFormPropertyOption {
364
+ }
365
+ interface IFormLabels extends IFormPropertyOption {
366
+ }
367
+ interface IFormPlaceholders extends IFormPropertyOption {
368
+ }
369
+ interface IFormElement {
370
+ field: string;
371
+ label?: string;
372
+ placeholder?: string;
373
+ value?: string;
374
+ }
375
+ type ValidatorFieldsMapKey = CardValidatorValue | GenericValidatorValue;
376
+ type ValidatorFieldsMap = Partial<Record<ValidatorFieldsMapKey, string[]>>;
377
+ interface IFormValidation {
378
+ form_valid?: boolean;
379
+ invalid_fields?: string[];
380
+ invalid_showed_fields?: string[];
381
+ validators?: ValidatorFieldsMap;
382
+ }
383
+ interface IStyles$1 {
384
+ background_color?: string;
385
+ background_active_color?: string;
386
+ text_color?: string;
387
+ border_color?: string;
388
+ button_color?: string;
389
+ icon_size?: string;
390
+ error_color?: string;
391
+ success_color?: string;
392
+ font_size?: string;
393
+ font_family?: string;
394
+ }
395
+ interface ITexts {
396
+ title?: string;
397
+ title_h1?: string;
398
+ title_h2?: string;
399
+ title_h3?: string;
400
+ title_h4?: string;
401
+ title_h5?: string;
402
+ title_h6?: string;
403
+ finish_text?: string;
404
+ title_description?: string;
405
+ submit_button?: string;
406
+ submit_button_processing?: string;
407
+ }
408
+ interface ICommonParams {
409
+ sdk_version?: string;
410
+ sdk_type?: string;
411
+ }
412
+ interface ISRCParams extends ICommonParams {
413
+ public_key?: string;
414
+ service_id?: string;
415
+ meta?: string;
416
+ }
417
+ interface IWalletParams extends IStyles$1, ITexts, ICommonParams {
418
+ token: string;
419
+ credentials: string;
420
+ currency: string;
421
+ amount: number;
422
+ gateway_mode: string;
423
+ }
424
+ interface IParams extends IStyles$1, ITexts, ICommonParams {
425
+ access_token?: string;
426
+ public_key?: string;
427
+ token?: string;
428
+ configuration_token?: string;
429
+ configuration_tokens?: string;
430
+ ref_id?: string;
431
+ supported_card_types?: string;
432
+ validate_card_types?: boolean;
433
+ fields_validation?: boolean;
434
+ hidden_elements?: string;
435
+ icons?: string;
436
+ form_values?: string;
437
+ form_labels?: string;
438
+ form_placeholders?: string;
439
+ query_token?: string;
440
+ limit?: number;
441
+ widget_id?: string;
442
+ gateway_id?: string;
443
+ gateway_ids?: string;
444
+ payment_source_types?: string;
445
+ element_styles?: string;
446
+ use_country_phone_mask?: boolean;
447
+ phone_mask_preferred_countries?: string;
448
+ phone_mask_default_country?: string;
449
+ phone_mask_only_countries?: string;
450
+ language?: string;
451
+ vault_display_token?: string;
452
+ }
453
+ interface ICountryPhoneMask {
454
+ preferred_countries?: string[];
455
+ default_country?: string;
456
+ only_countries?: string[];
457
+ }
458
+ interface IPayPalMeta {
459
+ brand_name?: string;
460
+ cart_border_color?: string;
461
+ reference?: string;
462
+ email?: string;
463
+ hdr_img?: string;
464
+ logo_img?: string;
465
+ pay_flow_color?: string;
466
+ first_name?: string;
467
+ last_name?: string;
468
+ address_line?: string;
469
+ address_line2?: string;
470
+ address_city?: string;
471
+ address_state?: string;
472
+ address_postcode?: string;
473
+ address_country?: string;
474
+ phone?: string;
475
+ hide_shipping_address?: boolean;
476
+ }
477
+ interface IBamboraMeta {
478
+ customer_storage_number?: string;
479
+ tokenise_algorithm?: number;
480
+ }
481
+ interface IZipmoneyMeta {
482
+ first_name: string;
483
+ last_name: string;
484
+ phone?: string;
485
+ tokenize?: boolean;
486
+ email: string;
487
+ gender?: string;
488
+ date_of_birth?: string;
489
+ charge: {
490
+ amount: number;
491
+ currency?: string;
492
+ reference?: string;
493
+ shipping_type?: string;
494
+ items: Array<{
495
+ name: string;
496
+ amount: number;
497
+ quantity: number;
498
+ type?: string;
499
+ reference?: string;
500
+ item_uri?: string;
501
+ image_url?: string;
502
+ }>;
503
+ shipping_address?: {
504
+ first_name?: string;
505
+ last_name?: string;
506
+ line1: string;
507
+ line2?: string;
508
+ country: string;
509
+ postcode: string;
510
+ city: string;
511
+ state: string;
512
+ };
513
+ billing_address: {
514
+ first_name?: string;
515
+ last_name?: string;
516
+ line1: string;
517
+ line2?: string;
518
+ country: string;
519
+ postcode: string;
520
+ city: string;
521
+ state: string;
522
+ };
523
+ };
524
+ statistics: {
525
+ account_created?: string;
526
+ sales_total_number?: number;
527
+ sales_total_amount?: number;
528
+ sales_avg_value?: number;
529
+ sales_max_value?: number;
530
+ refunds_total_amount?: number;
531
+ previous_chargeback?: boolean;
532
+ currency?: string;
533
+ last_login?: string;
534
+ };
535
+ hide_shipping_address?: boolean;
536
+ }
537
+ interface IAfterpayMeta {
538
+ amount: number;
539
+ currency: string;
540
+ email: string;
541
+ first_name: string;
542
+ last_name: string;
543
+ address_line: string;
544
+ address_line2: string;
545
+ address_city: string;
546
+ address_state: string;
547
+ address_postcode: string;
548
+ address_country: string;
549
+ phone: string;
550
+ }
551
+ interface VaultDisplayStyle {
552
+ background_color?: string;
553
+ text_color?: string;
554
+ border_color?: string;
555
+ button_color?: string;
556
+ font_size?: string;
557
+ font_family?: string;
558
+ }
559
+ interface IApplePayShippingOption {
560
+ id: string;
561
+ label: string;
562
+ detail: string;
563
+ amount: string;
564
+ type?: 'ELECTRONIC' | 'GROUND' | 'NOT_SHIPPED' | 'OVERNIGHT' | 'PICKUP' | 'PRIORITY' | 'SAME_DAY';
565
+ }
566
+ interface IGooglePayShippingOption {
567
+ id: string;
568
+ label: string;
569
+ detail?: string;
570
+ type?: 'ELECTRONIC' | 'GROUND' | 'NOT_SHIPPED' | 'OVERNIGHT' | 'PICKUP' | 'PRIORITY' | 'SAME_DAY';
571
+ }
572
+ interface IPayPalShippingOption {
573
+ id: string;
574
+ label: string;
575
+ amount: string;
576
+ currency: string;
577
+ type: 'SHIPPING' | 'PICKUP';
578
+ }
579
+ type IShippingOption = IApplePayShippingOption | IGooglePayShippingOption | IPayPalShippingOption;
580
+ declare enum WALLET_TYPE {
581
+ GOOGLE = "google",
582
+ APPLE = "apple",
583
+ FLYPAY = "flypay",
584
+ FLYPAY_V2 = "flypayV2",
585
+ PAYPAL = "paypal",
586
+ AFTERPAY = "afterpay"
587
+ }
588
+ interface ApplePayStyles {
589
+ button_type?: string;
590
+ }
591
+ interface GooglePayStyles {
592
+ button_type?: 'book' | 'buy' | 'checkout' | 'donate' | 'order' | 'pay' | 'plain' | 'subscribe';
593
+ button_size_mode?: 'static' | 'fill';
594
+ button_color?: 'default' | 'black' | 'white';
595
+ }
596
+ interface AfterpayStyles {
597
+ button_type?: 'black' | 'mint' | 'white';
598
+ height?: string;
599
+ }
600
+ type WalletStyles = {
601
+ apple?: ApplePayStyles;
602
+ google?: GooglePayStyles;
603
+ afterpay?: AfterpayStyles;
604
+ } | object;
605
+ type WalletRawDataInitialization = {
606
+ apple?: ApplePayRawDataInitialization;
607
+ google?: GooglePayRawDataInitialization;
608
+ } | object;
609
+ type ApplePayRawDataInitialization = ApplePayJS.ApplePayPaymentRequest;
610
+ type GooglePayRawDataInitialization = google.payments.api.IsReadyToPayPaymentMethodSpecification | google.payments.api.PaymentMethodSpecification;
611
+ interface IWalletMeta {
612
+ amount_label?: string;
613
+ country?: string;
614
+ pay_later?: boolean;
615
+ standalone?: boolean;
616
+ show_billing_address?: boolean;
617
+ request_payer_name?: boolean;
618
+ request_payer_email?: boolean;
619
+ request_payer_phone?: boolean;
620
+ request_shipping?: boolean;
621
+ shipping_options?: IShippingOption[];
622
+ merchant_name?: string;
623
+ raw_data_initialization?: WalletRawDataInitialization;
624
+ access_token?: string;
625
+ refresh_token?: string;
626
+ style?: WalletStyles;
627
+ wallets?: WALLET_TYPE[];
628
+ client_id?: string;
629
+ }
630
+
631
+ declare class Link {
632
+ protected env: Env;
633
+ protected linkResource: string;
634
+ protected params: IParams;
635
+ protected widgetId: string;
636
+ constructor(linkResource: string);
637
+ getNetUrl(): string;
638
+ getUrl(): string;
639
+ setParams(params: IParams | IWalletParams | ISRCParams): void;
640
+ concatParams(params: IParams): void;
641
+ getParams(): IParams;
642
+ setEnv(env: string, alias?: string): void;
643
+ getEnv(): string;
644
+ getBaseUrl(): string;
645
+ }
646
+
647
+ declare class Container {
648
+ protected selector: string;
649
+ constructor(selector: string);
650
+ isExist(): boolean;
651
+ getStyles<T>(allowValue: string[]): T | {};
652
+ on(name: any, cb: (event: MouseEvent) => void): void;
653
+ getAttr<T>(allowValue: string[]): T | {};
654
+ getElement(): Element;
655
+ getSelector(): string;
656
+ private convertConfigs;
657
+ }
658
+
659
+ declare class IFrame {
660
+ protected container: Container;
661
+ constructor(container: Container);
662
+ load(link: string, options?: {
663
+ title?: string;
664
+ }): void;
665
+ loadFromHtml(content: string, options?: {
666
+ title?: string;
667
+ }): void;
668
+ remove(): void;
669
+ show(): void;
670
+ hide(saveSize?: boolean): void;
671
+ isExist(): boolean;
672
+ getElement(): HTMLIFrameElement;
673
+ setStyle(property: string, value: string): void;
674
+ setIframeHeight(iframeElement: HTMLIFrameElement, iFrameDocument: Document, selector: string): void;
675
+ private setStyles;
676
+ }
677
+
678
+ /**
679
+ * Contains basic information associated with the event.
680
+ *
681
+ * Including event (name), source of the message, purpose and a unique identifier
682
+ * for the event.
683
+ *
684
+ * @interface IEventData
685
+ *
686
+ * @param {string} event The name of the event.
687
+ * @param {string} message_source A system variable that identifies the event source.
688
+ * @param {string} purpose A system variable that states the purpose of the event.
689
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
690
+ */
691
+ interface IEventData$1 {
692
+ event: string;
693
+ message_source: string;
694
+ purpose: string;
695
+ widget_id: string;
696
+ data?: any;
697
+ ref_id?: string;
698
+ }
699
+ declare const EVENT$1: {
700
+ AFTER_LOAD: string;
701
+ SUBMIT: string;
702
+ FINISH: string;
703
+ VALIDATION_ERROR: string;
704
+ SYSTEM_ERROR: string;
705
+ /** @deprecated */
706
+ CHECKOUT_SUCCESS: string;
707
+ CHECKOUT_READY: string;
708
+ CHECKOUT_ERROR: string;
709
+ CHECKOUT_COMPLETED: string;
710
+ CHECKOUT_POPUP_OPEN: string;
711
+ CHECKOUT_POPUP_CLOSE: string;
712
+ RECOGNITION_TOKEN_REQUESTED: string;
713
+ RECOGNITION_TOKEN_DROPPED: string;
714
+ VALIDATION: string;
715
+ SELECT: string;
716
+ UNSELECT: string;
717
+ NEXT: string;
718
+ PREV: string;
719
+ META_CHANGE: string;
720
+ RESIZE: string;
721
+ CHARGE_AUTH_SUCCESS: string;
722
+ CHARGE_AUTH_REJECT: string;
723
+ CHARGE_AUTH_CANCELLED: string;
724
+ ADDITIONAL_DATA_SUCCESS: string;
725
+ ADDITIONAL_DATA_REJECT: string;
726
+ CHARGE_AUTH: string;
727
+ DISPATCH_SUCCESS: string;
728
+ DISPATCH_ERROR: string;
729
+ };
730
+ interface Listener {
731
+ event: string;
732
+ listener: (event: any) => void;
733
+ widget_id: string;
734
+ }
735
+ declare type Listeners = Listener[];
736
+ declare class IFrameEvent {
737
+ protected listeners: Listeners;
738
+ constructor(subject: Window | null);
739
+ emit(data: IEventData$1): void;
740
+ on<T>(eventName: string, widgetId: string, cb: (data: T) => void): void;
741
+ clear(): void;
742
+ private subscribe;
743
+ }
744
+
745
+ /**
746
+ * List of available payment source types
747
+ *
748
+ * @type {object}
749
+ * @param {string} CARD=card
750
+ * @param {string} BANK_ACCOUNT=bank_account
751
+ * @param {string} CHECKOUT=checkout
752
+ */
753
+ declare const PAYMENT_TYPE: {
754
+ CARD: string;
755
+ GIFT_CARD: string;
756
+ BANK_ACCOUNT: string;
757
+ CHECKOUT: string;
758
+ };
759
+ /**
760
+ * Purposes
761
+ * @type {object}
762
+ * @param {string} PAYMENT_SOURCE=payment_source
763
+ * @param {string} CARD_PAYMENT_SOURCE_WITH_CVV=card_payment_source_with_cvv
764
+ * @param {string} CARD_PAYMENT_SOURCE_WITHOUT_CVV=card_payment_source_without_cvv
765
+ * */
766
+ declare const PURPOSE: {
767
+ PAYMENT_SOURCE: string;
768
+ CARD_PAYMENT_SOURCE_WITH_CVV: string;
769
+ CARD_PAYMENT_SOURCE_WITHOUT_CVV: string;
770
+ };
771
+ interface IGeneral {
772
+ purpose: string;
773
+ predefined_fields: IPredefinedFields;
774
+ defined_form_fields?: string[];
775
+ webhook_destination?: string;
776
+ success_redirect_url?: string;
777
+ error_redirect_url?: string;
778
+ meta?: IPayPalMeta;
779
+ label?: string;
780
+ dynamic_fields_position?: boolean;
781
+ }
782
+ interface IPredefinedFields {
783
+ gateway_id: string;
784
+ type?: string;
785
+ card_scheme?: string;
786
+ card_processing_network?: string;
787
+ }
788
+ /**
789
+ * Class Configuration include methods for creating configuration token
790
+ * @constructor
791
+ *
792
+ * @example
793
+ * var config = new Configuration('gatewayId'); // short
794
+ *
795
+ * var config = new Configuration('gatewayId', 'bank_account', 'paymentSource'); // extend
796
+ *
797
+ * var config = new Configuration('not_configured'); // without gateway
798
+ *
799
+ * @param {string} [gatewayID=default] - gateway ID. By default or if put 'default', it will use the selected default gateway. If put 'not_configured', it won’t use gateway to create downstream token.
800
+ * @param {string} paymentType - Type of payment source which shows in widget form. Available parameters [PAYMENT_TYPE]{@link PAYMENT_TYPE}
801
+ * @param {string} purpose - Param which describes payment purpose. By default uses Available parameters [PURPOSE]{@link PURPOSE}
802
+ */
803
+ declare class Configuration {
804
+ private configs;
805
+ private env;
806
+ static createEachToken(accessToken: string, configs: Configuration[], cb: (tokens: string[]) => void, errorCb?: (errors: string[]) => void): void;
807
+ private static finishCreatingEachToken;
808
+ /** @constructs */ constructor(gatewayID?: string, paymentType?: string, purpose?: string);
809
+ /**
810
+ * Destination, where customer will receive all successful responses.
811
+ * Response will contain “data” object with “payment_source” or other parameters, in depending on 'purpose'
812
+ *
813
+ * @example
814
+ * config.setWebHookDestination('http://google.com');
815
+ *
816
+ * @param {string} url - Your endpoint for post request.
817
+ */
818
+ setWebHookDestination(url: string): void;
819
+ /**
820
+ * URL to which the Customer will be redirected to after the success finish
821
+ *
822
+ * @example
823
+ * config.setSuccessRedirectUrl('google.com/search?q=success');
824
+ *
825
+ * @param {string} url
826
+ */
827
+ setSuccessRedirectUrl(url: string): void;
828
+ /**
829
+ * URL to which the Customer will be redirected to if an error is triggered in the process of operation
830
+ *
831
+ * @example
832
+ * config.setErrorRedirectUrl('google.com/search?q=error');
833
+ *
834
+ * @param {string} url
835
+ */
836
+ setErrorRedirectUrl(url: string): void;
837
+ /**
838
+ * Set list with widget form field, which will be shown in form. Also you can set the required validation for these fields
839
+ *
840
+ * @example
841
+ * config.setFormFields(['phone', 'email', 'first_name*']);
842
+ *
843
+ * @param {string[]} fields - name of fields which can be shown in a widget.
844
+ * If after a name of a field, you put “*”, this field will be required on client-side.
845
+ * (For validation, you can specify any fields, even those that are shown by default: card_number, expiration, etc... ) [FORM_FIELD]{@link FORM_FIELD}
846
+ */
847
+ setFormFields(fields: string[]): void;
848
+ /**
849
+ * Method for setting meta information for checkout page
850
+ *
851
+ * @example
852
+ * config.setMeta({
853
+ brand_name: 'paydock',
854
+ reference: '15',
855
+ email: 'wault@paydock.com'
856
+ });
857
+ *
858
+ * @param {IPayPalMeta | IZipmoneyMeta | IAfterpayMeta | IBamboraMeta} object -
859
+ * data which can be shown on checkout page [IPayPalMeta]{@link IPayPalMeta} [IZipmoneyMeta]{@link IZipmoneyMeta} [IAfterpayMeta]{@link IAfterpayMeta} [IBamboraMeta]{@link IBamboraMeta}
860
+ */
861
+ setMeta(meta: IPayPalMeta | IZipmoneyMeta | IAfterpayMeta | IBamboraMeta): void;
862
+ /**
863
+ * Current method can change environment. By default environment = sandbox.
864
+ * Also we can change domain alias for this environment. By default domain_alias = paydock.com
865
+ *
866
+ * @example
867
+ * config.setEnv('production');
868
+ * @param {string} env - sandbox, production
869
+ * @param {string} [alias] - Own domain alias
870
+ */
871
+ setEnv(env: string, alias?: string): void;
872
+ /**
873
+ * Title for tab which can be set instead of default
874
+ *
875
+ * @example
876
+ * config.setLabel('custom label');
877
+ *
878
+ * @param {string} label - Text label for tab
879
+ */
880
+ setLabel(label: string): void;
881
+ getEnv(): string;
882
+ /**
883
+ * createToken - method which exactly create payment one time token
884
+ *
885
+ * @example
886
+ * config.createToken('582035346f65cdd57ee81192d6e5w65w4e5',
887
+ * function (data) {
888
+ * console.log(data);
889
+ * }, function (error) {
890
+ * console.log(error);
891
+ * });
892
+ *
893
+ * @param {string} accessToken - Customer access token or public key which provided for each client
894
+ * @param {createToken~requestCallback} cb - The callback that handles the success response.
895
+ * @param {createToken~requestCallback} errorCb - The callback that handles the failed response.
896
+ */
897
+ createToken(accessToken: string, cb: (token: string) => void, errorCb?: (error: any) => void): void;
898
+ private send;
899
+ getConfigs(): IGeneral;
900
+ private getUrl;
901
+ setGiftCardSchemeData(giftCardScheme: any, processingNetwork: any): void;
902
+ }
903
+
904
+ declare class EventEmitter {
905
+ private events;
906
+ emit<T>(eventName: string, data?: T): void;
907
+ emitWithResult<T, R>(eventName: string, data?: T): Promise<R[]>;
908
+ subscribe<T>(eventName: string, handler: (data: T) => void): () => void;
909
+ }
910
+
911
+ declare class Standalone3dsService {
912
+ protected container: Container;
913
+ protected eventEmitter: EventEmitter;
914
+ protected env: string;
915
+ protected alias: string;
916
+ constructor(container: Container, eventEmitter: any);
917
+ load(token: string, options: {
918
+ title: string;
919
+ }): void;
920
+ setEnv(env: string, alias?: string): void;
921
+ }
922
+
923
+ /**
924
+ * List of available token's content formats
925
+ * @enum TOKEN_FORMAT
926
+ *
927
+ * @type {object}
928
+ * @param {string} HTML=html
929
+ */
930
+ declare enum TOKEN_FORMAT {
931
+ HTML = "html",
932
+ URL = "url",
933
+ STANDALONE_3DS = "standalone_3ds"
934
+ }
935
+ /**
936
+ * List of available event's name
937
+ * @const EVENT
938
+ *
939
+ * @type {object}
940
+ * @param {string} CHARGE_AUTH_SUCCESS=chargeAuthSuccess
941
+ * @param {string} CHARGE_AUTH_REJECT=chargeAuthReject
942
+ * @param {string} ADDITIONAL_DATA_SUCCESS=additionalDataCollectSuccess
943
+ * @param {string} ADDITIONAL_DATA_REJECT=additionalDataCollectReject
944
+ * @param {string} CHARGE_AUTH=chargeAuth
945
+ */
946
+ /**
947
+ * List of available event's name for Standalone 3ds flow
948
+ * @const STANDALONE_3DS_EVENT
949
+ *
950
+ * @type {object}
951
+ * @param {string} CHARGE_AUTH_SUCCESS=chargeAuthSuccess
952
+ * @param {string} CHARGE_AUTH_REJECT=chargeAuthReject
953
+ * @param {string} CHARGE_AUTH_DECOUPLED=chargeAuthDecoupled
954
+ * @param {string} CHARGE_AUTH_CHALLENGE=chargeAuthChallenge
955
+ * @param {string} CHARGE_AUTH_INFO=chargeAuthInfo
956
+ * @param {string} ERROR=error
957
+ */
958
+ /**
959
+ * Class Canvas3ds include method for working on html
960
+ * @constructor
961
+ *
962
+ * @param {string} selector - Selector of html element. Container for widget
963
+ * @param {string} token - Pre authorized token
964
+ * @example
965
+ * var widget = new Canvas3ds('#widget', 'token');
966
+ *
967
+ *
968
+ */
969
+ declare class Canvas3ds {
970
+ protected link: Link;
971
+ protected configs: Configuration[];
972
+ protected publicKey: string;
973
+ protected token: {
974
+ content: string;
975
+ format: TOKEN_FORMAT;
976
+ charge_3ds_id: string;
977
+ };
978
+ protected standalone3dsService: Standalone3dsService;
979
+ protected container: Container;
980
+ protected iFrame: IFrame;
981
+ protected event: IFrameEvent;
982
+ protected eventEmitter: EventEmitter;
983
+ /** @constructs */ constructor(selector: string, token: string);
984
+ protected static extractToken(token: string): {
985
+ content: string;
986
+ format: TOKEN_FORMAT;
987
+ charge_3ds_id: string;
988
+ };
989
+ /**
990
+ * The final method to beginning, the load process of widget to html
991
+ *
992
+ */
993
+ load(): void;
994
+ /**
995
+ * Current method can change environment. By default environment = sandbox.
996
+ * Also we can change domain alias for this environment. By default domain_alias = paydock.com
997
+ *
998
+ * @example
999
+ * widget.setEnv('production');
1000
+ * @param {string} env - sandbox, production
1001
+ * @param {string} [alias] - Own domain alias
1002
+ */
1003
+ setEnv(env: string, alias?: string): void;
1004
+ getEnv(): string;
1005
+ on(eventName: string): Promise<IEventData$1>;
1006
+ on(eventName: string, cb: (data: IEventData$1) => void): any;
1007
+ /**
1008
+ * Using this method you can hide widget after load
1009
+ * @param {boolean} [saveSize=false] - using this param you can save iframe's size
1010
+ */
1011
+ hide(saveSize: boolean): void;
1012
+ /**
1013
+ * Using this method you can show widget after using hide method
1014
+ *
1015
+ */
1016
+ show(): void;
1017
+ /**
1018
+ * Using this method you can reload widget
1019
+ *
1020
+ */
1021
+ reload(): void;
1022
+ }
1023
+
1024
+ /**
1025
+ * @type {object}
1026
+ * @param {string} CLICK=click
1027
+ * @param {string} POPUP_REDIRECT=popup_redirect
1028
+ * @param {string} ERROR=error
1029
+ * @param {string} ACCEPTED=accepted
1030
+ * @param {string} FINISH=finish
1031
+ * @param {string} CLOSE=close
1032
+ */
1033
+ declare const CHECKOUT_BUTTON_EVENT: {
1034
+ CLICK: string;
1035
+ POPUP_REDIRECT: string;
1036
+ REDIRECT: string;
1037
+ ERROR: string;
1038
+ REFERRED: string;
1039
+ DECLINED: string;
1040
+ CANCELLED: string;
1041
+ ACCEPTED: string;
1042
+ FINISH: string;
1043
+ CLOSE: string;
1044
+ };
1045
+ /**
1046
+ * @type {object}
1047
+ * @param {string} CONTEXTUAL=contextual
1048
+ * @param {string} REDIRECT=redirect
1049
+ */
1050
+ declare enum CHECKOUT_MODE {
1051
+ CONTEXTUAL = "contextual",
1052
+ REDIRECT = "redirect"
1053
+ }
1054
+ /**
1055
+ * @type {object}
1056
+ * @param {string} ZIPMONEY=Zipmoney
1057
+ * @param {string} PAYPAL=PaypalClassic
1058
+ * @param {string} AFTERPAY=Afterpay
1059
+ */
1060
+ declare enum GATEWAY_TYPE {
1061
+ ZIPMONEY = "Zipmoney",
1062
+ PAYPAL = "PaypalClassic",
1063
+ AFTERPAY = "Afterpay"
1064
+ }
1065
+ interface IEventCheckoutFinishData {
1066
+ payment_source_token: string;
1067
+ checkout_email: string;
1068
+ checkout_holder: string;
1069
+ gateway_type: string;
1070
+ }
1071
+
1072
+ /**
1073
+ * Class Background create overlay for checkout
1074
+ *
1075
+ * @example
1076
+ * var overlay = new Background();
1077
+ */
1078
+ declare class Background {
1079
+ protected description: string;
1080
+ protected title: string;
1081
+ protected overlay: HTMLElement;
1082
+ protected style: HTMLStyleElement;
1083
+ protected eventEmitter: EventEmitter;
1084
+ protected showControl: boolean;
1085
+ protected showLoader: boolean;
1086
+ constructor();
1087
+ initControl(): void;
1088
+ initLoader(): void;
1089
+ private eventHandler;
1090
+ clear(): void;
1091
+ private createLoader;
1092
+ protected createTemplate(): void;
1093
+ private createStyles;
1094
+ setBackdropDescription(text: string): void;
1095
+ setBackdropTitle(text: string): void;
1096
+ onTrigger(triggerName: string, cb: () => void): void;
1097
+ isInit(): boolean;
1098
+ hideContinueControl(): void;
1099
+ turnOffControl(): void;
1100
+ turnOffLoader(): void;
1101
+ }
1102
+
1103
+ declare type SuccessCb = (data: any, status: number) => void;
1104
+ declare type ErrorCb = (err: any, status: number) => void;
1105
+ declare abstract class HttpCore {
1106
+ private env;
1107
+ constructor();
1108
+ setEnv(env: string, alias?: string): void;
1109
+ getEnv(): string;
1110
+ protected getUrl(): string;
1111
+ protected create(accessToken: string, data: any, cb: SuccessCb, errorCb: ErrorCb): void;
1112
+ protected get(accessToken: string, cb: SuccessCb, errorCb: ErrorCb): void;
1113
+ protected parser(text: any, status: number, cb: SuccessCb, errorCb: ErrorCb): void;
1114
+ protected abstract getLink(): string;
1115
+ }
1116
+
1117
+ interface IBody$1 {
1118
+ gateway_id: string;
1119
+ success_redirect_url: string;
1120
+ error_redirect_url: string;
1121
+ redirect_url: string;
1122
+ meta: IPayPalMeta;
1123
+ description?: string;
1124
+ }
1125
+ interface ICheckout {
1126
+ gateway_id: string;
1127
+ checkout_type: string;
1128
+ gateway_type: string;
1129
+ link: string;
1130
+ reference_id: string;
1131
+ token: string;
1132
+ mode?: string;
1133
+ }
1134
+ declare class Builder$1 extends HttpCore {
1135
+ private body;
1136
+ constructor(gatewayID: string, successRedirectUrl: string, errorRedirectUrl: string);
1137
+ protected getLink(): string;
1138
+ setDescriptions(text: string): void;
1139
+ setMeta(meta: IPayPalMeta): void;
1140
+ getConfigs(): IBody$1;
1141
+ send(publicKey: string, cb: (checkout: ICheckout) => void, errorCb?: (error: any, code: string) => void): void;
1142
+ }
1143
+
1144
+ interface IDetails {
1145
+ checkout_email: string;
1146
+ checkout_holder: string;
1147
+ status: string;
1148
+ gateway_type: string;
1149
+ }
1150
+ declare class Checker extends HttpCore {
1151
+ token: string;
1152
+ constructor(token: string);
1153
+ protected getLink(): string;
1154
+ send(accessToken: string, cb: (details: IDetails) => void, errorCb?: (error: any) => void): void;
1155
+ }
1156
+
1157
+ type AdditionalParams = Record<string, string | number | boolean>;
1158
+ interface IRunner {
1159
+ next(checkoutData: ICheckout, params?: AdditionalParams): void;
1160
+ error(error: string, code: string, cb: (close: boolean) => void): void;
1161
+ getSuccessRedirectUri(): string;
1162
+ getErrorRedirectUri(): string;
1163
+ setEnv(env: string, alias?: string): void;
1164
+ }
1165
+
1166
+ interface IDispatcherData {
1167
+ message_source: string;
1168
+ event: string;
1169
+ }
1170
+
1171
+ interface IContextualRunner extends IRunner {
1172
+ run(): void;
1173
+ isRunning(): boolean;
1174
+ continue(): void;
1175
+ stop(): void;
1176
+ onStop(cb: () => void): void;
1177
+ onCheckout<T extends IDispatcherData>(event: string, cb: (checkout: ICheckout, data?: T) => void): void;
1178
+ setBackgroundTitle(text: string): void;
1179
+ setBackgroundDescription(text: string): void;
1180
+ turnOffBackdrop(): void;
1181
+ setSuspendedRedirectUri(uri: string): void;
1182
+ }
1183
+
1184
+ interface IRedirectRunner extends IRunner {
1185
+ setRedirectUrl(url: string): void;
1186
+ getRedirectUrl(): string;
1187
+ getProxyRedirectUrl(): string;
1188
+ }
1189
+
1190
+ interface CheckoutContextualHandlerParams {
1191
+ accessToken: string;
1192
+ gatewayId: string;
1193
+ }
1194
+ declare class CheckoutContextualHandler {
1195
+ protected background: Background;
1196
+ protected runner: IContextualRunner;
1197
+ protected eventEmitter: EventEmitter;
1198
+ protected params: CheckoutContextualHandlerParams;
1199
+ protected env: string;
1200
+ protected details: IDetails;
1201
+ constructor(background: Background, runner: IContextualRunner, eventEmitter: EventEmitter, params: CheckoutContextualHandlerParams);
1202
+ init(env: string): void;
1203
+ setEnv(env: string): void;
1204
+ protected checkToken(token: string, cb: () => void): void;
1205
+ protected createOneTimeToken(token: string): void;
1206
+ }
1207
+
1208
+ /**
1209
+ * Class CheckoutButton transform usual button into checkout
1210
+ *
1211
+ * @constructor
1212
+ *
1213
+ * @param {string} selector - Selector of html element.
1214
+ * @param {string} aceessToken - PayDock access token or users public key
1215
+ * @param {string} [gatewayId=default] - PayDock's gatewayId. By default or if put 'default', it will use the selected default gateway
1216
+ * @param {string} [type=PaypalClassic] - Type of gateway (PaypalClassic, Zipmoney)
1217
+ * @example
1218
+ * var widget = new CheckoutButton('#button', 'accessToken','gatewayId');
1219
+ */
1220
+ declare class CheckoutButton {
1221
+ protected accessToken: string;
1222
+ protected gatewayId: string;
1223
+ protected gatewayType: GATEWAY_TYPE;
1224
+ protected mode: CHECKOUT_MODE;
1225
+ protected window: Window;
1226
+ protected eventEmitter: EventEmitter;
1227
+ protected container: Container;
1228
+ protected meta: IPayPalMeta;
1229
+ protected runner: IContextualRunner | IRedirectRunner;
1230
+ protected background?: Background;
1231
+ protected checkoutHandler?: CheckoutContextualHandler;
1232
+ protected env: string;
1233
+ protected alias?: string;
1234
+ /** @constructs */ constructor(selector: string, accessToken: string, gatewayId?: string, gatewayType?: GATEWAY_TYPE, mode?: CHECKOUT_MODE);
1235
+ protected chooseRunner(gatewayType: GATEWAY_TYPE, mode: CHECKOUT_MODE): void;
1236
+ protected buildAdditionalParams(): AdditionalParams;
1237
+ protected initCheckout(container: Container): void;
1238
+ /**
1239
+ * This callback will be called for each event in payment source widget
1240
+ *
1241
+ * @callback listener
1242
+ */
1243
+ /**
1244
+ * Listen to events of widget
1245
+ *
1246
+ * @example
1247
+ *
1248
+ * widget.on('click', function () {
1249
+ *
1250
+ * });
1251
+ * @param {string} eventName - Available event names [CHECKOUT_BUTTON_EVENT]{@link CHECKOUT_BUTTON_EVENT}
1252
+ * @param {listener} cb
1253
+ */
1254
+ on<T = object>(name: string, handler: (data: T) => void): void;
1255
+ /**
1256
+ * Close popup window forcibly.
1257
+ * Only for 'contextual' mode.
1258
+ *
1259
+ */
1260
+ close(): void;
1261
+ /**
1262
+ * After finish event of checkout button, data (dataType) will be insert to input (selector)
1263
+ *
1264
+ * @param {string} selector - css selector . [] #
1265
+ * @param {string} dataType - data type of IEventCheckoutFinishData [IEventCheckoutFinishData]{@link #IEventCheckoutFinishData}.
1266
+ */
1267
+ onFinishInsert(selector: string, dataType: string): void;
1268
+ /**
1269
+ * Method for setting meta information for checkout page
1270
+ *
1271
+ * @example
1272
+ * button.setMeta({
1273
+ brand_name: 'paydock',
1274
+ reference: '15',
1275
+ email: 'wault@paydock.com'
1276
+ });
1277
+ *
1278
+ * @param {(IPayPalMeta|IAfterpayMeta|IZipmoneyMeta)} meta - Data which can be shown on checkout page [IPayPalMeta]{@link IPayPalMeta} [IZipmoneyMeta]{@link IZipmoneyMeta} [IAfterpayMeta]{@link IAfterpayMeta}
1279
+ */
1280
+ setMeta(meta: IPayPalMeta | IAfterpayMeta | IZipmoneyMeta): void;
1281
+ /**
1282
+ * Method for setting backdrop description.
1283
+ * Only for 'contextual' mode.
1284
+ *
1285
+ * @example
1286
+ * button.setBackdropDescription('Custom description');
1287
+ *
1288
+ * @param {string} text - description which can be shown in overlay of back side checkout page
1289
+ */
1290
+ setBackdropDescription(text: string): void;
1291
+ /**
1292
+ * Method for setting backdrop title.
1293
+ * Only for 'contextual' mode.
1294
+ *
1295
+ * @example
1296
+ * button.setBackdropTitle('Custom title');
1297
+ *
1298
+ * @param {text} string - title which can be shown in overlay of back side checkout page
1299
+ */
1300
+ setBackdropTitle(text: string): void;
1301
+ /**
1302
+ * Method for setting suspended redirect uri. Redirect after referred checkout.
1303
+ * Only for 'contextual' mode.
1304
+ *
1305
+ * @param {uri} string - uri for redirect (by default)
1306
+ */
1307
+ setSuspendedRedirectUri(uri: string): void;
1308
+ /**
1309
+ * Method for setting the merchant redirect URL.
1310
+ * Merchant's customers redirect after successfull checkout.
1311
+ * Only for 'redirect' mode.
1312
+ *
1313
+ * @param {url} string - redirect url
1314
+ */
1315
+ setRedirectUrl(url: string): void;
1316
+ getSuccessRedirectUri(): string;
1317
+ /**
1318
+ * Method for disable backdrop on the page.
1319
+ * Only for 'contextual' mode.
1320
+ *
1321
+ * @example
1322
+ * button.turnOffBackdrop();
1323
+ *
1324
+ */
1325
+ turnOffBackdrop(): void;
1326
+ protected turnOffControlBackdrop(): void;
1327
+ protected turnOffLoaderBackdrop(): void;
1328
+ setEnv(env: string, alias?: string): void;
1329
+ getEnv(): string;
1330
+ private getRunnerByMode;
1331
+ private assertMethodSupport;
1332
+ }
1333
+
1334
+ interface ZipmoneyRunnerParams extends AdditionalParams {
1335
+ gateway_id: string;
1336
+ public_key: string;
1337
+ }
1338
+
1339
+ /**
1340
+ * Class ZipmoneyCheckoutButton is wrapper of CheckoutButton transform usual button into checkout
1341
+ *
1342
+ * @extends CheckoutButton
1343
+ *
1344
+ * @constructor
1345
+ *
1346
+ * @param {string} selector - Selector of html element.
1347
+ * @param {string} publicKey - PayDock users public key
1348
+ * @param {string} [gatewayId=default] - PayDock's gatewayId. By default or if put 'default', it will use the selected default gateway
1349
+ * @param {string} [gatewayId=default] - Checkout mode, it could be set to 'contextual' or 'redirect'. By default it 'contextual'
1350
+ * @example
1351
+ * var widget = new ZipmoneyCheckoutButton('#button', 'publicKey','gatewayId');
1352
+ */
1353
+ declare class ZipmoneyCheckoutButton extends CheckoutButton {
1354
+ protected publicKey: string;
1355
+ protected gatewayId: string;
1356
+ protected mode: CHECKOUT_MODE;
1357
+ /** @constructs */ constructor(selector: string, publicKey: string, gatewayId?: string, mode?: CHECKOUT_MODE);
1358
+ /**
1359
+ * Method for setting suspended redirect uri. Redirect after referred checkout
1360
+ *
1361
+ * The URI is used for a redirect after the checkout is complete.
1362
+ * This can be provided, even if using in-context checkout (sdk). By default, the standard styled page will be used.
1363
+ * If using in-context (sdk) we will not automatically redirect to this URI.
1364
+ *
1365
+
1366
+ * @param {uri} string - uri for suspended redirect (by default)
1367
+ */
1368
+ setSuspendedRedirectUri(uri: string): void;
1369
+ /**
1370
+ * Method for setting the merchant redirect URL.
1371
+ * The merchant's customers would be redirected to the specified URL
1372
+ * at the end of ZipMoney checkout flow.
1373
+ *
1374
+ * Once the redirect URL would be set, the checkout flow would be immediately switched
1375
+ * from 'contextual' mode to the 'redirect' mode.
1376
+ * The merchant's customer would be automatically redirected to this URL after the checkout is complete.
1377
+ *
1378
+ * @param {url} string - URL for redirect
1379
+ */
1380
+ setRedirectUrl(url: string): void;
1381
+ protected buildAdditionalParams(): ZipmoneyRunnerParams;
1382
+ }
1383
+
1384
+ /**
1385
+ * Class AfterpayCheckoutButton is wrapper of CheckoutButton transform usual button into checkout
1386
+ *
1387
+ * @extends CheckoutButton
1388
+ *
1389
+ * @constructor
1390
+ *
1391
+ * @param {string} selector - Selector of html element.
1392
+ * @param {string} accessToken - PayDock access-token or users public key
1393
+ * @param {string} [gatewayId=default] - PayDock's gatewayId. By default or if put 'default', it will use the selected default gateway
1394
+ * @example
1395
+ * var widget = new AfterpayCheckoutButton('#button', 'access-token','gatewayId');
1396
+ */
1397
+ declare class AfterpayCheckoutButton extends CheckoutButton {
1398
+ protected accessToken: string;
1399
+ protected gatewayId: string;
1400
+ protected showETP: boolean;
1401
+ /** @constructs */ constructor(selector: string, accessToken: string, gatewayId?: string);
1402
+ /**
1403
+ * Method which toggles the "Enhanced Tracking Protection" warning popup to 'on' mode.
1404
+ *
1405
+ * This popup with a warning about "Enhanced Tracking Protection" limitations
1406
+ * would be shown in the Mozilla Firefox browser version 100+
1407
+ *
1408
+ * By default, the popup would not be shown, until
1409
+ * the flag would be set to `true`
1410
+
1411
+ * @param {doShow} boolean - flag which toggle the popup visibility
1412
+ */
1413
+ showEnhancedTrackingProtectionPopup(doShow: boolean): void;
1414
+ protected buildAdditionalParams(): AdditionalParams;
1415
+ }
1416
+
1417
+ /**
1418
+ * Class PaypalCheckoutButton is wrapper of CheckoutButton transform usual button into checkout
1419
+ *
1420
+ * @extends CheckoutButton
1421
+ *
1422
+ * @constructor
1423
+ *
1424
+ * @param {string} selector - Selector of html element.
1425
+ * @param {string} publicKey - PayDock users public key
1426
+ * @param {string} [gatewayId=default] - PayDock's gatewayId. By default or if put 'default', it will use the selected default gateway
1427
+ * @example
1428
+ * var widget = new PaypalCheckoutButton('#button', 'publicKey','gatewayId');
1429
+ */
1430
+ declare class PaypalCheckoutButton extends CheckoutButton {
1431
+ protected publicKey: string;
1432
+ protected gatewayId: string;
1433
+ /** @constructs */ constructor(selector: string, publicKey: string, gatewayId?: string);
1434
+ }
1435
+
1436
+ /**
1437
+ *
1438
+ * Class PaymentSourceWidget include method for for creating iframe url
1439
+ * @constructor
1440
+ *
1441
+ * @param {string} publicKey - PayDock users public key
1442
+ * @param {string} customer - PayDock's customer_id or customer_reference (In order to use the customer_reference, you must explicitly specify useReference as true)
1443
+ * @param {boolean} [useReference=false]
1444
+ *
1445
+ * @example
1446
+ * var widget = new PaymentSourceWidget('publicKey','customerId');
1447
+ * // or
1448
+ * var widget = new PaymentSourceWidget('publicKey', customerReference, true);
1449
+ */
1450
+ declare class PaymentSourceWidget {
1451
+ protected link: Link;
1452
+ protected configs: Configuration[];
1453
+ protected configTokens: string[];
1454
+ protected publicKey: string;
1455
+ /** @constructs */ constructor(accessToken: string, queryToken: string);
1456
+ /**
1457
+ * Object contain styles for widget
1458
+ *
1459
+ * @example
1460
+ * widget.setStyles({
1461
+ * background_color: 'rgb(0, 0, 0)',
1462
+ * border_color: 'yellow',
1463
+ * text_color: '#FFFFAA',
1464
+ * icon_size: 'small',
1465
+ * font_size: '20px'
1466
+ * });
1467
+ * @param {IStyles} fields - name of styles which can be shown in widget [STYLE]{@link STYLE}
1468
+ */
1469
+ setStyles(styles: IStyles$1): void;
1470
+ setStyle(param: string, value: string): void;
1471
+ /**
1472
+ * Current method can set custom ID to identify the data in the future
1473
+ *
1474
+ * @example
1475
+ * widget.setRefId('id');
1476
+ *
1477
+ * @param {string} refId - custom id
1478
+ */
1479
+ setRefId(refId: string): void;
1480
+ /**
1481
+ * Current method can set limit for payment sources count. In case when limit sets less then general count will be shown pagination buttons prev and next.
1482
+ *
1483
+ * @param {string} count - payment source count
1484
+ */
1485
+ setLimit(count: number): void;
1486
+ /**
1487
+ * Current method can change environment. By default environment = sandbox
1488
+ * Also we can change domain alias for this environment. By default domain_alias = paydock.com
1489
+ *
1490
+ * @example
1491
+ * widget.setEnv('production');
1492
+ * @param {string} env - sandbox, production
1493
+ * @param {string} [alias] - Own domain alias
1494
+ */
1495
+ setEnv(env: string, alias?: string): void;
1496
+ getEnv(): void;
1497
+ /**
1498
+ * Method for getting iframe's url
1499
+ */
1500
+ getIFrameUrl(): string;
1501
+ /**
1502
+ * Show payment source inside widget only with requested gateway ids
1503
+ *
1504
+ *
1505
+ * @param {string[]} ids - List of gateway_id
1506
+ */
1507
+ filterByGatewayIds(ids: string[]): void;
1508
+ /**
1509
+ *
1510
+ * Show payment source inside widget only with requested payment source types
1511
+ *
1512
+ * @param types - List of payment source types. Available parameters [PAYMENT_TYPE]{@link PAYMENT_TYPE}
1513
+ */
1514
+ filterByTypes(types: string[]): void;
1515
+ /**
1516
+ * Method for setting a custom language code
1517
+ *
1518
+ * @example
1519
+ * config.setLanguage('en');
1520
+ * @param {string} code - ISO 639-1
1521
+ */
1522
+ setLanguage(code: any): void;
1523
+ }
1524
+
1525
+ interface IEventSelectData extends IEventData$1 {
1526
+ customer_id: string;
1527
+ payment_source_id: string;
1528
+ gateway_id: string;
1529
+ primary: boolean;
1530
+ card_number_last4?: string;
1531
+ card_scheme?: string;
1532
+ checkout_email?: string;
1533
+ gateway_type?: string;
1534
+ payment_source_type: string;
1535
+ account_name?: string;
1536
+ account_number?: string;
1537
+ }
1538
+ interface IEventPaginationData extends IEventData$1 {
1539
+ total_item: number;
1540
+ skip: number;
1541
+ limit: number;
1542
+ }
1543
+ interface IEventAfterLoadData extends IEventData$1 {
1544
+ total_item: number;
1545
+ skip: number;
1546
+ limit: number;
1547
+ }
1548
+ interface IEventSizeData extends IEventData$1 {
1549
+ height: number;
1550
+ width: number;
1551
+ }
1552
+ /**
1553
+ * Interface of data from event.
1554
+ *
1555
+ * @interface IEventSelectData
1556
+ *
1557
+ * @param {string} event
1558
+ * @param {string} purpose
1559
+ * @param {string} message_source
1560
+ * @param {string} [ref_id]
1561
+ * @param {string} customer_id
1562
+ * @param {string} payment_source_id
1563
+ * @param {string} gateway_id
1564
+ * @param {boolean} primary
1565
+ * @param {string} [widget_id]
1566
+ * @param {string} [card_number_last4]
1567
+ * @param {string} [card_scheme]
1568
+ * @param {string} gateway_type
1569
+ * @param {string} [checkout_email]
1570
+ * @param {string} payment_source_type
1571
+ * @param {string} [account_name]
1572
+ * @param {string} [account_number]
1573
+ * */
1574
+ /**
1575
+ * Interface of data from event.
1576
+ *
1577
+ * @interface IEventPaginationData
1578
+ *
1579
+ * @param {string} event
1580
+ * @param {string} purpose
1581
+ * @param {string} message_source
1582
+ * @param {string} [ref_id]
1583
+ * @param {number} total_item
1584
+ * @param {number} skip
1585
+ * @param {number} limit
1586
+ * */
1587
+ /**
1588
+ * Interface of data from event.
1589
+ *
1590
+ * @interface IEventAfterLoadData
1591
+ *
1592
+ * @param {string} event The name of the event.
1593
+ * @param {string} purpose A system variable that states the purpose of the event.
1594
+ * @param {string} message_source A system variable that identifies the event source.
1595
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
1596
+ * @param {number} total_item Pagination param. Total item count
1597
+ * @param {number} skip Pagination param. Skip items from first item
1598
+ * @param {number} limit Pagination param. Query limit
1599
+ * */
1600
+ /**
1601
+ * Interface of data from event.
1602
+ * @interface IEventFinishData
1603
+ *
1604
+ * @param {string} event The name of the event.
1605
+ * @param {string} purpose A system variable that states the purpose of the event.
1606
+ * @param {string} message_source A system variable that identifies the event source.
1607
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
1608
+ * */
1609
+ /**
1610
+ * Interface of data from event.
1611
+ * @interface IEventSizeData
1612
+ *
1613
+ * @param {number} event The name of the event.
1614
+ * @param {number} purpose A system variable that states the purpose of the event.
1615
+ * @param {string} message_source A system variable that identifies the event source.
1616
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
1617
+ * @param {number} height Height of iFrame
1618
+ * @param {number} width Width of iFrame
1619
+ * */
1620
+ /**
1621
+ * List of available event's name
1622
+ *
1623
+ * @const EVENT
1624
+ *
1625
+ * @type {object}
1626
+ * @param {string} AFTER_LOAD=afterLoad
1627
+ * @param {string} SYSTEM_ERROR=systemError
1628
+ * @param {string} SELECT=select
1629
+ * @param {string} UNSELECT=unselect
1630
+ * @param {string} NEXT=next
1631
+ * @param {string} PREV=prev
1632
+ * @param {string} META_CHANGE=metaChange
1633
+ * @param {string} RESIZE=resize
1634
+ */
1635
+ /**
1636
+ * Class HtmlPaymentSourceWidget include method for working on html
1637
+ * @constructor
1638
+ * @extends PaymentSourceWidget
1639
+ *
1640
+ * @param {string} selector - Selector of html element. Container for widget
1641
+ * @param {string} publicKey - PayDock users public key
1642
+ * @param {string} queryToken - PayDock's query token that represents params to search customer by id or reference
1643
+ * @example
1644
+ * * var widget = new HtmlPaymentSourceWidget('#widget', 'publicKey','queryToken');
1645
+
1646
+ */
1647
+ declare class HtmlPaymentSourceWidget extends PaymentSourceWidget {
1648
+ protected container: Container;
1649
+ protected iFrame: IFrame;
1650
+ protected event: IFrameEvent;
1651
+ /** @constructs */ constructor(selector: string, publicKey: string, queryToken: string);
1652
+ /**
1653
+ * The final method to beginning, the load process of widget to html
1654
+ *
1655
+ */
1656
+ load(): void;
1657
+ /**
1658
+ * This callback will be called for each event in payment source widget
1659
+ *
1660
+ * @callback listener--PaymentSourceWidget
1661
+ * @param {IEventData | IEventSelectData | IEventPaginationData | IEventAfterLoadData} response
1662
+ */
1663
+ /**
1664
+ * Listen to events of widget
1665
+ *
1666
+ * @example
1667
+ *
1668
+ * widget.on('select', function (data) {
1669
+ * console.log(data);
1670
+ * });
1671
+ * @param {string} eventName - Available event names [EVENT]{@link EVENT}
1672
+ * @param {listener--PaymentSourceWidget} cb
1673
+ */
1674
+ on(eventName: string, cb: (data: IEventData$1 | IEventSelectData | IEventPaginationData | IEventAfterLoadData | IEventSizeData) => void): void;
1675
+ /**
1676
+ * Using this method you can hide widget after load
1677
+ * @param {boolean} [saveSize=false] - using this param you can save iframe's size
1678
+ */
1679
+ hide(saveSize: boolean): void;
1680
+ /**
1681
+ * Using this method you can show widget after using hide method
1682
+ *
1683
+ */
1684
+ show(): void;
1685
+ /**
1686
+ * Using this method you can reload widget
1687
+ *
1688
+ */
1689
+ reload(): void;
1690
+ /**
1691
+ * After select event of widget, data (dataType) will be insert to input (selector)
1692
+ *
1693
+ * @param {string} selector - css selector . [] #
1694
+ * @param {string} dataType - data type of [IEventSelectData]{@link IEventSelectData}.
1695
+ */
1696
+ onSelectInsert(selector: string, dataType: string): void;
1697
+ }
1698
+
1699
+ declare const TYPE: {
1700
+ EXTERNAL_CHECKOUT_TOKEN: string;
1701
+ CHECKOUT_TOKEN: string;
1702
+ BANK_ACCOUNT: string;
1703
+ CARD: string;
1704
+ };
1705
+ interface IBody {
1706
+ gateway_id: string;
1707
+ type: string;
1708
+ checkout_token?: string;
1709
+ }
1710
+ declare class Builder extends HttpCore {
1711
+ private body;
1712
+ constructor(gatewayID: string, checkoutToken: string, type: string);
1713
+ constructor(gatewayID: string, externalCheckoutToken: string, type: string);
1714
+ constructor(gatewayID: string, card: any, type: string);
1715
+ constructor(gatewayID: string, bankAccount: any, type: string);
1716
+ protected getLink(): string;
1717
+ send(accessToken: string, cb: (token: string) => void, errorCb?: (error: any) => void): void;
1718
+ getConfigs(): IBody;
1719
+ }
1720
+
1721
+ interface IBaseSRCMeta {
1722
+ customizations?: IStyles;
1723
+ dpa_data?: {
1724
+ dpa_presentation_name?: string;
1725
+ dpa_uri?: string;
1726
+ };
1727
+ dpa_transaction_options?: {
1728
+ dpa_locale?: string;
1729
+ dpa_accepted_billing_countries?: string[];
1730
+ consumer_name_requested?: boolean;
1731
+ consumer_email_address_requested?: boolean;
1732
+ consumer_phone_number_requested?: boolean;
1733
+ transaction_amount?: {
1734
+ transaction_amount?: number;
1735
+ transaction_currency_code?: string;
1736
+ };
1737
+ merchant_order_id?: string;
1738
+ merchant_category_code?: string;
1739
+ merchant_country_code?: string;
1740
+ };
1741
+ }
1742
+ interface PhoneNumber {
1743
+ country_code: string;
1744
+ phone_number: string;
1745
+ }
1746
+ interface Customer {
1747
+ email?: string;
1748
+ phone?: {
1749
+ country_code?: string;
1750
+ phone?: string;
1751
+ };
1752
+ first_name?: string;
1753
+ last_name?: string;
1754
+ }
1755
+ interface IClickToPayMeta extends IBaseSRCMeta {
1756
+ dpa_data?: IBaseSRCMeta['dpa_data'] & {
1757
+ dpa_address?: string;
1758
+ dpa_email_address?: string;
1759
+ dpa_phone_number?: PhoneNumber;
1760
+ dpa_logo_uri?: string;
1761
+ dpa_supported_email_address?: string;
1762
+ dpa_supported_phone_number?: PhoneNumber;
1763
+ dpa_uri?: string;
1764
+ dpa_support_uri?: string;
1765
+ application_type?: 'WEB_BROWSER' | 'MOBILE_APP';
1766
+ };
1767
+ disable_summary_screen?: boolean;
1768
+ co_brand_names?: string[];
1769
+ checkout_experience?: 'WITHIN_CHECKOUT' | 'PAYMENT_SETTINGS';
1770
+ services?: 'INLINE_CHECKOUT' | 'INLINE_INSTALLMENTS';
1771
+ dpa_transaction_options?: IBaseSRCMeta['dpa_transaction_options'] & {
1772
+ dpa_billing_preference?: MASTERCARD_DPA_SHIPPING_BILLING_PREFERENCE;
1773
+ payment_options?: Array<{
1774
+ dynamic_data_type?: string;
1775
+ }>;
1776
+ order_type?: MASTERCARD_ORDER_TYPE;
1777
+ three_ds_preference?: string;
1778
+ confirm_payment?: boolean;
1779
+ };
1780
+ customer?: Customer;
1781
+ unaccepted_card_type?: 'CREDIT' | 'DEBIT';
1782
+ recognition_token?: string;
1783
+ }
1784
+ type MASTERCARD_DPA_SHIPPING_BILLING_PREFERENCE = 'FULL' | 'POSTAL_COUNTRY' | 'NONE';
1785
+ type MASTERCARD_ORDER_TYPE = 'SPLIT_SHIPMENT' | 'PREFERRED_CARD';
1786
+ interface IStyles {
1787
+ primary_button_color?: string;
1788
+ secondary_button_color?: string;
1789
+ primary_button_text_color?: string;
1790
+ secondary_button_text_color?: string;
1791
+ font_family?: string;
1792
+ enable_src_popup?: boolean;
1793
+ }
1794
+
1795
+ declare class ApiChargeInternal {
1796
+ protected api: ApiInternal;
1797
+ constructor(api: ApiInternal);
1798
+ walletCapture(payload: WalletCaptureBody): Promise<WalletCaptureResponse>;
1799
+ walletCallback(payload: WalletCallbackBody): Promise<WalletCallbackResponse>;
1800
+ standalone3dsProcess(payload: Standalone3dsProcessBody): Promise<ProcessAuthenticationResponse>;
1801
+ standalone3dsHandle(): Promise<HandleResponseInterface>;
1802
+ }
1803
+ interface WalletCaptureResponse {
1804
+ id: string;
1805
+ amount: number;
1806
+ currency: string;
1807
+ status: string;
1808
+ }
1809
+ interface WalletCaptureBody {
1810
+ payment_method_id?: string;
1811
+ customer?: {
1812
+ payment_source?: {
1813
+ type?: string;
1814
+ card_name?: string;
1815
+ card_scheme?: string;
1816
+ card_number_last4?: string;
1817
+ expire_month?: number;
1818
+ expire_year?: number;
1819
+ address_line1?: string;
1820
+ address_line2?: string;
1821
+ address_city?: string;
1822
+ address_postcode?: string;
1823
+ address_state?: string;
1824
+ address_country?: string;
1825
+ external_payer_id?: string;
1826
+ ref_token?: string;
1827
+ wallet_express?: boolean;
1828
+ };
1829
+ };
1830
+ }
1831
+ interface WalletCallbackBody {
1832
+ request_type: string;
1833
+ }
1834
+ interface WalletCallbackResponse {
1835
+ id: string;
1836
+ status: string;
1837
+ callback_method: string;
1838
+ callback_rel: string;
1839
+ callback_url: string;
1840
+ }
1841
+ interface Standalone3dsProcessBody {
1842
+ charge_3ds_id: string;
1843
+ }
1844
+ interface HandleResponseInterface {
1845
+ status: string;
1846
+ error: string;
1847
+ result: {
1848
+ reference: string;
1849
+ reference_2: string;
1850
+ identifier: string;
1851
+ identifier_2: string;
1852
+ identifier_3: string;
1853
+ identifier_4: string;
1854
+ identifier_5: string;
1855
+ type: string;
1856
+ status: string;
1857
+ status_2: string;
1858
+ status_code: string;
1859
+ ref_token: string;
1860
+ cancellation: string;
1861
+ count: string;
1862
+ version: string;
1863
+ whitelist: {
1864
+ status: string;
1865
+ source: string;
1866
+ };
1867
+ result: string;
1868
+ };
1869
+ }
1870
+ interface ProcessAuthenticationResponse {
1871
+ status: string;
1872
+ error?: string;
1873
+ result?: {
1874
+ challenge: string;
1875
+ challenge_url: string;
1876
+ decoupled_challenge: boolean;
1877
+ frictionless: boolean;
1878
+ identifier: string;
1879
+ identifier_3: string;
1880
+ identifier_4: string;
1881
+ reference: string;
1882
+ reference_2: string;
1883
+ secondary_url: string;
1884
+ skipped: boolean;
1885
+ status: string;
1886
+ type: string;
1887
+ version: string;
1888
+ description?: string;
1889
+ };
1890
+ }
1891
+
1892
+ declare class ApiGatewayInternal {
1893
+ protected api: ApiInternal;
1894
+ constructor(api: ApiInternal);
1895
+ getWalletConfig(gateway_id: string): Promise<GetWalletConfigResponse>;
1896
+ }
1897
+ interface GetWalletConfigResponse {
1898
+ type: string;
1899
+ mode: string;
1900
+ credentials?: object;
1901
+ }
1902
+
1903
+ declare class ApiServiceInternal {
1904
+ protected api: ApiInternal;
1905
+ constructor(api: ApiInternal);
1906
+ getConfig(service_id: string): Promise<GetConfigResponse>;
1907
+ }
1908
+ interface GetConfigResponse {
1909
+ type: string;
1910
+ merchant: string;
1911
+ username: string;
1912
+ password: string;
1913
+ certificate: string;
1914
+ certificate_passphrase: string;
1915
+ }
1916
+
1917
+ declare class ApiCheckoutInternal {
1918
+ protected api: ApiInternal;
1919
+ constructor(api: ApiInternal);
1920
+ instructions(session_id: string): Observable<object>;
1921
+ callback(payload: Object): Promise<Object>;
1922
+ status(id: string): Promise<Object>;
1923
+ }
1924
+
1925
+ declare class ApiInternal extends ApiBase {
1926
+ charge(): ApiChargeInternal;
1927
+ service(): ApiServiceInternal;
1928
+ checkout(): ApiCheckoutInternal;
1929
+ gateway(): ApiGatewayInternal;
1930
+ }
1931
+
1932
+ interface SRCProvider {
1933
+ load(): void;
1934
+ getEnv(): string;
1935
+ hideButton?(saveSize: boolean): void;
1936
+ showButton?(): void;
1937
+ hideCheckout?(saveSize: boolean): void;
1938
+ showCheckout?(): void;
1939
+ reload(): void;
1940
+ useAutoResize?(): void;
1941
+ }
1942
+
1943
+ declare abstract class SRC {
1944
+ protected iframe_selector: string;
1945
+ protected service_id: string;
1946
+ protected public_key_or_access_token: string;
1947
+ protected meta: IClickToPayMeta;
1948
+ protected eventEmitter: EventEmitter;
1949
+ protected env: string;
1950
+ protected alias?: string;
1951
+ protected api: ApiInternal;
1952
+ protected provider: SRCProvider;
1953
+ protected autoResize: boolean;
1954
+ protected style: IStyles;
1955
+ constructor(iframe_selector: string, service_id: string, public_key_or_access_token: string, meta: IClickToPayMeta);
1956
+ /**
1957
+ * Object contain styles for widget - call before `.load()`.
1958
+ *
1959
+ * @example
1960
+ * widget.setStyles({
1961
+ * enable_src_popup: true
1962
+ * primary_button_color: 'red',
1963
+ * secondary_button_color: 'blue',
1964
+ * primary_button_text_color: 'white',
1965
+ * secondary_button_text_color: 'white',
1966
+ * font_family: 'Arial',
1967
+ * });
1968
+ * @param {IStyles} fields - name of styles which can be shown in widget [STYLE]{@link STYLE}
1969
+ */
1970
+ setStyles(styles: IStyles): void;
1971
+ private setStyle;
1972
+ load(): void;
1973
+ /**
1974
+ * Current method can change environment. By default environment = sandbox.
1975
+ * Also we can change domain alias for this environment. By default domain_alias = paydock.com
1976
+ *
1977
+ * @example
1978
+ * SRC.setEnv('production');
1979
+ * @param {string} env - sandbox, production
1980
+ * @param {string} [alias] - Own domain alias
1981
+ */
1982
+ setEnv(env: string, alias?: string): void;
1983
+ /**
1984
+ * Method to read the current environment
1985
+ *
1986
+ * @example
1987
+ * SRC.getEnv();
1988
+ */
1989
+ getEnv(): string;
1990
+ on(eventName: string): Promise<any>;
1991
+ on(eventName: string, cb: (data: any) => void): any;
1992
+ /**
1993
+ * Using this method you can hide checkout after load and button click
1994
+ * @param {boolean} [saveSize=false] - using this param you can save iframe's size (if applicable)
1995
+ *
1996
+ * @example
1997
+ * SRC.hideCheckout();
1998
+ */
1999
+ hideCheckout(saveSize: boolean): void;
2000
+ /**
2001
+ * Using this method you can show checkout after using hideCheckout method
2002
+ *
2003
+ * @example
2004
+ * SRC.showCheckout()
2005
+ */
2006
+ showCheckout(): void;
2007
+ /**
2008
+ * Using this method you can reload the whole checkout
2009
+ *
2010
+ * @example
2011
+ * SRC.reload()
2012
+ */
2013
+ reload(): void;
2014
+ /**
2015
+ * Use this method for resize checkout iFrame according to content height, if applicable
2016
+ *
2017
+ * @example
2018
+ * SRC.useAutoResize();
2019
+ *
2020
+ */
2021
+ useAutoResize(): void;
2022
+ }
2023
+
2024
+ /**
2025
+ * Class ClickToPay include methods for interacting with the ClickToPay checkout and Manual Card option
2026
+ *
2027
+ * @extends SRC
2028
+ *
2029
+ * @constructor
2030
+ *
2031
+ * @param {string} iframe_selector - Selector of html element. Container for Click To Pay checkout iFrame.
2032
+ * @param {string} service_id - Card Scheme Service ID
2033
+ * @param {string} public_key_or_access_token - Paydock public key or Access Token
2034
+ * @param {IClickToPayMeta} meta - Data that configures the Click To Pay checkout
2035
+ * @example
2036
+ * var mastercardSRC = new ClickToPay('#checkoutIframe', 'service_id', 'public_key', {});
2037
+ *
2038
+ */
2039
+ declare class ClickToPay extends SRC {
2040
+ protected iframe_selector: string;
2041
+ protected service_id: string;
2042
+ protected public_key_or_access_token: string;
2043
+ protected meta: IClickToPayMeta;
2044
+ /** @constructs */ constructor(iframe_selector: string, service_id: string, public_key_or_access_token: string, meta: IClickToPayMeta);
2045
+ /**
2046
+ * The final method after configuring the SRC to start the load process of Click To Pay checkout
2047
+ *
2048
+ */
2049
+ load(): void;
2050
+ }
2051
+
2052
+ interface ITriggerData {
2053
+ configuration_token?: string;
2054
+ tab_number?: number;
2055
+ elements?: string;
2056
+ form_values?: string;
2057
+ }
2058
+ /**
2059
+ * Interface for classes that represent a trigger data.
2060
+ * @interface ITriggerData
2061
+ *
2062
+ * @param {string} [configuration_token]
2063
+ * @param {string} [tab_number]
2064
+ * @param {string} [elements]
2065
+ * @param {string} [form_values]
2066
+ * */
2067
+ /**
2068
+ * List of available triggers
2069
+ *
2070
+ * @type {object}
2071
+ * @param {string} SUBMIT_FORM=submit_form
2072
+ * @param {string} CHANGE_TAB=tab
2073
+ * @param {string} HIDE_ELEMENTS=hide_elements
2074
+ * @param {string} SHOW_ELEMENTS=show_elements
2075
+ * @param {string} REFRESH_CHECKOUT=refresh_checkout
2076
+ * @param {string} UPDATE_FORM_VALUES=update_form_values
2077
+ * @param {string} INIT_CHECKOUT=init_checkout
2078
+ */
2079
+ declare const TRIGGER: {
2080
+ SUBMIT_FORM: string;
2081
+ CHANGE_TAB: string;
2082
+ HIDE_ELEMENTS: string;
2083
+ SHOW_ELEMENTS: string;
2084
+ REFRESH_CHECKOUT: string;
2085
+ UPDATE_FORM_VALUES: string;
2086
+ INIT_CHECKOUT: string;
2087
+ };
2088
+ declare class Trigger {
2089
+ protected iFrame: IFrame;
2090
+ constructor(iFrame: IFrame);
2091
+ push(triggerName: string, data?: ITriggerData): void;
2092
+ }
2093
+
2094
+ declare class VaultDisplayIframeEvent extends IFrameEvent {
2095
+ on<T>(eventName: string, widgetId: string, cb: (data: T) => void): void;
2096
+ }
2097
+
2098
+ /**
2099
+ * Class VaultDisplayWidget include method for working on html
2100
+ * @constructor
2101
+ *
2102
+ * @example
2103
+ * var widget = new VaultDisplayWidget('#widget', 'token');
2104
+ *
2105
+ * @param {string} selector - Selector of html element. Container for widget
2106
+ * @param {string} token - One time token
2107
+ */
2108
+ declare class VaultDisplayWidget {
2109
+ protected container: Container;
2110
+ protected iFrame: IFrame;
2111
+ protected triggerElement: Trigger;
2112
+ protected event: VaultDisplayIframeEvent;
2113
+ protected validationData: IFormValidation;
2114
+ protected vaultDisplayToken: string;
2115
+ protected link: Link;
2116
+ protected configs: any[];
2117
+ /** @constructs */ constructor(selector: string, token: string);
2118
+ /**
2119
+ * Current method can change environment. By default environment = sandbox.
2120
+ * Also we can change domain alias for this environment. By default domain_alias = paydock.com
2121
+ *
2122
+ * @example
2123
+ * widget.setEnv('production', 'paydock.com');
2124
+ * @param {string} env - sandbox, production
2125
+ * @param {string} [alias] - Own domain alias
2126
+ */
2127
+ setEnv(env: string, alias?: string): void;
2128
+ /**
2129
+ * This callback will be called for each event in widget
2130
+ *
2131
+ * @callback listener
2132
+ * @param {IEventData} response
2133
+ */
2134
+ on(eventName: string): Promise<IEventData$1>;
2135
+ on(eventName: string, cb: (data: IEventData$1) => void): any;
2136
+ /**
2137
+ * Object contain styles for widget
2138
+ *
2139
+ * @example
2140
+ * widget.setStyles({
2141
+ * background_color: '#fff',
2142
+ * border_color: 'yellow',
2143
+ * text_color: '#FFFFAA',
2144
+ * button_color: 'rgba(255, 255, 255, 0.9)',
2145
+ * font_size: '20px',
2146
+ * fort_family: 'fantasy'
2147
+ * });
2148
+ * @param {VaultDisplayStyle} fields - name of styles which can be shown in widget [VAULT_DISPLAY_STYLE]{@link VAULT_DISPLAY_STYLE}
2149
+ */
2150
+ setStyles(styles: IStyles$1): void;
2151
+ setStyle(param: string, value: string): void;
2152
+ /**
2153
+ * The final method to beginning, the load process of widget to html
2154
+ *
2155
+ */
2156
+ load(): void;
2157
+ }
2158
+
2159
+ interface IWalletServiceUpdateData {
2160
+ amount: number;
2161
+ shipping_options?: IShippingOption[];
2162
+ }
2163
+ interface IWalletServiceUpdate {
2164
+ success: boolean;
2165
+ body?: IWalletServiceUpdateData;
2166
+ }
2167
+ interface IPaymentMethod {
2168
+ payment_method_id?: string;
2169
+ device?: string;
2170
+ customer: {
2171
+ payer_name: string;
2172
+ payer_email: string;
2173
+ payer_phone: string;
2174
+ payment_source: {
2175
+ wallet_type: WALLET_TYPE;
2176
+ card_name: string;
2177
+ type: string;
2178
+ card_scheme: string;
2179
+ card_number_last4: string;
2180
+ expire_month: number;
2181
+ expire_year: number;
2182
+ address_line1: string;
2183
+ address_line2: string;
2184
+ address_city: string;
2185
+ address_postcode: string;
2186
+ address_state: string;
2187
+ address_country: string;
2188
+ ref_token?: string;
2189
+ };
2190
+ };
2191
+ shipping?: {
2192
+ method?: string;
2193
+ options?: IShippingOption[];
2194
+ address_line1?: string;
2195
+ address_line2?: string;
2196
+ address_city?: string;
2197
+ address_postcode?: string;
2198
+ address_state?: string;
2199
+ address_country?: string;
2200
+ address_company?: string;
2201
+ address_origin_postcode?: string;
2202
+ contact?: {
2203
+ first_name?: string;
2204
+ last_name?: string;
2205
+ email?: string;
2206
+ phone?: string;
2207
+ phone2?: string;
2208
+ };
2209
+ };
2210
+ }
2211
+ interface IUnavailableWalletEventBody {
2212
+ }
2213
+ interface IPaymentMethodSelectedWalletEventBody {
2214
+ data: IPaymentMethod;
2215
+ onSuccess: () => void;
2216
+ onError: (message?: string) => void;
2217
+ }
2218
+ interface IWalletService {
2219
+ load(container: Container): Promise<void>;
2220
+ close?(): void;
2221
+ update(data: IWalletServiceUpdate): void;
2222
+ enable(): void;
2223
+ disable(): void;
2224
+ setEnv(env: string): any;
2225
+ on(eventName: string, cb?: (data: IUnavailableWalletEventBody | IPaymentMethodSelectedWalletEventBody | any) => void): any;
2226
+ }
2227
+
2228
+ interface IWalletPaymentSuccessful {
2229
+ id: string;
2230
+ amount: number;
2231
+ currency: string;
2232
+ status: string;
2233
+ payer_name?: string;
2234
+ payer_email?: string;
2235
+ payer_phone?: string;
2236
+ }
2237
+ interface IWalletUnavailable {
2238
+ wallet?: WALLET_TYPE;
2239
+ }
2240
+ interface IWalletOnClick {
2241
+ attachResult: (result: Promise<void> | boolean) => void;
2242
+ }
2243
+ interface IWalletUpdate {
2244
+ wallet_response_code?: string;
2245
+ wallet_order_id?: string;
2246
+ wallet_session_id?: string;
2247
+ payment_source?: {
2248
+ wallet_payment_method_id?: string;
2249
+ card_number_last4?: string;
2250
+ card_scheme?: string;
2251
+ };
2252
+ wallet_loyalty_account?: {
2253
+ id?: string;
2254
+ barcode?: string;
2255
+ };
2256
+ shipping?: {
2257
+ address_line1?: string;
2258
+ address_line2?: string;
2259
+ address_postcode?: string;
2260
+ address_city?: string;
2261
+ address_state?: string;
2262
+ address_country?: string;
2263
+ address_company?: string;
2264
+ post_office_box_number?: string;
2265
+ wallet_address_id?: string;
2266
+ wallet_address_name?: string;
2267
+ wallet_address_created_timestamp?: string;
2268
+ wallet_address_updated_timestamp?: string;
2269
+ };
2270
+ selected_shipping_option?: IShippingOption;
2271
+ }
2272
+
2273
+ interface IEventData {
2274
+ event: string;
2275
+ data: void | IWalletPaymentSuccessful | IWalletUpdate | IWalletUnavailable | IWalletOnClick | any;
2276
+ }
2277
+ interface IWalletUpdateData {
2278
+ success: boolean;
2279
+ }
2280
+ /**
2281
+ * Class WalletButtons to work with different E-Wallets within html (currently supports Apple Pay, Google Pay, Google Pay™ and Apple Pay via Stripe, Flypay, Flypay V2, Paypal, Afterpay)
2282
+ * @constructor
2283
+ *
2284
+ * @example
2285
+ * var button = new WalletButtons('#wallet-buttons', 'charge-token', { amount_label: 'Total', country: 'us' });
2286
+ *
2287
+ * @param {string} selector - Selector of html element. Container for the WalletButtons.
2288
+ * @param {string} chargeToken - token for the wallet transaction, created with a secure call to `POST charges/wallet`.
2289
+ * @param {IWalletMeta} meta - data that configures the E-Wallet, which can be shown on checkout page and configures required customer information.
2290
+ */
2291
+ declare class WalletButtons {
2292
+ protected container: Container;
2293
+ protected api: ApiInternal;
2294
+ protected service: IWalletService;
2295
+ protected eventEmitter: EventEmitter;
2296
+ protected hasUpdateHandler: boolean;
2297
+ /** @constructs */ constructor(selector: string, chargeToken: string, meta: IWalletMeta);
2298
+ /**
2299
+ * Initializes the availability checks and inserts the button if possible.
2300
+ * Otherwise function onUnavailable(handler: VoidFunction) will be called.
2301
+ *
2302
+ * @example
2303
+ * var button = new WalletButtons(
2304
+ * '#buttons',
2305
+ * token,
2306
+ * {
2307
+ * amount_label: 'Total',
2308
+ * country: 'DE',
2309
+ * }
2310
+ * );
2311
+ * button.load();
2312
+ */
2313
+ load(): void;
2314
+ /**
2315
+ * Triggers the update process of the wallet, if available.
2316
+ * Currently supported by Flypay, Paypal and ApplePay/GooglePay via MPGS Wallets.
2317
+ *
2318
+ * @example
2319
+ * var button = new WalletButtons(
2320
+ * '#buttons',
2321
+ * token,
2322
+ * {
2323
+ * amount_label: 'Total',
2324
+ * country: 'DE',
2325
+ * }
2326
+ * );
2327
+ * button.on('update', (data) => {
2328
+ * updateChargeAmountInBackend(data);
2329
+ * button.update({ success: true });
2330
+ * });
2331
+ *
2332
+ * @example
2333
+ * // ApplePay via MPGS example:
2334
+ * var button = new WalletButtons(
2335
+ * '#buttons',
2336
+ * token,
2337
+ * {
2338
+ * amount_label: 'Total',
2339
+ * country: 'AU',
2340
+ * ...
2341
+ * }
2342
+ * );
2343
+ * button.on('update', (data) => {
2344
+ * updateChargeAmountInBackend(data);
2345
+ * button.update({
2346
+ * success: true,
2347
+ * body: {
2348
+ * amount: 15,
2349
+ * shipping_options: [
2350
+ * {
2351
+ * id: "NEW-FreeShip",
2352
+ * label: "NEW - Free Shipping",
2353
+ * detail: "Arrives in 3 to 5 days",
2354
+ * amount: "0.00"
2355
+ * },
2356
+ * {
2357
+ * id: "NEW - FastShip",
2358
+ * label: "NEW - Fast Shipping",
2359
+ * detail: "Arrives in less than 1 day",
2360
+ * amount: "10.00"
2361
+ * }
2362
+ * ]
2363
+ * }
2364
+ * });
2365
+ * });
2366
+ */
2367
+ update(data: IWalletUpdateData): void;
2368
+ /**
2369
+ * Current method can change environment. By default environment = sandbox.
2370
+ * Also we can change domain alias for this environment. By default domain_alias = paydock.com
2371
+ * Bear in mind that you must set an environment before calling `button.load()`.
2372
+ *
2373
+ * @example
2374
+ * button.setEnv('production', 'paydock.com');
2375
+ * @param {string} env - sandbox, production
2376
+ * @param {string} [alias] - Own domain alias
2377
+ */
2378
+ setEnv(env: string, alias?: string): void;
2379
+ /**
2380
+ * Current method can enable the payment button. This method is only supported for Flypay V2.
2381
+ *
2382
+ * @example
2383
+ * button.enable();
2384
+ */
2385
+ enable(): void;
2386
+ /**
2387
+ * Current method can disable the payment button. This method is only supported for Flypay V2.
2388
+ *
2389
+ * @example
2390
+ * button.disable('production', 'paydock.com');
2391
+ */
2392
+ disable(): void;
2393
+ /**
2394
+ * Closes the checkout forcibly. Currently supported in Flypay wallet.
2395
+ *
2396
+ * @example
2397
+ * button.close();
2398
+ */
2399
+ close(): void;
2400
+ on(eventName: string): Promise<IEventData>;
2401
+ on(eventName: string, cb: (data: IEventData) => void): any;
2402
+ /**
2403
+ * User to subscribe to the no button available event. This method is used after loading when the button is not available.
2404
+ * For MPGS, since can have more than one wallet button configured (ApplePay/GooglePay) you will receive a body (({ wallet: WALLET_TYPE.GOOGLE }) or ({ wallet: WALLET_TYPE.APPLE })) indicating which button is unavailable
2405
+ * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
2406
+ *
2407
+ * @example
2408
+ * button.onUnavailable(() => {
2409
+ * console.log('No wallet buttons available');
2410
+ * });
2411
+ *
2412
+ * @example
2413
+ * button.onUnavailable().then(() => console.log('No wallet buttons available'));
2414
+ *
2415
+ * @example
2416
+ * button.onUnavailable(function (data) {console.log('data.wallet :: ', data.wallet)});
2417
+ *
2418
+ * @param {listener} [handler] - Function to be called when no button is available.
2419
+ */
2420
+ onUnavailable(handler?: (data: IEventData) => void): Promise<void> | (() => void);
2421
+ /**
2422
+ * If the wallet performs some update in the checkout process, the function passed as parameter will be called.
2423
+ *
2424
+ * NOTE: make sure to call the `button.update(result)` method on handler completion.
2425
+ *
2426
+ * @example
2427
+ * button.onUpdate((data) => {
2428
+ * button.update({ success: true });
2429
+ * });
2430
+ *
2431
+ * @example
2432
+ * button.onUpdate().then((data) => throw new Error());
2433
+ *
2434
+ * @param {listener} [handler] - Function to be called when the payment was successful.
2435
+ */
2436
+ onUpdate(handler?: (data: IEventData) => void): Promise<unknown> | (() => void);
2437
+ /**
2438
+ * If the payment was successful, the function passed as parameter will be called.
2439
+ * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
2440
+ *
2441
+ * @example
2442
+ * button.onPaymentSuccessful((data) => {
2443
+ * console.log('Payment successful!');
2444
+ * });
2445
+ *
2446
+ * @example
2447
+ * button.onPaymentSuccessful().then((data) => console.log('Payment successful!'));
2448
+ *
2449
+ * @param {listener} [handler] - Function to be called when the payment was successful.
2450
+ */
2451
+ onPaymentSuccessful(handler?: (data: IEventData) => void): Promise<unknown> | (() => void);
2452
+ /**
2453
+ * If the payment was left in fraud review, the function passed as parameter will be called.
2454
+ * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
2455
+ *
2456
+ * @example
2457
+ * button.onPaymentInReview((data) => {
2458
+ * console.log('Payment in fraud review');
2459
+ * });
2460
+ *
2461
+ * @example
2462
+ * button.onPaymentInReview().then((data) => console.log('Payment in fraud review'));
2463
+ *
2464
+ * @param {listener} [handler] - Function to be called when the payment was left in fraud review status.
2465
+ */
2466
+ onPaymentInReview(handler?: (err: IEventData) => void): Promise<unknown> | (() => void);
2467
+ /**
2468
+ * If the payment was not successful, the function passed as parameter will be called.
2469
+ * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
2470
+ *
2471
+ * @example
2472
+ * button.onPaymentError((err) => {
2473
+ * console.log('Payment not successful');
2474
+ * });
2475
+ *
2476
+ * @example
2477
+ * button.onPaymentError().then((err) => console.log('Payment not successful'));
2478
+ *
2479
+ * @param {listener} [handler] - Function to be called when the payment was not successful.
2480
+ */
2481
+ onPaymentError(handler?: (err: IEventData) => void): Promise<unknown> | (() => void);
2482
+ /**
2483
+ * Registers a callback function to be invoked when authentication tokens are changed.
2484
+ * This function allows you to respond to changes in authentication tokens, such as when a user logs in.
2485
+ *
2486
+ * @example
2487
+ * button.onAuthTokensChanged((eventData) => {
2488
+ * console.log('Authentication tokens changed:', eventData);
2489
+ * });
2490
+ *
2491
+ * @example
2492
+ * button.onAuthTokensChanged().then((eventData) => {
2493
+ * console.log('Authentication tokens changed:', eventData);
2494
+ * });
2495
+ *
2496
+ * @param {listener} [handler] - Function to be called when authentication tokens are changed.
2497
+ */
2498
+ onAuthTokensChanged(handler?: (err: IEventData) => void): Promise<unknown> | (() => void);
2499
+ /**
2500
+ * Registers a callback function to be invoked when the wallet button gets clicked.
2501
+ * There are two operational modes supported, Synchronous and Asynchronous.
2502
+ * When asynchronous operations need to occur on the callback handler, attaching the Promise via `attachResult` is required to have the wallet wait for a result.
2503
+ * When synchronous operations occur on the callback handler, attaching a boolean result via `attachResult` is optional to control the execution flow.
2504
+ * Note this is supported for Paypal, GooglePay and ApplePay wallet buttons at the moment.
2505
+ *
2506
+ * @example
2507
+ * button.onClick((data) => {
2508
+ * performValidationLogic();
2509
+ * });
2510
+ *
2511
+ * @param {listener} handler - Function to be called when the wallet button is clicked.
2512
+ */
2513
+ onClick(handler: (data: IEventData) => void): () => void;
2514
+ /**
2515
+ * Registers a callback function to be invoked when the wallet checkout opens.
2516
+ * Note this is supported for FlypayV2 wallet button at the moment.
2517
+ *
2518
+ * @example
2519
+ * button.onCheckoutOpen((data) => {
2520
+ * console.log('Checkout opens');
2521
+ * });
2522
+ *
2523
+ * @param {listener} handler - Function to be called when the wallet checkout opens.
2524
+ */
2525
+ onCheckoutOpen(handler?: (err: IEventData) => void): Promise<unknown> | (() => void);
2526
+ /**
2527
+ * Registers a callback function to be invoked when the wallet checkout closes.
2528
+ * Note this is supported for FlypayV2 wallet button at the moment.
2529
+ *
2530
+ * @example
2531
+ * button.onCheckoutClose(() => {
2532
+ * console.log('Wallet checkout closes');
2533
+ * });
2534
+ *
2535
+ * @param {listener} handler - Function to be called when the wallet checkout closes.
2536
+ */
2537
+ onCheckoutClose(handler?: (err: IEventData) => void): Promise<unknown> | (() => void);
2538
+ private setupServiceCallbacks;
2539
+ private setupUnavailableCallback;
2540
+ private setupUpdateCallback;
2541
+ private setupOnClickCallback;
2542
+ private setupOnCheckoutOpenCallback;
2543
+ private setupOnCheckoutCloseCallback;
2544
+ private setupWalletCallback;
2545
+ private setupPaymentCallback;
2546
+ private setupPaymentSuccessCallback;
2547
+ private setupPaymentInReviewCallback;
2548
+ private setupPaymentErrorCallback;
2549
+ private setupAuthTokensChangedCallback;
2550
+ }
2551
+
2552
+ /**
2553
+ * Current constant include available type of element for styling
2554
+ * @const STYLABLE_ELEMENT
2555
+ * @type {object}
2556
+ * @param {string} INPUT=input.
2557
+ * These states are available: [STYLABLE_ELEMENT_STATE.ERROR]{@link STYLABLE_ELEMENT_STATE}, [STYLABLE_ELEMENT_STATE.FOCUS]{@link STYLABLE_ELEMENT_STATE}.
2558
+ * These styles are available [IElementStyleInput]{@link IElementStyleInput}
2559
+ * @param {string} SUBMIT_BUTTON=submit_button
2560
+ * These states are available: [STYLABLE_ELEMENT_STATE.HOVER]{@link STYLABLE_ELEMENT_STATE}.
2561
+ * These styles are available [IElementStyleSubmitButton]{@link IElementStyleSubmitButton}
2562
+ * @param {string} LABEL=label.
2563
+ * These styles are available [IElementStyleLabel]{@link IElementStyleLabel}
2564
+ * @param {string} TITLE=title.
2565
+ * These styles are available [IElementStyleTitle]{@link IElementStyleTitle}
2566
+ * @param {string} TITLE_DESCRIPTION=title_description.
2567
+ * These styles are available [IElementStyleTitleDescription]{@link IElementStyleTitleDescription}
2568
+ * */
2569
+ declare const STYLABLE_ELEMENT: {
2570
+ INPUT: string;
2571
+ SUBMIT_BUTTON: string;
2572
+ LABEL: string;
2573
+ TITLE: string;
2574
+ TITLE_DESCRIPTION: string;
2575
+ };
2576
+ /**
2577
+ * Current constant include available states of element for styling
2578
+ * @const STYLABLE_ELEMENT_STATE
2579
+ * @type {object}
2580
+ * @param {string} ERROR=error client|server validation. This state applies to: input
2581
+ * @param {string} FOCUS=focus focus. This state applies to: input
2582
+ * @param {string} HOVER=hover focus. This state applies to: submit_button
2583
+ * */
2584
+ declare const STYLABLE_ELEMENT_STATE: {
2585
+ ERROR: string;
2586
+ FOCUS: string;
2587
+ HOVER: string;
2588
+ };
2589
+ interface IElementStyleInput {
2590
+ color?: string;
2591
+ border?: string;
2592
+ border_radius?: string;
2593
+ background_color?: string;
2594
+ height?: string;
2595
+ text_decoration?: string;
2596
+ font_size?: string;
2597
+ font_family?: string;
2598
+ padding?: string;
2599
+ margin?: string;
2600
+ transition?: string;
2601
+ line_height?: string;
2602
+ font_weight?: string;
2603
+ }
2604
+ interface IElementStyleSubmitButton {
2605
+ color?: string;
2606
+ border?: string;
2607
+ border_radius?: string;
2608
+ background_color?: string;
2609
+ text_decoration?: string;
2610
+ font_size?: string;
2611
+ font_family?: string;
2612
+ padding?: string;
2613
+ margin?: string;
2614
+ transition?: string;
2615
+ line_height?: string;
2616
+ font_weight?: string;
2617
+ opacity?: string;
2618
+ }
2619
+ interface IElementStyleLabel {
2620
+ color?: string;
2621
+ text_decoration?: string;
2622
+ font_size?: string;
2623
+ font_family?: string;
2624
+ line_height?: string;
2625
+ font_weight?: string;
2626
+ padding?: string;
2627
+ margin?: string;
2628
+ }
2629
+ interface IElementStyleTitle {
2630
+ color?: string;
2631
+ text_decoration?: string;
2632
+ font_size?: string;
2633
+ font_family?: string;
2634
+ line_height?: string;
2635
+ font_weight?: string;
2636
+ padding?: string;
2637
+ margin?: string;
2638
+ }
2639
+ interface IElementStyleTitleDescription {
2640
+ color?: string;
2641
+ text_decoration?: string;
2642
+ font_size?: string;
2643
+ font_family?: string;
2644
+ line_height?: string;
2645
+ font_weight?: string;
2646
+ padding?: string;
2647
+ margin?: string;
2648
+ }
2649
+
2650
+ /**
2651
+ *
2652
+ * Class MultiWidget include method for for creating iframe url
2653
+ * @constructor
2654
+ *
2655
+ * @param {string} accessToken - PayDock users access token or public key
2656
+ * @param {(Configuration | string | Configuration[] | string[])} conf - exemplar[s] Configuration class OR configuration token
2657
+ *
2658
+ * @example
2659
+ * var widget = new MultiWidget('accessToken','configurationToken'); // With a pre-created configuration token
2660
+ *
2661
+ * var widget = new MultiWidget('accessToken',['configurationToken', 'configurationToken2']); // With pre-created configuration tokens
2662
+ *
2663
+ * var widget = new MultiWidget('accessToken', new Configuration('gatewayId')); With Configuration
2664
+ *
2665
+ * var widget = new MultiWidget('accessToken',[ With Configurations
2666
+ * Configuration('gatewayId'),
2667
+ * Configuration('gatewayId', 'bank_account')
2668
+ * ]);
2669
+ */
2670
+ declare class MultiWidget {
2671
+ protected link: Link;
2672
+ protected configs: Configuration[];
2673
+ protected configTokens: string[];
2674
+ protected accessToken: string;
2675
+ constructor(accessToken: string, confTokens: string[]);
2676
+ constructor(accessToken: string, confToken: string);
2677
+ constructor(accessToken: string, configs: Configuration[]);
2678
+ constructor(accessToken: string, conf: Configuration);
2679
+ /**
2680
+ * Object contain styles for widget
2681
+ *
2682
+ * @example
2683
+ * widget.setStyles({
2684
+ * background_color: 'rgb(0, 0, 0)',
2685
+ * border_color: 'yellow',
2686
+ * text_color: '#FFFFAA',
2687
+ * button_color: 'rgba(255, 255, 255, 0.9)',
2688
+ * font_size: '20px'
2689
+ * fort_family: 'fantasy'
2690
+ * });
2691
+ * @param {IStyles} fields - name of styles which can be shown in widget [STYLE]{@link STYLE}
2692
+ */
2693
+ setStyles(styles: IStyles$1): void;
2694
+ /**
2695
+ * Method to set a country code mask for the phone input.
2696
+ *
2697
+ * @example
2698
+ * widget.usePhoneCountryMask();
2699
+ *
2700
+ * @example
2701
+ * widget.usePhoneCountryMask({
2702
+ * default_country: 'au',
2703
+ * preferred_countries: ['au', 'gb'],
2704
+ * only_countries: ['au', 'gb', 'us', 'ua']
2705
+ * });
2706
+ *
2707
+ * @param {object} [options] - Options for configure the phone mask.
2708
+ * @param {string} [options.default_country] - Set a default country for the mask.
2709
+ * @param {Array.<string>} [options.preferred_countries] - Set list of preferred countries for the top of the select box .
2710
+ * @param {Array.<string>} [options.only_countries] - Set list of countries to show in the select box.
2711
+ */
2712
+ usePhoneCountryMask(options?: ICountryPhoneMask): void;
2713
+ setStyle(param: string, value: string): void;
2714
+ /**
2715
+ * Method for set different texts inside the widget
2716
+ *
2717
+ * @example
2718
+ * widget.setTexts({
2719
+ * title: 'Your card',
2720
+ * finish_text: 'Payment resource was successfully accepted',
2721
+ * title_description: '* indicates required field',
2722
+ * submit_button: 'Save',
2723
+ * submit_button_processing: 'Load...',
2724
+ * });
2725
+ *
2726
+ * @param {ITexts} fields - name of text items which can be shown in widget [TEXT]{@link TEXT}
2727
+ */
2728
+ setTexts(texts: ITexts): void;
2729
+ setText(param: string, value: string): void;
2730
+ setElementStyle(element: string, state: string, styles: IElementStyleInput | IElementStyleSubmitButton | IElementStyleLabel): any;
2731
+ setElementStyle(element: string, styles: IElementStyleInput | IElementStyleSubmitButton | IElementStyleLabel | IElementStyleTitle | IElementStyleTitleDescription): any;
2732
+ /**
2733
+ * The method to set the predefined values for the form fields inside the widget
2734
+ *
2735
+ * @example
2736
+ * widget.setFormValues({
2737
+ * email: 'predefined@email.com',
2738
+ * card_name: 'Houston'
2739
+ * });
2740
+ *
2741
+ * @param { Object } fieldValues - Key of object is one of [FORM_FIELD]{@link FORM_FIELD}, The object value is what we are expecting
2742
+ */
2743
+ setFormValues(fieldValues: IFormValues): void;
2744
+ setFormValue(key: string, value: string): void;
2745
+ /**
2746
+ * The method to set custom form field labels
2747
+ *
2748
+ * @example
2749
+ * widget.setFormPlaceholders({
2750
+ * card_name: 'Card Holder Name',
2751
+ * email: 'Email For Receipt'
2752
+ * })
2753
+ *
2754
+ * @param { Object } fieldLabels - Key of object is one of [FORM_FIELD]{@link FORM_FIELD}, The object value is what we are expecting
2755
+ */
2756
+ setFormLabels(fieldLabels: IFormLabels): void;
2757
+ setFormLabel(key: string, label: string): void;
2758
+ /**
2759
+ * The method to set custom form fields placeholders
2760
+ *
2761
+ * @example
2762
+ * widget.setFormPlaceholders({
2763
+ * card_name: 'Input your card holder name...',
2764
+ * email: 'Input your email, like test@example.com'
2765
+ * })
2766
+ *
2767
+ * @param { Object } fieldPlaceholders - Key of object is one of [FORM_FIELD]{@link FORM_FIELD}, Value of object is expected placeholder
2768
+ */
2769
+ setFormPlaceholders(fieldPlaceholders: IFormPlaceholders): void;
2770
+ setFormPlaceholder(key: string, placeholder: string): void;
2771
+ /**
2772
+ * The method to set the full configuration for the all specific form elements (label, placeholder, value)
2773
+ * You can also use the other method for the partial configuration like: setFormValues, setFormPlaceholder, setFormLabel
2774
+ *
2775
+ * @example
2776
+ * widget.setFormElements([
2777
+ * {
2778
+ * field: 'card_name',
2779
+ * placeholder: 'Input your card holder name...',
2780
+ * label: 'Card Holder Name',
2781
+ * value: 'Houston',
2782
+ * },
2783
+ * {
2784
+ * field: 'email',
2785
+ * placeholder: 'Input your email, like test@example.com',
2786
+ * label: 'Email For Receipt',
2787
+ * value: 'predefined@email.com',
2788
+ * },
2789
+ * ])
2790
+ *
2791
+ * @param { string } elements - The list of elements
2792
+ * @param { string } elements[].field - Field name of the element [FORM_FIELD]{@link FORM_FIELD}
2793
+ * @param { string } elements[].placeholder - Set custom form field placeholder
2794
+ * @param { string } elements[].label - Set custom labels near form field
2795
+ * @param { string } elements[].value - Set predefined values for the form field
2796
+ */
2797
+ setFormElements(elements: IFormElement[]): void;
2798
+ setFormElement(element: IFormElement): void;
2799
+ /**
2800
+ * The method to change the widget icons
2801
+ *
2802
+ * @deprecated
2803
+ */
2804
+ setIcons(icons: IIcons): void;
2805
+ setIcon(key: string, value: string): void;
2806
+ /**
2807
+ * Using this method you can set hidden elements inside widget
2808
+ *
2809
+ * @example
2810
+ * widget.setHiddenElements(['submit_button', 'email']);
2811
+ *
2812
+ * @param {string[]} elements - list of element which can be hidden [ELEMENT]{@link ELEMENT} || [FORM_FIELD]{@link FORM_FIELD}
2813
+ */
2814
+ setHiddenElements(elements: string[]): void;
2815
+ /**
2816
+ * Current method can set custom ID to identify the data in the future
2817
+ *
2818
+ * @example
2819
+ * widget.setRefId('id');
2820
+ *
2821
+ * @param {string} refId - custom id
2822
+ */
2823
+ setRefId(refId: string): void;
2824
+ /**
2825
+ * Current method can add visual validation from gateway to widget's form fields
2826
+ *
2827
+ * @example
2828
+ * widget.useGatewayFieldValidation();
2829
+ */
2830
+ useGatewayFieldValidation(): void;
2831
+ /**
2832
+ * Current method can set icons of supported card types
2833
+ *
2834
+ * @example
2835
+ *
2836
+ * widget.setSupportedCardIcons(['mastercard', 'visa'], validateCardNumberInput);
2837
+ *
2838
+ * @param {string[]} elements - [SUPPORTED_CARD_TYPES]{@link SUPPORTED_CARD_TYPES}
2839
+ * @param {boolean} validateCardNumberInput - [validateCardNumberInput=false] - using this param you allow validation for card number input on supported card types
2840
+ */
2841
+ setSupportedCardIcons(elements: string[], validateCardNumberInput?: boolean): void;
2842
+ /**
2843
+ * Current method can change environment. By default environment = sandbox.
2844
+ * Also we can change domain alias for this environment. By default domain_alias = paydock.com
2845
+ *
2846
+ * @example
2847
+ * widget.setEnv('production', 'paydock.com');
2848
+ * @param {string} env - sandbox, production
2849
+ * @param {string} [alias] - Own domain alias
2850
+ */
2851
+ setEnv(env: string, alias?: string): void;
2852
+ getEnv(): void;
2853
+ /**
2854
+ * Method for creating iframe url
2855
+ *
2856
+ * @example
2857
+ * widget.loadIFrameUrl(function (url) {
2858
+ * console.log(url);
2859
+ * }, function (errors) {
2860
+ * console.log(errors);
2861
+ * });
2862
+ */
2863
+ loadIFrameUrl(cb: (url: string) => void, errorCb?: (errors: string[]) => void): void;
2864
+ /**
2865
+ * Method for setting a custom language code
2866
+ *
2867
+ * @example
2868
+ * config.setLanguage('en');
2869
+ * @param {string} code - ISO 639-1
2870
+ */
2871
+ setLanguage(code: any): void;
2872
+ }
2873
+
2874
+ interface IEventMetaData extends IEventData$1 {
2875
+ configuration_token: string;
2876
+ type: string;
2877
+ account_name?: string;
2878
+ account_number?: string;
2879
+ card_number_last4?: string;
2880
+ card_number_length?: number;
2881
+ card_scheme?: string;
2882
+ gateway_type?: string;
2883
+ }
2884
+ interface IEventFinishData extends IEventData$1 {
2885
+ payment_source: string;
2886
+ payment_source_token?: string;
2887
+ }
2888
+ /**
2889
+ * Interface of data from validation event.
2890
+ *
2891
+ * @interface IFormValidation
2892
+ *
2893
+ * @param {string} event The name of the event.
2894
+ * @param {string} message_source A system variable that identifies the event source.
2895
+ * @param {string} purpose A system variable that states the purpose of the event.
2896
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
2897
+ * @param {boolean} [form_valid] Indicates wether or not the form is valid.
2898
+ * @param {Array<string>} [invalid_fields] Names of form fields with invalid data.
2899
+ * @param {Array<string>} [invalid_showed_fields] Names of invalid form fields which are already displaying the error.
2900
+ * @param {Partial<Record<CardValidatorValue | GenericValidatorValue, Array<string>>>} [validators] Object containing validator identifiers as keys and the fields subject to that validator as an array of form field names.
2901
+ * See list of available [Generic Vallidators]{@link GENERIC_VALIDATORS} and [Card Validators]{@link CARD_VALIDATORS},
2902
+ */
2903
+ /**
2904
+ * Contains basic information associated with the event and additional meta data
2905
+ * specific to the event. E.g., card info, gateway info, etc.
2906
+ *
2907
+ * @interface IEventMetaData
2908
+ *
2909
+ * @param {string} event The name of the event.
2910
+ * @param {string} purpose A system variable that states the purpose of the event.
2911
+ * @param {string} message_source A system variable that identifies the event source.
2912
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
2913
+ * @param {string} configuration_token Token received from our API with widget data
2914
+ * @param {string} type Payment type 'card', 'bank_account'
2915
+ * @param {string} gateway_type Gateway type
2916
+ * @param {string} [card_number_last4] Last 4 digit of your card
2917
+ * @param {string} [card_scheme] Card scheme, e.g., (Visa, Mastercard and American Express (AmEx))
2918
+ * @param {number} [card_number_length] Card number length
2919
+ * @param {string} [account_name] Bank account account name
2920
+ * @param {string} [account_number] Bank account account number
2921
+ * */
2922
+ /**
2923
+ * Interface of data from event.
2924
+ * @interface IEventAfterLoadData
2925
+ *
2926
+ * @param {string} event The name of the event.
2927
+ * @param {string} purpose A system variable that states the purpose of the event.
2928
+ * @param {string} message_source A system variable that identifies the event source.
2929
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
2930
+ * */
2931
+ /**
2932
+ * Interface of data from event.
2933
+ * @interface IEventFinishData
2934
+ *
2935
+ * @param {string} event The name of the event.
2936
+ * @param {string} purpose A system variable that states the purpose of the event.
2937
+ * @param {string} message_source A system variable that identifies the event source.
2938
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
2939
+ * @param {string} payment_source One time token. Result from this endpoint [API docs](https://docs.paydock.com/#tokens)
2940
+ * */
2941
+ /**
2942
+ * List of available event's name
2943
+ * @const EVENT
2944
+ *
2945
+ * @type {object}
2946
+ * @param {string} AFTER_LOAD=afterLoad
2947
+ * @param {string} SUBMIT=submit
2948
+ * @param {string} FINISH=finish
2949
+ * @param {string} VALIDATION=validation
2950
+ * @param {string} VALIDATION_ERROR=validationError
2951
+ * @param {string} SYSTEM_ERROR=systemError
2952
+ * @param {string} META_CHANGE=metaChange
2953
+ * @param {string} RESIZE=resize
2954
+ */
2955
+ /**
2956
+ * List of available event's name
2957
+ * @const VAULT_DISPLAY_EVENT
2958
+ *
2959
+ * @type {object}
2960
+ * @param {string} AFTER_LOAD=afterLoad
2961
+ * @param {string} SYSTEM_ERROR=system_error
2962
+ * @param {string} CVV_SECURE_CODE_REQUESTED=cvv_secure_code_requested
2963
+ * @param {string} CARD_NUMBER_SECURE_CODE_REQUESTED=card_number_secure_code_requested
2964
+ * @param {string} ACCESS_FORBIDDEN=access_forbidden
2965
+ * @param {string} SESSION_EXPIRED=systemError
2966
+ * @param {string} SYSTEM_ERROR=session_expired
2967
+ * @param {string} OPERATION_FORBIDDEN=operation_forbidden
2968
+ */
2969
+ /**
2970
+ * Class HtmlMultiWidget include method for working with html
2971
+ * @constructor
2972
+ * @extends MultiWidget
2973
+ *
2974
+ * @param {string} selector - Selector of html element. Container for widget
2975
+ * @param {string} publicKey - PayDock users public key
2976
+ * @param {(Configuration | string | Configuration[] | string[])} conf - exemplar[s] Configuration class OR configuration token
2977
+ * @example
2978
+ * var widget = new MultiWidget('#widget', 'publicKey','configurationToken'); // With a pre-created configuration token
2979
+ *
2980
+ * var widget = new MultiWidget('#widget', 'publicKey',['configurationToken', 'configurationToken2']); // With pre-created configuration tokens
2981
+ *
2982
+ * var widget = new MultiWidget('#widget', 'publicKey', new Configuration('gatewayId')); With Configuration
2983
+ *
2984
+ * var widget = new MultiWidget('#widget', 'publicKey',[ With Configurations
2985
+ * Configuration(), // default gateway_id,
2986
+ * Configuration('not_configured'), // without gateway,
2987
+ * Configuration('gatewayId'),
2988
+ * Configuration('gatewayId', 'bank_account')
2989
+ * ]);
2990
+ */
2991
+ declare class HtmlMultiWidget extends MultiWidget {
2992
+ protected container: Container;
2993
+ protected iFrame: IFrame;
2994
+ protected triggerElement: Trigger;
2995
+ protected event: IFrameEvent;
2996
+ protected validationData: IFormValidation;
2997
+ /** @constructs */ constructor(selector: string, publicKey: string, conf: any);
2998
+ /**
2999
+ * Loads the widget.
3000
+ *
3001
+ * Calling this method results in an iframe element being inserted and rendered in the DOM.
3002
+ */
3003
+ load(): void;
3004
+ /**
3005
+ * Registers a form validation callback for validation events.
3006
+ */
3007
+ protected afterLoad(): void;
3008
+ /**
3009
+ * Listen to events of widget
3010
+ *
3011
+ * @example
3012
+ *
3013
+ * ```javascript
3014
+ * widget.on('form_submit', function (data) {
3015
+ * console.log(data);
3016
+ * });
3017
+ * ```
3018
+ *
3019
+ * @example
3020
+ *
3021
+ * ```javascript
3022
+ * widget.on('form_submit').then(function (data) {
3023
+ * console.log(data);
3024
+ * });
3025
+ * ```
3026
+ *
3027
+ * @typedef {(data: IEventData | IEventMetaData | IEventFinishData | IFormValidation) => void} EventListenerCallback
3028
+ *
3029
+ * @param {string} eventName - The name of the event that should be listened. Available event names [EVENT]{@link EVENT}.
3030
+ * @param {EventListenerCallback} [cb] - A function to be invoked whenever the event occurs.
3031
+ *
3032
+ * @return {Promise<IEventData | IEventMetaData | IEventFinishData | IFormValidation> | void}
3033
+ */
3034
+ on(eventName: string): Promise<IEventData$1 | IEventMetaData | IEventFinishData | IFormValidation>;
3035
+ on(eventName: string, cb: (data: IEventData$1 | IEventMetaData | IEventFinishData | IFormValidation) => void): any;
3036
+ /**
3037
+ * Registers callback that will be invoked for every trigger.
3038
+ *
3039
+ * @param {'submit_form' | 'tab'} triggers - The Widget element identifier that caused the trigger.
3040
+ * @param {ITriggerData} data - Data that will be sent to the widget when the trigger occurs.
3041
+ */
3042
+ trigger(triggerName: string, data?: ITriggerData): void;
3043
+ /**
3044
+ * Gets a reference to the form current validation state.
3045
+ *
3046
+ * !Warning: do not directly modify the values of the returned object.
3047
+ *
3048
+ * @return {IFormValidation} Form validation object
3049
+ */
3050
+ getValidationState(): IFormValidation;
3051
+ /**
3052
+ * Checks if a given form is valid.
3053
+ *
3054
+ * A form is valid if all form fields are valid.
3055
+ *
3056
+ * @return {boolean} Indicates wether or not form is valid.
3057
+ */
3058
+ isValidForm(): boolean;
3059
+ /**
3060
+ * Using this method you can check if a specific form field is invalid
3061
+ *
3062
+ * @param {string} field - Field name
3063
+ * @return {boolean} Field is invalid
3064
+ */
3065
+ isInvalidField(field?: string): boolean;
3066
+ /**
3067
+ * Checks if a given form field is displaying an error.
3068
+ *
3069
+ * @param {string} field - The form field name
3070
+ *
3071
+ * @return {boolean} Indicates wether or not the Error message is being displayed on the associated field.
3072
+ */
3073
+ isFieldErrorShowed(field?: string): boolean;
3074
+ /**
3075
+ * Checks if a given form field is valid or invalid by name.
3076
+ *
3077
+ * @param {string} field - The form field name
3078
+ * @param validator - The name of the validator.
3079
+ *
3080
+ * @return {boolean} Indicates wether or not the field is invalid based on validator intepretation.
3081
+ */
3082
+ isInvalidFieldByValidator(field: string, validator: ValidatorFieldsMapKey): boolean;
3083
+ /**
3084
+ * Hides the widget.
3085
+ *
3086
+ * E.g., use this method to hide the widget after it loads.
3087
+ *
3088
+ * @param {boolean} [saveSize=false] Wether the original iframe element size should be saved before being hidden.
3089
+ */
3090
+ hide(saveSize: boolean): void;
3091
+ /**
3092
+ * Shows the widget.
3093
+ *
3094
+ * E.g., use this method to show the widget after it was explicitly hidden.
3095
+ */
3096
+ show(): void;
3097
+ /**
3098
+ * Reloads the widget.
3099
+ */
3100
+ reload(): void;
3101
+ /**
3102
+ * Hides the specified Widget elements by their identifier.
3103
+ *
3104
+ * @example
3105
+ *
3106
+ * ```javascript
3107
+ * widget.hideElements(['submit_button', 'email']);
3108
+ * ```
3109
+ *
3110
+ * @param {string[]} elements - List of element which can be hidden [ELEMENT]{@link ELEMENT} || [FORM_FIELD]{@link FORM_FIELD}
3111
+ */
3112
+ hideElements(elements: string[]): void;
3113
+ /**
3114
+ * Shows the specified Widget elements by their identifier.
3115
+ *
3116
+ * @example
3117
+ *
3118
+ * ```javascript
3119
+ * widget.showElements(['submit_button', 'email']);
3120
+ * ```
3121
+ *
3122
+ * @param {string[]} elements - List of elements which can be showed [ELEMENT]{@link ELEMENT} || [FORM_FIELD]{@link FORM_FIELD}
3123
+ */
3124
+ showElements(elements: string[]): void;
3125
+ /**
3126
+ * Updates the form field values inside the widget.
3127
+ *
3128
+ * @example
3129
+ *
3130
+ * ```javascript
3131
+ * widget.updateFormValues({
3132
+ * email: 'predefined@email.com',
3133
+ * card_name: 'Houston'
3134
+ * });
3135
+ *```
3136
+ *
3137
+ * @param {IFormValues} fieldValues - Fields with values
3138
+ */
3139
+ updateFormValues(fieldValues: IFormValues): void;
3140
+ /**
3141
+ * Updates a single form field values inside the widget by the form field name.
3142
+ *
3143
+ * @example
3144
+ *
3145
+ * ```javascript
3146
+ * widget.updateFormValue("card_name", "John Doe");
3147
+ *```
3148
+ *
3149
+ * @param {string} key - The form field name
3150
+ * @param {string} value - The form field value
3151
+ */
3152
+ updateFormValue(key: string, value: string): void;
3153
+ /**
3154
+ * Inserts the event data (after finish event) onto the input field associated with the provided CSS selector.
3155
+ *
3156
+ * @param {string} selector - A CSS selector. E.g., ".my-class", "#my-id", or others
3157
+ * @param {string} dataType - The data type of IEventData object.
3158
+ */
3159
+ onFinishInsert(selector: string, dataType: string): void;
3160
+ /**
3161
+ * Intercepts a form submission and delegates processing to the widget.
3162
+ *
3163
+ * An simplified example of the process:
3164
+ * - User clicks submit button in your form
3165
+ * - This implicitly triggers a submission to the widget
3166
+ * - The widget submits your form
3167
+ *
3168
+ * @note The widget's submit button will be hidden.
3169
+ *
3170
+ * @param {string} selector - css selector of your form
3171
+ *
3172
+ * @example
3173
+ *
3174
+ * ```html
3175
+ * <body>
3176
+ * <form id="myForm">
3177
+ * <input name="amount">
3178
+ * <button type="submit">Submit</button>
3179
+ * </form>
3180
+ * <script>
3181
+ * widget.interceptSubmitForm('#myForm');
3182
+ * </script>
3183
+ * </body>
3184
+ * ```
3185
+ */
3186
+ interceptSubmitForm(selector: string): void;
3187
+ /**
3188
+ * This method hides a submit button and automatically execute form submit
3189
+ */
3190
+ useCheckoutAutoSubmit(): void;
3191
+ /**
3192
+ * Use this method for resize iFrame according content height
3193
+ *
3194
+ * @example
3195
+ *
3196
+ * ```javascript
3197
+ * widget.useAutoResize();
3198
+ *```
3199
+ */
3200
+ useAutoResize(): void;
3201
+ }
3202
+
3203
+ /**
3204
+ * Class Widget include method for working on html and include extended by HtmlMultiWidget methods
3205
+ * @constructor
3206
+ * @extends HtmlMultiWidget
3207
+ * @extends MultiWidget
3208
+ *
3209
+ * @example
3210
+ * var widget = new HtmlWidget('#widget', 'publicKey', 'gatewayID'); // short
3211
+ *
3212
+ * var widget = new HtmlWidget('#widget', 'publicKey', 'gatewayID', 'bank_account', 'payment_source'); // extend
3213
+ *
3214
+ * var widget = new HtmlWidget('#widget', 'publicKey', 'not_configured'); // without gateway
3215
+ *
3216
+ * @param {string} selector - Selector of html element. Container for widget
3217
+ * @param {string} publicKey - PayDock users public key
3218
+ * @param {string} [gatewayID=default] - ID of a gateway connected to PayDock. By default or if put 'default', it will use the selected default gateway. If put 'not_configured', it won’t use gateway to create downstream token.
3219
+ * @param {string} [paymentType=card] - Type of payment source which shows in widget form. Available parameters : “card”, “bank_account”.
3220
+ * @param {string} [purpose=payment_source] - Purpose of widget form. Available parameters: ‘payment_source’, ‘card_payment_source_with_cvv’, ‘card_payment_source_without_cvv’
3221
+ */
3222
+ declare class HtmlWidget extends HtmlMultiWidget {
3223
+ /** @constructs */ constructor(selector: string, publicKey: string, gatewayID?: string, paymentType?: string, purpose?: string);
3224
+ /**
3225
+ * Destination, where customer will receive all successful responses.
3226
+ * Response will contain “data” object with “payment_source” or other parameters, in depending on 'purpose'
3227
+ *
3228
+ * @example
3229
+ * widget.setWebHookDestination('http://google.com');
3230
+ *
3231
+ * @param {string} url - Your endpoint for post request.
3232
+ */
3233
+ setWebHookDestination(url: string): void;
3234
+ /**
3235
+ * URL to which the Customer will be redirected to after the success finish
3236
+ *
3237
+ * @example
3238
+ * widget.setSuccessRedirectUrl('google.com/search?q=success');
3239
+ *
3240
+ * @param {string} url
3241
+ */
3242
+ setSuccessRedirectUrl(url: string): void;
3243
+ /**
3244
+ * URL to which the Customer will be redirected to if an error is triggered in the process of operation
3245
+ *
3246
+ * @example
3247
+ * widget.setErrorRedirectUrl('google.com/search?q=error');
3248
+ *
3249
+ * @param {string} url
3250
+ */
3251
+ setErrorRedirectUrl(url: string): void;
3252
+ /**
3253
+ * Set list with widget form field, which will be shown in form. Also you can set the required validation for these fields
3254
+ *
3255
+ * @example
3256
+ * widget.setFormFields(['phone', 'email', 'first_name*']);
3257
+ *
3258
+ * @param {string[]} fields - name of fields which can be shown in a widget.
3259
+ * If after a name of a field, you put “*”, this field will be required on client-side. (For validation, you can specify any fields, even those that are shown by default: card_number, expiration, etc... ) [FORM_FIELD]{@link FORM_FIELD}
3260
+ */
3261
+ setFormFields(fields: string[]): void;
3262
+ /**
3263
+ * The method to set the full configuration for the all specific form elements (visibility, required, label, placeholder, value)
3264
+ * You can also use the other method for the partial configuration like: setFormFields, setFormValues, setFormPlaceholder, setFormLabel
3265
+ *
3266
+ * @example
3267
+ * widget.setFormElements([
3268
+ * {
3269
+ * field: 'card_name*',
3270
+ * placeholder: 'Input your card holder name...',
3271
+ * label: 'Card Holder Name',
3272
+ * value: 'Houston',
3273
+ * },
3274
+ * {
3275
+ * field: 'email',
3276
+ * placeholder: 'Input your email, like test@example.com',
3277
+ * label: 'Email for the receipt',
3278
+ * value: 'predefined@email.com',
3279
+ * },
3280
+ * ])
3281
+ *
3282
+ * @param { Object[] } elements - List of elements
3283
+ * @param { string } elements[].field - Field name of element. If after a name of a field, you put “*”, this field will be required on client-side. (For validation, you can specify any fields, even those that are shown by default: card_number, expiration, etc... ) [FORM_FIELD]{@link FORM_FIELD}
3284
+ * @param { string } elements[].placeholder - Set custom placeholders in form fields
3285
+ * @param { string } elements[].label - Set a custom labels near the form field
3286
+ * @param { string } elements[].value - Set predefined values for the form field
3287
+ */
3288
+ setFormElements(elements: IFormElement[]): void;
3289
+ setFormElement(element: IFormElement): void;
3290
+ /**
3291
+ * The method to set meta information for the checkout page
3292
+ *
3293
+ * @example
3294
+ * config.setMeta({
3295
+ brand_name: 'paydock',
3296
+ reference: '15',
3297
+ email: 'wault@paydock.com'
3298
+ });
3299
+ *
3300
+ * @param {IPayPalMeta | IBamboraMeta} object - data which can be shown on checkout page [IPayPalMeta]{@link IPayPalMeta} [IBamboraMeta]{@link IBamboraMeta}
3301
+ */
3302
+ setMeta(meta: IPayPalMeta | IBamboraMeta): void;
3303
+ setGiftCardScheme(giftCardScheme: any, processingNetwork: any): void;
3304
+ }
3305
+
3306
+ type Instruction = new (selector: string, formSelector: string, api: ApiInternal) => InstructionHandler & InstructionDestroyable & InstructionDecorated;
3307
+ interface InstructionHandleable {
3308
+ handle(payload: object, eventEmitter: EventEmitter): void;
3309
+ }
3310
+ interface InstructionDecorated {
3311
+ instruction: string;
3312
+ }
3313
+ interface InstructionDestroyable {
3314
+ destroy(): void;
3315
+ }
3316
+ declare abstract class InstructionHandler implements InstructionHandleable, InstructionDestroyable, InstructionDecorated {
3317
+ selector: string;
3318
+ formSelector: string;
3319
+ api: ApiInternal;
3320
+ constructor(selector: string, formSelector: string, api: ApiInternal);
3321
+ instruction: string;
3322
+ abstract handle(context: object, eventEmitter?: any): void;
3323
+ abstract destroy(): void;
3324
+ getEnv(instruction_token: string): string;
3325
+ }
3326
+
3327
+ declare class InstructionModule {
3328
+ instructions: any[];
3329
+ getInstruction(id: string): Instruction | null;
3330
+ }
3331
+
3332
+ interface IntentTokenPayload {
3333
+ env: string;
3334
+ intent_id: string;
3335
+ version: number;
3336
+ env_alias: string;
3337
+ }
3338
+ declare class InstructionDebugger {
3339
+ constructor(selector: string, formSelector: string, version: number, instructionName: string, context: object, token?: string);
3340
+ }
3341
+ /**
3342
+ * Class CheckoutButton transform usual button into checkout
3343
+ *
3344
+ * @constructor
3345
+ *
3346
+ * @param {string} selector - Selector of html element.
3347
+ * @param {string} intentToken - PayDock intent token
3348
+ * @example
3349
+ * var widget = new Checkout('#widget', 'intent_token');
3350
+ **/
3351
+ declare class Checkout {
3352
+ protected formSelector: string;
3353
+ protected intentToken: string;
3354
+ protected debug: boolean;
3355
+ protected window: Window;
3356
+ protected eventEmitter: EventEmitter;
3357
+ protected container: Container;
3358
+ protected intentTokenPayload: IntentTokenPayload;
3359
+ protected api: ApiInternal;
3360
+ protected instructions: InstructionModule;
3361
+ protected currentInstruction: InstructionDestroyable & InstructionHandleable;
3362
+ constructor(formSelector: string, intentToken: string, debug?: boolean);
3363
+ private extractIntentTokenPayload;
3364
+ private ready;
3365
+ private initContractVersion;
3366
+ private listenInstructions;
3367
+ private setEnv;
3368
+ private createWidgetStructure;
3369
+ /**
3370
+ * If the payment was successful, the function passed as parameter will be called.
3371
+ * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
3372
+ *
3373
+ * @example
3374
+ * widget.onPaymentSuccessful((data) => {
3375
+ * console.log('Payment successful!');
3376
+ * });
3377
+ */
3378
+ onPaymentSuccessful(handler: (data: IEventData$1) => void): () => void;
3379
+ /**
3380
+ * If the payment was not successful, the function passed as parameter will be called.
3381
+ * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
3382
+ *
3383
+ * @example
3384
+ * widget.onPaymentError((err) => {
3385
+ * console.log('Payment not successful');
3386
+ * });
3387
+ */
3388
+ onPaymentFailure(handler: (data: IEventData$1) => void): () => void;
3389
+ /**
3390
+ * If the payment was expired, the function passed as parameter will be called.
3391
+ * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
3392
+ *
3393
+ * @example
3394
+ * widget.onPaymentInReview((data) => {
3395
+ * console.log('Payment in fraud review');
3396
+ * });
3397
+ */
3398
+ onPaymentExpired(handler: (data: IEventData$1) => void): () => void;
3399
+ private setStyles;
3400
+ }
3401
+
3402
+ declare enum EVENT {
3403
+ UNAVAILABLE = "unavailable",
3404
+ ERROR = "error",
3405
+ PAYMENT_SUCCESSFUL = "paymentSuccessful",
3406
+ PAYMENT_ERROR = "paymentError",
3407
+ PAYMENT_IN_REVIEW = "paymentInReview",
3408
+ ON_CLICK = "onClick",
3409
+ ON_CHECKOUT_CLOSE = "onCheckoutClose"
3410
+ }
3411
+
3412
+ interface BaseEventData<T> {
3413
+ event: string;
3414
+ chargeId?: string;
3415
+ data?: T | undefined;
3416
+ }
3417
+
3418
+ interface OnClickEventData extends BaseEventData<undefined> {
3419
+ event: EVENT.ON_CLICK;
3420
+ }
3421
+
3422
+ interface OnPaymentSuccessfulEventData extends BaseEventData<{
3423
+ id: string;
3424
+ amount: number;
3425
+ currency: string;
3426
+ status: string;
3427
+ }> {
3428
+ event: EVENT.PAYMENT_SUCCESSFUL;
3429
+ }
3430
+
3431
+ interface OnCloseEventData extends BaseEventData<undefined> {
3432
+ event: EVENT.ON_CHECKOUT_CLOSE;
3433
+ }
3434
+
3435
+ interface OnPaymentInReviewEventData extends Omit<OnPaymentSuccessfulEventData, 'event'> {
3436
+ event: EVENT.PAYMENT_IN_REVIEW;
3437
+ }
3438
+
3439
+ interface OnPaymentErrorEventData extends BaseEventData<{
3440
+ message?: string;
3441
+ code?: string;
3442
+ }> {
3443
+ event: EVENT.PAYMENT_ERROR;
3444
+ }
3445
+
3446
+ interface WalletCaptureRequest {
3447
+ payment_method_id?: string;
3448
+ customer: {
3449
+ email?: string;
3450
+ phone?: string;
3451
+ first_name?: string;
3452
+ last_name?: string;
3453
+ payment_source?: {
3454
+ wallet_type?: string;
3455
+ address_line1?: string;
3456
+ address_line2?: string;
3457
+ address_country?: string;
3458
+ address_city?: string;
3459
+ address_postcode?: string;
3460
+ address_state?: string;
3461
+ ref_token?: string;
3462
+ external_payer_id?: string;
3463
+ wallet_express?: boolean;
3464
+ };
3465
+ };
3466
+ }
3467
+
3468
+ interface OnUnavailableEventData extends BaseEventData<undefined> {
3469
+ event: EVENT.UNAVAILABLE;
3470
+ }
3471
+
3472
+ interface BaseGatewayConfig<T> {
3473
+ type: string;
3474
+ mode: string;
3475
+ credentials?: T;
3476
+ }
3477
+
3478
+ interface BaseWalletMeta {
3479
+ amount: number;
3480
+ currency: string;
3481
+ }
3482
+
3483
+ interface OnErrorEventData extends BaseEventData<Error> {
3484
+ event: EVENT.ERROR;
3485
+ }
3486
+
3487
+ declare abstract class BaseWalletButton<T extends BaseWalletMeta> {
3488
+ protected container: Container;
3489
+ protected api: ApiInternal;
3490
+ protected env: string;
3491
+ protected gatewayId: string;
3492
+ protected meta: T;
3493
+ private eventEmitter;
3494
+ private chargeWalletTokenMeta?;
3495
+ constructor(selector: string, publicKeyOrAccessToken: string, gatewayId: string, meta: T, requiredMetaFields: string[]);
3496
+ private getApiAuthType;
3497
+ /**
3498
+ * Current method can change environment. By default environment = sandbox.
3499
+ * Also we can change domain alias for this environment. By default domain_alias = paydock.com
3500
+ * Bear in mind that you must set an environment before calling `button.load()`.
3501
+ *
3502
+ * @example
3503
+ * button.setEnv('production', 'paydock.com');
3504
+ * @param {string} env - sandbox, production
3505
+ * @param {string} [alias] - Own domain alias
3506
+ */
3507
+ setEnv(env: string, alias?: string): void;
3508
+ /**
3509
+ * Callback for onClick method.
3510
+ *
3511
+ * @callback OnClickCallback
3512
+ * @param {OnClickEventData} data
3513
+ * @return {Promise<string>} walletToken string result
3514
+ */
3515
+ /**
3516
+ * Registers a callback function to be invoked when the wallet button gets clicked.
3517
+ * **Note:** is mandatory to handle this event to perform the wallet initialization (and optionally any validation logic).
3518
+ * The event handler needs to return the wallet token string in order for the Wallet charge processing to proceed, or throw an error in case of failure or validation errors.
3519
+ * **Note:** this callback may be called multiple times as the customer closes the payment checkout and re-clicks the button.
3520
+ * It's the merchant's responsibility to handle this situation and evaluate in each case if generating a new WalletCharge Token is required or the previous one can be used in each case, depending on order data and updates.
3521
+ * In case a new one needs to be generated, remember it will need to be preceded by a `setMeta` call.
3522
+ *
3523
+ * @example
3524
+ * button.onClick(async (data) => {
3525
+ * const responseData = await fetch('https://your-server.com/init-wallet-charge');
3526
+ * return responseData.walletToken;
3527
+ * });
3528
+ *
3529
+ * @param {OnClickCallback} handler - Function to be called when the wallet button is clicked.
3530
+ */
3531
+ onClick(handler: (data: OnClickEventData) => Promise<string>): () => void;
3532
+ /**
3533
+ * Callback for onPaymentSuccessful method.
3534
+ *
3535
+ * @callback OnPaymentSuccessfulCallback
3536
+ * @param {OnPaymentSuccessfulEventData} data
3537
+ */
3538
+ /**
3539
+ * If the payment was successful, the function passed as parameter will be called.
3540
+ * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
3541
+ *
3542
+ * @example
3543
+ * button.onPaymentSuccessful((data) => {
3544
+ * console.log('Payment successful!');
3545
+ * });
3546
+ *
3547
+ * @example
3548
+ * button.onPaymentSuccessful().then((data) => console.log('Payment successful!'));
3549
+ *
3550
+ * @param {OnPaymentSuccessfulCallback} [handler] - Function to be called when the payment was successful.
3551
+ */
3552
+ onPaymentSuccessful(handler?: (data: OnPaymentSuccessfulEventData) => void): Promise<unknown> | (() => void);
3553
+ /**
3554
+ * Callback for onPaymentInReview method.
3555
+ *
3556
+ * @callback OnPaymentInReviewCallback
3557
+ * @param {OnPaymentInReviewEventData} data
3558
+ */
3559
+ /**
3560
+ * If the payment was left in fraud review, the function passed as parameter will be called.
3561
+ * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
3562
+ *
3563
+ * @example
3564
+ * button.onPaymentInReview((data) => {
3565
+ * console.log('Payment in fraud review');
3566
+ * });
3567
+ *
3568
+ * @example
3569
+ * button.onPaymentInReview().then((data) => console.log('Payment in fraud review'));
3570
+ *
3571
+ * @param {OnPaymentInReviewCallback} [handler] - Function to be called when the payment was left in fraud review status.
3572
+ */
3573
+ onPaymentInReview(handler?: (err: OnPaymentInReviewEventData) => void): Promise<unknown> | (() => void);
3574
+ /**
3575
+ * Callback for onPaymentError method.
3576
+ *
3577
+ * @callback OnPaymentErrorCallback
3578
+ * @param {OnPaymentErrorEventData} data
3579
+ */
3580
+ /**
3581
+ * If the payment was not successful, the function passed as parameter will be called.
3582
+ * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
3583
+ *
3584
+ * @example
3585
+ * button.onPaymentError((err) => {
3586
+ * console.log('Payment not successful');
3587
+ * });
3588
+ *
3589
+ * @example
3590
+ * button.onPaymentError().then((err) => console.log('Payment not successful'));
3591
+ *
3592
+ * @param {OnPaymentErrorCallback} [handler] - Function to be called when the payment was not successful.
3593
+ */
3594
+ onPaymentError(handler?: (err: OnPaymentErrorEventData) => void): Promise<unknown> | (() => void);
3595
+ /**
3596
+ * Callback for onCheckoutClose method.
3597
+ *
3598
+ * @callback OnCheckoutCloseCallback
3599
+ * @param {OnCloseEventData} data
3600
+ */
3601
+ /**
3602
+ * Registers a callback function to be invoked when the wallet checkout closes.
3603
+ *
3604
+ * @example
3605
+ * button.onCheckoutClose(() => {
3606
+ * console.log('Wallet checkout closes');
3607
+ * });
3608
+ *
3609
+ * @param {OnCheckoutCloseCallback} handler - Function to be called when the wallet checkout closes.
3610
+ */
3611
+ onCheckoutClose(handler?: (err: OnCloseEventData) => void): Promise<unknown> | (() => void);
3612
+ /**
3613
+ * Callback for onUnavailable method.
3614
+ *
3615
+ * @callback OnUnavailableCallback
3616
+ * @param {OnUnavailableEventData} data
3617
+ */
3618
+ /**
3619
+ * Registers a callback function to be invoked when the wallet is not available in the current context.
3620
+ *
3621
+ * @example
3622
+ * button.onUnavailable(() => {
3623
+ * console.log('Wallet not available');
3624
+ * });
3625
+ *
3626
+ * @param {OnUnavailableCallback} handler - Function to be called when the wallet is not available in the current context.
3627
+ */
3628
+ onUnavailable(handler?: (err: OnUnavailableEventData) => void): Promise<unknown> | (() => void);
3629
+ /**
3630
+ * Callback for onError method.
3631
+ *
3632
+ * @callback OnErrorCallback
3633
+ * @param {OnErrorEventData} data
3634
+ */
3635
+ /**
3636
+ * Registers a callback function to be invoked when an error that is not related to payment execution occurs.
3637
+ * For example, if the amount of the wallet token injected via the `onClick` event handler does not match the amount provided via the initial `meta` or `setMeta` method.
3638
+ *
3639
+ * @example
3640
+ * button.onError((error) => {
3641
+ * console.log('WalletButtonExpress error', error);
3642
+ * });
3643
+ *
3644
+ * @param {OnErrorCallback} handler - Function to be called when the WalletButton has an error.
3645
+ */
3646
+ onError(handler?: (err: OnErrorEventData) => void): Promise<unknown> | (() => void);
3647
+ /**
3648
+ * Add docs on each child class
3649
+ */
3650
+ abstract load(): void;
3651
+ /**
3652
+ * Add docs on each child class
3653
+ */
3654
+ abstract setMeta(meta: object): void;
3655
+ protected getGatewayWalletConfig<T>(): Promise<BaseGatewayConfig<T>>;
3656
+ protected executeWalletCallback<T, U extends {
3657
+ request_type: string;
3658
+ }>(data: U): Promise<T>;
3659
+ protected executeWalletCapture<T>(data: WalletCaptureRequest): Promise<T>;
3660
+ protected handleMerchantOnExpressButtonClickEvent(): Promise<void>;
3661
+ private setWalletToken;
3662
+ protected handleCheckoutClose(): void;
3663
+ protected handleOnUnavailable(): void;
3664
+ protected handleOnError(error?: Error): void;
3665
+ protected eventDataFromApiError(err: any): OnPaymentErrorEventData['data'];
3666
+ protected validateRequiredMetaFields(requiredMetaFields: string[]): void;
3667
+ }
3668
+
3669
+ type ApplePayButtonStyle = 'black' | 'white' | 'white-outline';
3670
+
3671
+ type ApplePayButtonType = 'add-money' | 'book' | 'buy' | 'check-out' | 'continue' | 'contribute' | 'donate' | 'order' | 'pay' | 'plain' | 'reload' | 'rent' | 'set-up' | 'subscribe' | 'support' | 'tip' | 'top-up';
3672
+
3673
+ interface ApplePayWalletMeta extends BaseWalletMeta {
3674
+ amount_label: string;
3675
+ country: string;
3676
+ merchant_capabilities?: Array<'supports3DS' | 'supportsEMV' | 'supportsCredit' | 'supportsDebit'>;
3677
+ supported_networks?: Array<'visa' | 'masterCard' | 'amex' | 'chinaUnionPay' | 'discover' | 'interac' | 'jcb' | 'privateLabel'>;
3678
+ required_billing_contact_fields?: Array<'email' | 'name' | 'phone' | 'postalAddress'>;
3679
+ required_shipping_contact_fields?: Array<'email' | 'phone'>;
3680
+ supported_countries?: string[];
3681
+ style?: {
3682
+ button_type?: ApplePayButtonType;
3683
+ button_style?: ApplePayButtonStyle;
3684
+ };
3685
+ }
3686
+
3687
+ /**
3688
+ * Class ApplePayWalletButtonExpress to work with Apple Pay Wallet.
3689
+ *
3690
+ * @extends BaseWalletButton
3691
+ *
3692
+ * @constructor
3693
+ *
3694
+ * @example
3695
+ * var button = new ApplePayWalletButtonExpress('#wallet-buttons', 'publicKeyOrAccessToken', 'gatewayId', meta);
3696
+ *
3697
+ * @param {string} selector - Selector of html element. Container for the ApplePayWalletButtonExpress.
3698
+ * @param {string} publicKeyOrAccessToken - Public key or Access token for the ApplePayWalletButtonExpress.
3699
+ * @param {string} gatewayId - Gateway ID for the ApplePayWalletButtonExpress.
3700
+ * @param {ApplePayWalletMeta} meta - data that configures the Apple Pay Wallet.
3701
+ */
3702
+ declare class ApplePayWalletButtonExpress extends BaseWalletButton<ApplePayWalletMeta> {
3703
+ private paymentSession;
3704
+ /** @constructs */ constructor(selector: string, publicKeyOrAccessToken: string, gatewayId: string, meta: ApplePayWalletMeta);
3705
+ /**
3706
+ * Initializes the availability checks and inserts the button if possible.
3707
+ * Otherwise function onUnavailable(handler: VoidFunction) will be called.
3708
+ * **Important**: Is required to invoke this method to render the wallet button.
3709
+ *
3710
+ * @example
3711
+ * button.load();
3712
+ */
3713
+ load(): void;
3714
+ /**
3715
+ * Call this method if updating the originally-provided meta object after order information changed.
3716
+ * For example, if the order amount has changed from the time where the button was originally rendered.
3717
+ *
3718
+ * @example
3719
+ * button.setMeta(meta);
3720
+ *
3721
+ * @param {ApplePayWalletMeta} meta - // data that configures the Apple Pay Wallet.
3722
+ */
3723
+ setMeta(meta: ApplePayWalletMeta): void;
3724
+ private checkAvailability;
3725
+ private mount;
3726
+ private onApplePayButtonClicked;
3727
+ private createRequest;
3728
+ private onValidateMerchant;
3729
+ private getMerchantSession;
3730
+ private onPaymentAuthorized;
3731
+ private onCancelPayment;
3732
+ }
3733
+
3734
+ interface PaypalWalletMeta extends BaseWalletMeta {
3735
+ pay_later?: boolean;
3736
+ standalone?: boolean;
3737
+ capture?: boolean;
3738
+ style?: {
3739
+ layout?: 'vertical' | 'horizontal';
3740
+ color?: 'gold' | 'blue' | 'silver' | 'black' | 'white';
3741
+ shape?: 'rect' | 'pill' | 'sharp';
3742
+ borderRadius?: number;
3743
+ height?: number;
3744
+ disableMaxWidth?: boolean;
3745
+ label?: 'paypal' | 'checkout' | 'buynow' | 'pay' | 'installment';
3746
+ tagline?: boolean;
3747
+ messages?: {
3748
+ layout?: 'text' | 'flex';
3749
+ logo?: {
3750
+ type?: 'primary' | 'alternative' | 'inline' | 'none';
3751
+ position?: 'left' | 'right' | 'top';
3752
+ };
3753
+ text?: {
3754
+ color?: 'black' | 'white' | 'monochrome' | 'grayscale';
3755
+ size?: 10 | 11 | 12 | 13 | 14 | 15 | 16;
3756
+ align?: 'left' | 'center' | 'right';
3757
+ };
3758
+ color?: 'blue' | 'black' | 'white' | 'white-no-border' | 'gray' | 'monochrome' | 'grayscale';
3759
+ ratio?: '1x1' | '1x4' | '8x1' | '20x1';
3760
+ };
3761
+ };
3762
+ }
3763
+
3764
+ /**
3765
+ * Class PaypalWalletButtonExpress to work with Paypal Wallet.
3766
+ *
3767
+ * @extends BaseWalletButton
3768
+ *
3769
+ * @constructor
3770
+ *
3771
+ * @example
3772
+ * var button = new PaypalWalletButtonExpress('#wallet-buttons', 'publicKeyOrAccessToken', 'gatewayId', meta);
3773
+ *
3774
+ * @param {string} selector - Selector of html element. Container for the PaypalWalletButtonExpress.
3775
+ * @param {string} publicKeyOrAccessToken - Public key or Access token for the PaypalWalletButtonExpress.
3776
+ * @param {string} gatewayId - Gateway ID for the PaypalWalletButtonExpress.
3777
+ * @param {PaypalWalletMeta} meta - data that configures the Paypal Wallet.
3778
+ */
3779
+ declare class PaypalWalletButtonExpress extends BaseWalletButton<PaypalWalletMeta> {
3780
+ private config;
3781
+ protected paypal: any;
3782
+ protected pendingApprovalPromise?: Promise<any>;
3783
+ /** @constructs */ constructor(selector: string, publicKeyOrAccessToken: string, gatewayId: string, meta: PaypalWalletMeta);
3784
+ /**
3785
+ * Initializes the availability checks and inserts the button if possible.
3786
+ * Otherwise function onUnavailable(handler: VoidFunction) will be called.
3787
+ * **Important**: Is required to invoke this method to render the wallet button.
3788
+ *
3789
+ * @example
3790
+ * button.load();
3791
+ */
3792
+ load(): void;
3793
+ /**
3794
+ * Call this method if updating the originally-provided meta object after order information changed.
3795
+ * For example, if the order amount has changed from the time where the button was originally rendered.
3796
+ *
3797
+ * @example
3798
+ * button.setMeta(meta);
3799
+ * @param {PaypalWalletMeta} meta - // data that configures the Paypal Wallet.
3800
+ */
3801
+ setMeta(meta: PaypalWalletMeta): void;
3802
+ private renderPaypalButton;
3803
+ private renderPaypalCommonComponent;
3804
+ private renderPaypalStandaloneComponent;
3805
+ private paypalSharedProps;
3806
+ }
3807
+
3808
+ declare enum ErrorCodes$1 {
3809
+ PROMISE_NOT_ENABLED = "promise_not_enabled",
3810
+ SCRIPT_ERROR = "script_error"
3811
+ }
3812
+ interface PayPalDataCollectorConfig {
3813
+ mouse_movement?: boolean;
3814
+ }
3815
+ interface IPayPalDataCollector {
3816
+ collectDeviceData(): Promise<CollectedDeviceData>;
3817
+ setEnv(env: string): void;
3818
+ }
3819
+ interface CollectedDeviceData {
3820
+ correlation_id: string;
3821
+ }
3822
+ interface IOnErrorEventData$1 {
3823
+ error_code: ErrorCodes$1;
3824
+ }
3825
+
3826
+ /**
3827
+ * PayPal Data Collector Widget constructor
3828
+ *
3829
+ * @param {string} flowId - This string identifies the source website of the FraudNet request.
3830
+ * @param {PayPalDataCollectorConfig} config - Extra configuration for the widget.
3831
+ *
3832
+ * @example
3833
+ * var payPalDataCollector = new PayPalDataCollector('FLOW_ID', {});
3834
+ */
3835
+ declare class PayPalDataCollector {
3836
+ protected service: IPayPalDataCollector;
3837
+ protected eventEmitter: EventEmitter;
3838
+ private widgetActionLogger;
3839
+ /** @constructs */ constructor(flowId?: string, config?: PayPalDataCollectorConfig);
3840
+ /**
3841
+ * After configuring the PayPalDataCollector Widget, starts the process and returns
3842
+ * the correlation id used among the requests.
3843
+ *
3844
+ * @returns {Promise<CollectedDeviceData>} Promise when resolved, returnsa an object
3845
+ * that contains the `correlation_id` key.
3846
+ *
3847
+ * @example
3848
+ * const collectedDeviceData = await payPalDataCollectorWidget.collectDeviceData();
3849
+ * console.log(collectedDeviceData.correlation_id)
3850
+ */
3851
+ collectDeviceData(): Promise<CollectedDeviceData>;
3852
+ /**
3853
+ * Callback for onError method.
3854
+ *
3855
+ * @callback OnErrorCallback
3856
+ * @param {IOnErrorEventData|null} data
3857
+ */
3858
+ /**
3859
+ * If the process fails, the function passed as parameter will be called.
3860
+ * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
3861
+ *
3862
+ * @example
3863
+ * PayPalDataCollector.onError((eventData) => console.log('Some error occur'));
3864
+ *
3865
+ * @param {OnErrorCallback} [callback] - Function to be called when there is an error in the flow.
3866
+ */
3867
+ onError(callback?: (data?: IOnErrorEventData$1) => void): () => void;
3868
+ /**
3869
+ * Current method can change environment. By default environment = test.
3870
+ * This method does not affect Paydock's API calls or environments, is only for PayPal Data Collector
3871
+ * script, in order to know if the script is injected on a live server or is a testing
3872
+ * environment. The available values are `test` and `live`. This should match with the used
3873
+ * `gateway.mode` in Paydock to process the transaction.
3874
+ *
3875
+ * @example
3876
+ * PayPalDataCollector.setEnv('live');
3877
+ * @param {string} env - test, live
3878
+ */
3879
+ setEnv(env: string): void;
3880
+ }
3881
+
3882
+ interface PayPalStyleConfig {
3883
+ layout?: 'vertical' | 'horizontal';
3884
+ color?: 'blue' | 'gold' | 'silver' | 'black' | 'white';
3885
+ shape?: 'rect' | 'sharp' | 'pill';
3886
+ label?: 'paypal' | 'checkout' | 'buynow' | 'pay';
3887
+ disableMaxWidth?: boolean;
3888
+ disableMaxHeight?: boolean;
3889
+ height?: number;
3890
+ borderRadius?: number;
3891
+ tagline?: boolean;
3892
+ }
3893
+ interface PayPalMessageConfig {
3894
+ amount?: number;
3895
+ align?: 'center' | 'left' | 'right';
3896
+ color?: 'black' | 'white';
3897
+ position?: 'top' | 'bottom';
3898
+ }
3899
+ interface PayPalSavePaymentSourceWidgetConfig {
3900
+ style?: PayPalStyleConfig;
3901
+ message?: PayPalMessageConfig;
3902
+ }
3903
+ interface IPayPalSavePaymentSourceWidget {
3904
+ load(container: Container): void;
3905
+ setEnv(env: string, alias?: string): void;
3906
+ }
3907
+ declare enum ErrorCodes {
3908
+ UNAVAILABLE = "unavailable",
3909
+ ON_PAYPAL_VAULT_SETUP_TOKEN_ERROR = "onPaypalVaultSetupTokenError",
3910
+ ON_GET_ID_TOKEN_ERROR = "onGetIdTokenError",
3911
+ ON_GET_WALLET_CONFIG_ERROR = "onGetWalletConfigError",
3912
+ ON_GET_SETUP_TOKEN_ERROR = "onGetSetupTokenError",
3913
+ ON_ONE_TIME_TOKEN_ERROR = "onOneTimeTokenError"
3914
+ }
3915
+ declare enum EVENTS {
3916
+ ON_SUCCESS = "ON_SUCCESS",
3917
+ ON_ERROR = "ON_ERROR",
3918
+ ON_CANCEL = "ON_CANCEL"
3919
+ }
3920
+ interface IOnSuccessEventData {
3921
+ event: EVENTS.ON_SUCCESS;
3922
+ data: {
3923
+ token: string;
3924
+ email: string;
3925
+ };
3926
+ }
3927
+ interface IOnErrorEventData {
3928
+ event: EVENTS.ON_ERROR;
3929
+ data: {
3930
+ error_code: ErrorCodes;
3931
+ details?: string;
3932
+ message?: string;
3933
+ };
3934
+ }
3935
+ interface IOnCancelEventData {
3936
+ event: EVENTS.ON_CANCEL;
3937
+ }
3938
+
3939
+ /**
3940
+ * PayPal Save Payment Source Widget constructor
3941
+ *
3942
+ * @param {string} selector - Selector of html element. Container for PayPal Save Payment Source Widget.
3943
+ * @param {string} publicKey - PayDock users public key.
3944
+ * @param {string} gatewayId - PayDock's PayPal gatewayId.
3945
+ * @param {PayPalSavePaymentSourceWidgetConfig} config - Extra configuration for the widget, like styles.
3946
+ *
3947
+ * @example
3948
+ * var payPalSavePaymentSourceWidget = new PayPalSavePaymentSourceWidget('#paypalButton', 'public_key', 'gateway_id');
3949
+ */
3950
+ declare class PayPalSavePaymentSourceWidget {
3951
+ protected container: Container;
3952
+ protected service: IPayPalSavePaymentSourceWidget;
3953
+ protected eventEmitter: EventEmitter;
3954
+ private widgetActionLogger;
3955
+ /** @constructs */ constructor(selector: string, publicKey: string, gatewayId: string, config?: PayPalSavePaymentSourceWidgetConfig);
3956
+ /**
3957
+ * The final method after configuring the PayPalSavePaymentSource Widget to
3958
+ * start the load process.
3959
+ */
3960
+ load(): void;
3961
+ /**
3962
+ * Current method can change environment. By default environment = sandbox.
3963
+ * Also we can change domain alias for this environment. By default domain_alias = paydock.com
3964
+ *
3965
+ * @example
3966
+ * payPalSavePaymentSourceWidget.setEnv('production');
3967
+ * @param {string} env - sandbox, production
3968
+ * @param {string} [alias] - Own domain alias
3969
+ */
3970
+ setEnv(env: string, alias?: string): void;
3971
+ /**
3972
+ * Callback for onSuccess method.
3973
+ *
3974
+ * @callback OnSuccessCallback
3975
+ * @param {IOnSuccessEventData} data
3976
+ */
3977
+ /**
3978
+ * If the setup token was successfully approved and a OTT was generated, the function passed as parameter will be called.
3979
+ * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
3980
+ *
3981
+ * @example
3982
+ * payPalSavePaymentSourceWidget.onSuccess((eventData) => console.log('One time token and email obtained successfully'));
3983
+ *
3984
+ * @param {OnSuccessCallback} [callback] - Function to be called when the result is successful.
3985
+ */
3986
+ onSuccess(callback?: (data: IOnSuccessEventData) => void): () => void;
3987
+ /**
3988
+ * Callback for onError method.
3989
+ *
3990
+ * @callback OnErrorCallback
3991
+ * @param {IOnErrorEventData} data
3992
+ */
3993
+ /**
3994
+ * If in the process for obtaining the setup token fails, the function passed as parameter will be called.
3995
+ * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
3996
+ *
3997
+ * @example
3998
+ * payPalSavePaymentSourceWidget.onError((eventData) => console.log('Some error occurred'));
3999
+ *
4000
+ * @param {OnErrorCallback} [callback] - Function to be called when there is an error in the flow.
4001
+ */
4002
+ onError(callback?: (data: IOnErrorEventData) => void): () => void;
4003
+ /**
4004
+ * Callback for onCancel method.
4005
+ *
4006
+ * @callback OnCancelCallback
4007
+ * @param {IOnCancelEventData} data
4008
+ */
4009
+ /**
4010
+ * If in the process for obtaining the setup token was cancelled, the function passed as parameter will be called.
4011
+ * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
4012
+ *
4013
+ * @example
4014
+ * payPalSavePaymentSourceWidget.onCancel(() => console.log('Operation cancelled'));
4015
+ *
4016
+ * @param {OnCancelCallback} [callback] - Function to be called when the operation is cancelled.
4017
+ */
4018
+ onCancel(callback?: (data?: IOnCancelEventData) => void): () => void;
4019
+ }
4020
+
4021
+ export { AfterpayCheckoutButton, Api, ApplePayWalletButtonExpress, CHECKOUT_BUTTON_EVENT, Canvas3ds, Checkout, ClickToPay, Configuration, ELEMENT, EVENT$1 as EVENT, Builder$1 as ExternalCheckoutBuilder, Checker as ExternalCheckoutChecker, FORM_FIELD, HtmlMultiWidget, HtmlPaymentSourceWidget, HtmlWidget, type ICheckout, type IDetails, type IElementStyleInput, type IEventCheckoutFinishData, type IPayPalMeta, type IStyles$1 as IStyles, type ITexts, InstructionDebugger, MultiWidget, PAYMENT_TYPE, PURPOSE, PayPalDataCollector, PayPalSavePaymentSourceWidget, Builder as PaymentSourceBuilder, PaymentSourceWidget, PaypalCheckoutButton, PaypalWalletButtonExpress, STYLABLE_ELEMENT, STYLABLE_ELEMENT_STATE, STYLE, SUPPORTED_CARD_TYPES, TEXT, TRIGGER, TYPE, VAULT_DISPLAY_STYLE, type VaultDisplayStyle, VaultDisplayWidget, WalletButtons, ZipmoneyCheckoutButton };