@paydock/client-sdk 1.104.3-beta → 1.105.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (490) hide show
  1. package/.nvmrc +1 -0
  2. package/README.md +572 -290
  3. package/api.d.ts +1 -0
  4. package/api.js +1 -0
  5. package/bundles/widget.umd.js +9130 -8655
  6. package/bundles/widget.umd.min.js +1 -2
  7. package/canvas3ds.d.ts +1 -0
  8. package/canvas3ds.js +1 -0
  9. package/checkout-button.d.ts +1 -0
  10. package/checkout-button.js +1 -0
  11. package/inicialization-guide.md +7 -0
  12. package/{bundles/types → lib}/api/api-base.d.ts +1 -2
  13. package/lib/api/api-base.js +101 -0
  14. package/lib/api/api-base.js.map +1 -0
  15. package/{bundles/types → lib}/api/api-charge-internal.d.ts +0 -1
  16. package/lib/api/api-charge-internal.js +30 -0
  17. package/lib/api/api-charge-internal.js.map +1 -0
  18. package/{bundles/types → lib}/api/api-charge.d.ts +0 -1
  19. package/lib/api/api-charge.js +49 -0
  20. package/lib/api/api-charge.js.map +1 -0
  21. package/{bundles/types → lib}/api/api-internal.d.ts +0 -1
  22. package/lib/api/api-internal.js +13 -0
  23. package/lib/api/api-internal.js.map +1 -0
  24. package/{bundles/types → lib}/api/api-service-internal.d.ts +0 -1
  25. package/lib/api/api-service-internal.js +18 -0
  26. package/lib/api/api-service-internal.js.map +1 -0
  27. package/{bundles/types → lib}/api/api.d.ts +1 -2
  28. package/lib/api/api.js +62 -0
  29. package/lib/api/api.js.map +1 -0
  30. package/lib/api/index.d.ts +1 -0
  31. package/lib/api/index.js +2 -0
  32. package/lib/api/index.js.map +1 -0
  33. package/{bundles/types → lib}/canvas-3ds/canvas-3ds.d.ts +1 -2
  34. package/lib/canvas-3ds/canvas-3ds.js +157 -0
  35. package/lib/canvas-3ds/canvas-3ds.js.map +1 -0
  36. package/{bundles/types → lib}/canvas-3ds/index.d.ts +0 -1
  37. package/lib/canvas-3ds/index.js +2 -0
  38. package/lib/canvas-3ds/index.js.map +1 -0
  39. package/{bundles/types → lib}/canvas-3ds/services/gpayments-service.d.ts +0 -1
  40. package/lib/canvas-3ds/services/gpayments-service.js +181 -0
  41. package/lib/canvas-3ds/services/gpayments-service.js.map +1 -0
  42. package/{bundles/types → lib}/canvas-3ds/services/index.d.ts +0 -1
  43. package/lib/canvas-3ds/services/index.js +2 -0
  44. package/lib/canvas-3ds/services/index.js.map +1 -0
  45. package/{bundles/types → lib}/canvas-3ds/services/standalone3ds-service.d.ts +0 -1
  46. package/lib/canvas-3ds/services/standalone3ds-service.js +32 -0
  47. package/lib/canvas-3ds/services/standalone3ds-service.js.map +1 -0
  48. package/{bundles/types → lib}/checkout-button/afterpay/afterpay-checkout-button.d.ts +1 -2
  49. package/lib/checkout-button/afterpay/afterpay-checkout-button.js +50 -0
  50. package/lib/checkout-button/afterpay/afterpay-checkout-button.js.map +1 -0
  51. package/{bundles/types → lib}/checkout-button/afterpay/afterpay.runner.d.ts +0 -1
  52. package/lib/checkout-button/afterpay/afterpay.runner.js +41 -0
  53. package/lib/checkout-button/afterpay/afterpay.runner.js.map +1 -0
  54. package/{bundles/types → lib}/checkout-button/checkout-button.d.ts +1 -2
  55. package/{bundles/types → lib}/checkout-button/checkout-button.interface.d.ts +0 -1
  56. package/lib/checkout-button/checkout-button.interface.js +45 -0
  57. package/lib/checkout-button/checkout-button.interface.js.map +1 -0
  58. package/lib/checkout-button/checkout-button.js +266 -0
  59. package/lib/checkout-button/checkout-button.js.map +1 -0
  60. package/{bundles/types → lib}/checkout-button/checkout-contextual-handler.d.ts +0 -1
  61. package/lib/checkout-button/checkout-contextual-handler.js +75 -0
  62. package/lib/checkout-button/checkout-contextual-handler.js.map +1 -0
  63. package/{bundles/types → lib}/checkout-button/index.d.ts +1 -2
  64. package/lib/checkout-button/index.js +85 -0
  65. package/lib/checkout-button/index.js.map +1 -0
  66. package/{bundles/types → lib}/checkout-button/paypal/paypal-checkout-button.d.ts +1 -2
  67. package/lib/checkout-button/paypal/paypal-checkout-button.js +25 -0
  68. package/lib/checkout-button/paypal/paypal-checkout-button.js.map +1 -0
  69. package/{bundles/types → lib}/checkout-button/paypal/paypal.runner.d.ts +0 -1
  70. package/lib/checkout-button/paypal/paypal.runner.js +14 -0
  71. package/lib/checkout-button/paypal/paypal.runner.js.map +1 -0
  72. package/{bundles/types → lib}/checkout-button/runner/base.runner.d.ts +3 -4
  73. package/lib/checkout-button/runner/base.runner.js +13 -0
  74. package/lib/checkout-button/runner/base.runner.js.map +1 -0
  75. package/{bundles/types → lib}/checkout-button/runner/contextual.runner.d.ts +1 -2
  76. package/lib/checkout-button/runner/contextual.runner.js +40 -0
  77. package/lib/checkout-button/runner/contextual.runner.js.map +1 -0
  78. package/{bundles/types → lib}/checkout-button/runner/index.d.ts +0 -1
  79. package/lib/checkout-button/runner/index.js +11 -0
  80. package/lib/checkout-button/runner/index.js.map +1 -0
  81. package/{bundles/types → lib}/checkout-button/runner/popup.runner.d.ts +1 -2
  82. package/lib/checkout-button/runner/popup.runner.js +68 -0
  83. package/lib/checkout-button/runner/popup.runner.js.map +1 -0
  84. package/{bundles/types → lib}/checkout-button/runner/redirect.runner.d.ts +1 -2
  85. package/lib/checkout-button/runner/redirect.runner.js +15 -0
  86. package/lib/checkout-button/runner/redirect.runner.js.map +1 -0
  87. package/{bundles/types → lib}/checkout-button/zipmoney/zipmoney-checkout-button.d.ts +1 -2
  88. package/lib/checkout-button/zipmoney/zipmoney-checkout-button.js +64 -0
  89. package/lib/checkout-button/zipmoney/zipmoney-checkout-button.js.map +1 -0
  90. package/{bundles/types → lib}/checkout-button/zipmoney/zipmoney-contextual.runner.d.ts +1 -2
  91. package/lib/checkout-button/zipmoney/zipmoney-contextual.runner.js +78 -0
  92. package/lib/checkout-button/zipmoney/zipmoney-contextual.runner.js.map +1 -0
  93. package/{bundles/types → lib}/checkout-button/zipmoney/zipmoney-redirect.runner.d.ts +1 -2
  94. package/lib/checkout-button/zipmoney/zipmoney-redirect.runner.js +49 -0
  95. package/lib/checkout-button/zipmoney/zipmoney-redirect.runner.js.map +1 -0
  96. package/{bundles/types → lib}/checkout-button/zipmoney/zipmoney.config.d.ts +0 -1
  97. package/lib/checkout-button/zipmoney/zipmoney.config.js +4 -0
  98. package/lib/checkout-button/zipmoney/zipmoney.config.js.map +1 -0
  99. package/{bundles/types → lib}/checkout-button/zipmoney/zipmoney.runner.d.ts +1 -2
  100. package/lib/checkout-button/zipmoney/zipmoney.runner.js +23 -0
  101. package/lib/checkout-button/zipmoney/zipmoney.runner.js.map +1 -0
  102. package/{bundles/types → lib}/checkout-button/zipmoney/zipmoney.types.d.ts +0 -1
  103. package/lib/checkout-button/zipmoney/zipmoney.types.js +1 -0
  104. package/lib/checkout-button/zipmoney/zipmoney.types.js.map +1 -0
  105. package/{bundles/types → lib}/components/ability-guard.d.ts +0 -1
  106. package/lib/components/ability-guard.js +44 -0
  107. package/lib/components/ability-guard.js.map +1 -0
  108. package/{bundles/types → lib}/components/background.d.ts +0 -1
  109. package/lib/components/background.js +193 -0
  110. package/lib/components/background.js.map +1 -0
  111. package/{bundles/types → lib}/components/container.d.ts +1 -1
  112. package/lib/components/container.js +63 -0
  113. package/lib/components/container.js.map +1 -0
  114. package/{bundles/types → lib}/components/dispatcher.d.ts +1 -2
  115. package/lib/components/dispatcher.js +39 -0
  116. package/lib/components/dispatcher.js.map +1 -0
  117. package/{bundles/types → lib}/components/element-style.d.ts +1 -2
  118. package/lib/components/element-style.js +52 -0
  119. package/lib/components/element-style.js.map +1 -0
  120. package/{bundles/types → lib}/components/flypay-iframe-event.d.ts +0 -1
  121. package/lib/components/flypay-iframe-event.js +28 -0
  122. package/lib/components/flypay-iframe-event.js.map +1 -0
  123. package/{bundles/types/components/form-interceptor.d.ts → lib/components/form-Interceptor.d.ts} +0 -1
  124. package/lib/components/form-Interceptor.js +38 -0
  125. package/lib/components/form-Interceptor.js.map +1 -0
  126. package/{bundles/types → lib}/components/http-core.d.ts +0 -1
  127. package/lib/components/http-core.js +57 -0
  128. package/lib/components/http-core.js.map +1 -0
  129. package/{bundles/types → lib}/components/iframe-event.d.ts +15 -13
  130. package/lib/components/iframe-event.js +75 -0
  131. package/lib/components/iframe-event.js.map +1 -0
  132. package/{bundles/types → lib}/components/iframe.d.ts +0 -1
  133. package/lib/components/iframe.js +62 -0
  134. package/lib/components/iframe.js.map +1 -0
  135. package/{bundles/types → lib}/components/link.d.ts +1 -2
  136. package/lib/components/link.js +59 -0
  137. package/lib/components/link.js.map +1 -0
  138. package/{bundles/types → lib}/components/loader.d.ts +0 -1
  139. package/lib/components/loader.js +234 -0
  140. package/lib/components/loader.js.map +1 -0
  141. package/{bundles/types → lib}/components/param.d.ts +9 -12
  142. package/lib/components/param.js +147 -0
  143. package/lib/components/param.js.map +1 -0
  144. package/{bundles/types → lib}/components/popup.d.ts +0 -1
  145. package/lib/components/popup.js +104 -0
  146. package/lib/components/popup.js.map +1 -0
  147. package/{bundles/types → lib}/components/storage-dispatcher.d.ts +0 -1
  148. package/lib/components/storage-dispatcher.js +75 -0
  149. package/lib/components/storage-dispatcher.js.map +1 -0
  150. package/{bundles/types → lib}/components/trigger.d.ts +0 -1
  151. package/lib/components/trigger.js +49 -0
  152. package/lib/components/trigger.js.map +1 -0
  153. package/{bundles/types → lib}/components/vault-display-iframe-event.d.ts +0 -1
  154. package/lib/components/vault-display-iframe-event.js +27 -0
  155. package/lib/components/vault-display-iframe-event.js.map +1 -0
  156. package/{bundles/types → lib}/components/wallet-background.d.ts +2 -2
  157. package/lib/components/wallet-background.js +63 -0
  158. package/lib/components/wallet-background.js.map +1 -0
  159. package/{bundles/types → lib}/components/wallet-trigger.d.ts +0 -1
  160. package/lib/components/wallet-trigger.js +27 -0
  161. package/lib/components/wallet-trigger.js.map +1 -0
  162. package/{bundles/types/configs/env/environment.paydock.d.ts → lib/configs/env/env.d.ts} +8 -5
  163. package/lib/configs/env/env.js +117 -0
  164. package/lib/configs/env/env.js.map +1 -0
  165. package/{bundles/types → lib}/configs/sdk.d.ts +2 -3
  166. package/lib/configs/sdk.js +16 -0
  167. package/lib/configs/sdk.js.map +1 -0
  168. package/lib/constants/validators.d.ts +44 -0
  169. package/lib/constants/validators.js +42 -0
  170. package/lib/constants/validators.js.map +1 -0
  171. package/{bundles/types → lib}/external-checkout/builder.d.ts +0 -1
  172. package/lib/external-checkout/builder.js +45 -0
  173. package/lib/external-checkout/builder.js.map +1 -0
  174. package/{bundles/types → lib}/external-checkout/checker.d.ts +0 -1
  175. package/lib/external-checkout/checker.js +22 -0
  176. package/lib/external-checkout/checker.js.map +1 -0
  177. package/lib/external-checkout/index.d.ts +2 -0
  178. package/lib/external-checkout/index.js +3 -0
  179. package/lib/external-checkout/index.js.map +1 -0
  180. package/{bundles/types → lib}/helper/access-token.d.ts +0 -1
  181. package/lib/helper/access-token.js +44 -0
  182. package/lib/helper/access-token.js.map +1 -0
  183. package/{bundles/types → lib}/helper/browser.d.ts +0 -1
  184. package/lib/helper/browser.js +79 -0
  185. package/lib/helper/browser.js.map +1 -0
  186. package/{bundles/types → lib}/helper/event-emitter.d.ts +0 -1
  187. package/lib/helper/event-emitter.js +23 -0
  188. package/lib/helper/event-emitter.js.map +1 -0
  189. package/{bundles/types → lib}/helper/event.d.ts +0 -1
  190. package/lib/helper/event.js +23 -0
  191. package/lib/helper/event.js.map +1 -0
  192. package/{bundles/types → lib}/helper/ms.d.ts +0 -1
  193. package/lib/helper/ms.js +32 -0
  194. package/lib/helper/ms.js.map +1 -0
  195. package/{bundles/types → lib}/helper/object.d.ts +0 -1
  196. package/lib/helper/object.js +6 -0
  197. package/lib/helper/object.js.map +1 -0
  198. package/{bundles/types → lib}/helper/url.d.ts +0 -1
  199. package/lib/helper/url.js +11 -0
  200. package/lib/helper/url.js.map +1 -0
  201. package/{bundles/types → lib}/helper/uuid.d.ts +0 -1
  202. package/lib/helper/uuid.js +26 -0
  203. package/lib/helper/uuid.js.map +1 -0
  204. package/lib/index.d.ts +15 -0
  205. package/lib/index.js +15 -0
  206. package/lib/index.js.map +1 -0
  207. package/{bundles/types → lib}/payment-source/builder.d.ts +0 -1
  208. package/lib/payment-source/builder.js +49 -0
  209. package/lib/payment-source/builder.js.map +1 -0
  210. package/{bundles/types → lib}/payment-source/index.d.ts +0 -1
  211. package/lib/payment-source/index.js +2 -0
  212. package/lib/payment-source/index.js.map +1 -0
  213. package/{bundles/types → lib}/payment-source-widget/html-payment-source-widget.d.ts +17 -14
  214. package/lib/payment-source-widget/html-payment-source-widget.js +172 -0
  215. package/lib/payment-source-widget/html-payment-source-widget.js.map +1 -0
  216. package/{bundles/types → lib}/payment-source-widget/index.d.ts +0 -1
  217. package/lib/payment-source-widget/index.js +35 -0
  218. package/lib/payment-source-widget/index.js.map +1 -0
  219. package/{bundles/types → lib}/payment-source-widget/interfaces.d.ts +0 -1
  220. package/lib/payment-source-widget/interfaces.js +2 -0
  221. package/lib/payment-source-widget/interfaces.js.map +1 -0
  222. package/{bundles/types → lib}/payment-source-widget/payment-source-widget.d.ts +1 -2
  223. package/lib/payment-source-widget/payment-source-widget.js +142 -0
  224. package/lib/payment-source-widget/payment-source-widget.js.map +1 -0
  225. package/{bundles/types → lib}/secure-remote-commerce/index.d.ts +0 -1
  226. package/lib/secure-remote-commerce/index.js +2 -0
  227. package/lib/secure-remote-commerce/index.js.map +1 -0
  228. package/{bundles/types → lib}/secure-remote-commerce/interfaces.d.ts +5 -6
  229. package/lib/secure-remote-commerce/interfaces.js +28 -0
  230. package/lib/secure-remote-commerce/interfaces.js.map +1 -0
  231. package/{bundles/types → lib}/secure-remote-commerce/providers/src-provider.d.ts +0 -1
  232. package/lib/secure-remote-commerce/providers/src-provider.js +1 -0
  233. package/lib/secure-remote-commerce/providers/src-provider.js.map +1 -0
  234. package/{bundles/types → lib}/secure-remote-commerce/providers/visa-src/helper.d.ts +0 -1
  235. package/lib/secure-remote-commerce/providers/visa-src/helper.js +36 -0
  236. package/lib/secure-remote-commerce/providers/visa-src/helper.js.map +1 -0
  237. package/{bundles/types → lib}/secure-remote-commerce/providers/visa-src/index.d.ts +0 -1
  238. package/lib/secure-remote-commerce/providers/visa-src/index.js +2 -0
  239. package/lib/secure-remote-commerce/providers/visa-src/index.js.map +1 -0
  240. package/{bundles/types → lib}/secure-remote-commerce/providers/visa-src/visa-src.d.ts +0 -1
  241. package/lib/secure-remote-commerce/providers/visa-src/visa-src.js +113 -0
  242. package/lib/secure-remote-commerce/providers/visa-src/visa-src.js.map +1 -0
  243. package/{bundles/types → lib}/secure-remote-commerce/providers/visa-src/visa-src.styles.d.ts +0 -1
  244. package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.js +10 -0
  245. package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.js.map +1 -0
  246. package/{bundles/types → lib}/secure-remote-commerce/secure-remote-commerce.d.ts +1 -2
  247. package/lib/secure-remote-commerce/secure-remote-commerce.js +239 -0
  248. package/lib/secure-remote-commerce/secure-remote-commerce.js.map +1 -0
  249. package/{bundles/types → lib}/vault-display-widget/index.d.ts +0 -1
  250. package/lib/vault-display-widget/index.js +14 -0
  251. package/lib/vault-display-widget/index.js.map +1 -0
  252. package/{bundles/types → lib}/vault-display-widget/vault-display-widget.d.ts +1 -2
  253. package/lib/vault-display-widget/vault-display-widget.js +99 -0
  254. package/lib/vault-display-widget/vault-display-widget.js.map +1 -0
  255. package/{bundles/types → lib}/wallet-buttons/afterpay.wallet-service.d.ts +0 -1
  256. package/lib/wallet-buttons/afterpay.wallet-service.js +152 -0
  257. package/lib/wallet-buttons/afterpay.wallet-service.js.map +1 -0
  258. package/{bundles/types → lib}/wallet-buttons/apple.wallet-service.d.ts +2 -1
  259. package/lib/wallet-buttons/apple.wallet-service.js +324 -0
  260. package/lib/wallet-buttons/apple.wallet-service.js.map +1 -0
  261. package/{bundles/types → lib}/wallet-buttons/flypay-v2.wallet-service.d.ts +9 -2
  262. package/lib/wallet-buttons/flypay-v2.wallet-service.js +165 -0
  263. package/lib/wallet-buttons/flypay-v2.wallet-service.js.map +1 -0
  264. package/{bundles/types → lib}/wallet-buttons/flypay.wallet-service.d.ts +0 -1
  265. package/lib/wallet-buttons/flypay.wallet-service.js +117 -0
  266. package/lib/wallet-buttons/flypay.wallet-service.js.map +1 -0
  267. package/{bundles/types → lib}/wallet-buttons/google.wallet-service.d.ts +3 -1
  268. package/lib/wallet-buttons/google.wallet-service.js +301 -0
  269. package/lib/wallet-buttons/google.wallet-service.js.map +1 -0
  270. package/lib/wallet-buttons/helpers/flypay-v2.helper.d.ts +3 -0
  271. package/lib/wallet-buttons/helpers/flypay-v2.helper.js +151 -0
  272. package/lib/wallet-buttons/helpers/flypay-v2.helper.js.map +1 -0
  273. package/lib/wallet-buttons/index.d.ts +127 -0
  274. package/lib/wallet-buttons/index.js +128 -0
  275. package/lib/wallet-buttons/index.js.map +1 -0
  276. package/{bundles/types → lib}/wallet-buttons/interfaces.d.ts +3 -1
  277. package/lib/wallet-buttons/interfaces.js +1 -0
  278. package/lib/wallet-buttons/interfaces.js.map +1 -0
  279. package/{bundles/types → lib}/wallet-buttons/mastercard.wallet-service.d.ts +0 -1
  280. package/lib/wallet-buttons/mastercard.wallet-service.js +27 -0
  281. package/lib/wallet-buttons/mastercard.wallet-service.js.map +1 -0
  282. package/{bundles/types → lib}/wallet-buttons/paypal.wallet-service.d.ts +0 -1
  283. package/lib/wallet-buttons/paypal.wallet-service.js +144 -0
  284. package/lib/wallet-buttons/paypal.wallet-service.js.map +1 -0
  285. package/{bundles/types → lib}/wallet-buttons/stripe.wallet-service.d.ts +0 -1
  286. package/lib/wallet-buttons/stripe.wallet-service.js +100 -0
  287. package/lib/wallet-buttons/stripe.wallet-service.js.map +1 -0
  288. package/{bundles/types/wallet-buttons/wallet-cba-buttons.d.ts → lib/wallet-buttons/wallet-buttons.d.ts} +92 -115
  289. package/lib/wallet-buttons/wallet-buttons.js +479 -0
  290. package/lib/wallet-buttons/wallet-buttons.js.map +1 -0
  291. package/{bundles/types → lib}/wallet-buttons/wallet-service.d.ts +7 -1
  292. package/lib/wallet-buttons/wallet-service.js +60 -0
  293. package/lib/wallet-buttons/wallet-service.js.map +1 -0
  294. package/{bundles/types → lib}/widget/configuration.d.ts +2 -3
  295. package/lib/widget/configuration.js +260 -0
  296. package/lib/widget/configuration.js.map +1 -0
  297. package/lib/widget/html-multi-widget.d.ts +336 -0
  298. package/lib/widget/html-multi-widget.js +422 -0
  299. package/lib/widget/html-multi-widget.js.map +1 -0
  300. package/{bundles/types → lib}/widget/html-widget.d.ts +1 -2
  301. package/lib/widget/html-widget.js +127 -0
  302. package/lib/widget/html-widget.js.map +1 -0
  303. package/{bundles/types → lib}/widget/index.d.ts +1 -2
  304. package/lib/widget/index.js +132 -0
  305. package/lib/widget/index.js.map +1 -0
  306. package/{bundles/types → lib}/widget/meta.d.ts +0 -1
  307. package/lib/widget/meta.js +8 -0
  308. package/lib/widget/meta.js.map +1 -0
  309. package/{bundles/types → lib}/widget/multi-widget.d.ts +1 -2
  310. package/lib/widget/multi-widget.js +437 -0
  311. package/lib/widget/multi-widget.js.map +1 -0
  312. package/{bundles/types → lib}/widget/style.d.ts +0 -1
  313. package/lib/widget/style.js +204 -0
  314. package/lib/widget/style.js.map +1 -0
  315. package/package.json +42 -164
  316. package/payment-source-widget.d.ts +1 -0
  317. package/payment-source-widget.js +1 -0
  318. package/slate.md +136 -107
  319. package/tslint.json +129 -0
  320. package/typings/globals/@auspayplus/open-payments-checkout/index.d.ts +43 -0
  321. package/typings/globals/jasmine/index.d.ts +576 -0
  322. package/typings/globals/jasmine-ajax/index.d.ts +83 -0
  323. package/typings/globals/jquery/index.d.ts +3759 -0
  324. package/typings/index.d.ts +4 -0
  325. package/vault-display-widget.d.ts +1 -0
  326. package/vault-display-widget.js +1 -0
  327. package/vendors/zipmoney.d.ts +18 -0
  328. package/vendors/zipmoney.js +2 -0
  329. package/widget.d.ts +1 -0
  330. package/widget.js +1 -0
  331. package/bundles/index.cjs +0 -10674
  332. package/bundles/index.cjs.d.ts +0 -3163
  333. package/bundles/index.cjs.map +0 -1
  334. package/bundles/index.mjs +0 -10642
  335. package/bundles/index.mjs.d.ts +0 -3163
  336. package/bundles/index.mjs.map +0 -1
  337. package/bundles/types/api/api-base.d.ts.map +0 -1
  338. package/bundles/types/api/api-charge-internal.d.ts.map +0 -1
  339. package/bundles/types/api/api-charge.d.ts.map +0 -1
  340. package/bundles/types/api/api-internal.d.ts.map +0 -1
  341. package/bundles/types/api/api-service-internal.d.ts.map +0 -1
  342. package/bundles/types/api/api.d.ts.map +0 -1
  343. package/bundles/types/api/index.d.ts +0 -2
  344. package/bundles/types/api/index.d.ts.map +0 -1
  345. package/bundles/types/canvas-3ds/canvas-3ds.d.ts.map +0 -1
  346. package/bundles/types/canvas-3ds/index.d.ts.map +0 -1
  347. package/bundles/types/canvas-3ds/services/gpayments-service.d.ts.map +0 -1
  348. package/bundles/types/canvas-3ds/services/index.d.ts.map +0 -1
  349. package/bundles/types/canvas-3ds/services/standalone3ds-service.d.ts.map +0 -1
  350. package/bundles/types/checkout-button/afterpay/afterpay-checkout-button.d.ts.map +0 -1
  351. package/bundles/types/checkout-button/afterpay/afterpay.runner.d.ts.map +0 -1
  352. package/bundles/types/checkout-button/checkout-button.d.ts.map +0 -1
  353. package/bundles/types/checkout-button/checkout-button.interface.d.ts.map +0 -1
  354. package/bundles/types/checkout-button/checkout-contextual-handler.d.ts.map +0 -1
  355. package/bundles/types/checkout-button/index.d.ts.map +0 -1
  356. package/bundles/types/checkout-button/paypal/paypal-checkout-button.d.ts.map +0 -1
  357. package/bundles/types/checkout-button/paypal/paypal.runner.d.ts.map +0 -1
  358. package/bundles/types/checkout-button/runner/base.runner.d.ts.map +0 -1
  359. package/bundles/types/checkout-button/runner/contextual.runner.d.ts.map +0 -1
  360. package/bundles/types/checkout-button/runner/index.d.ts.map +0 -1
  361. package/bundles/types/checkout-button/runner/popup.runner.d.ts.map +0 -1
  362. package/bundles/types/checkout-button/runner/redirect.runner.d.ts.map +0 -1
  363. package/bundles/types/checkout-button/zipmoney/index.d.ts +0 -4
  364. package/bundles/types/checkout-button/zipmoney/index.d.ts.map +0 -1
  365. package/bundles/types/checkout-button/zipmoney/zipmoney-checkout-button.d.ts.map +0 -1
  366. package/bundles/types/checkout-button/zipmoney/zipmoney-contextual.runner.d.ts.map +0 -1
  367. package/bundles/types/checkout-button/zipmoney/zipmoney-redirect.runner.d.ts.map +0 -1
  368. package/bundles/types/checkout-button/zipmoney/zipmoney.config.d.ts.map +0 -1
  369. package/bundles/types/checkout-button/zipmoney/zipmoney.runner.d.ts.map +0 -1
  370. package/bundles/types/checkout-button/zipmoney/zipmoney.types.d.ts.map +0 -1
  371. package/bundles/types/components/ability-guard.d.ts.map +0 -1
  372. package/bundles/types/components/background.d.ts.map +0 -1
  373. package/bundles/types/components/container.d.ts.map +0 -1
  374. package/bundles/types/components/dispatcher.d.ts.map +0 -1
  375. package/bundles/types/components/element-style.d.ts.map +0 -1
  376. package/bundles/types/components/flypay-iframe-event.d.ts.map +0 -1
  377. package/bundles/types/components/form-interceptor.d.ts.map +0 -1
  378. package/bundles/types/components/http-core.d.ts.map +0 -1
  379. package/bundles/types/components/iframe-event.d.ts.map +0 -1
  380. package/bundles/types/components/iframe.d.ts.map +0 -1
  381. package/bundles/types/components/link.d.ts.map +0 -1
  382. package/bundles/types/components/loader.d.ts.map +0 -1
  383. package/bundles/types/components/param.d.ts.map +0 -1
  384. package/bundles/types/components/popup.d.ts.map +0 -1
  385. package/bundles/types/components/storage-dispatcher.d.ts.map +0 -1
  386. package/bundles/types/components/trigger.d.ts.map +0 -1
  387. package/bundles/types/components/vault-display-iframe-event.d.ts.map +0 -1
  388. package/bundles/types/components/wallet-background.d.ts.map +0 -1
  389. package/bundles/types/components/wallet-trigger.d.ts.map +0 -1
  390. package/bundles/types/configs/env/environment.cba.d.ts +0 -29
  391. package/bundles/types/configs/env/environment.cba.d.ts.map +0 -1
  392. package/bundles/types/configs/env/environment.interface.d.ts +0 -12
  393. package/bundles/types/configs/env/environment.interface.d.ts.map +0 -1
  394. package/bundles/types/configs/env/environment.paydock.d.ts.map +0 -1
  395. package/bundles/types/configs/env/index.d.ts +0 -3
  396. package/bundles/types/configs/env/index.d.ts.map +0 -1
  397. package/bundles/types/configs/sdk.d.ts.map +0 -1
  398. package/bundles/types/external-checkout/builder.d.ts.map +0 -1
  399. package/bundles/types/external-checkout/checker.d.ts.map +0 -1
  400. package/bundles/types/external-checkout/index.d.ts +0 -3
  401. package/bundles/types/external-checkout/index.d.ts.map +0 -1
  402. package/bundles/types/helper/access-token.d.ts.map +0 -1
  403. package/bundles/types/helper/browser.d.ts.map +0 -1
  404. package/bundles/types/helper/event-emitter.d.ts.map +0 -1
  405. package/bundles/types/helper/event.d.ts.map +0 -1
  406. package/bundles/types/helper/ms.d.ts.map +0 -1
  407. package/bundles/types/helper/object.d.ts.map +0 -1
  408. package/bundles/types/helper/url.d.ts.map +0 -1
  409. package/bundles/types/helper/uuid.d.ts.map +0 -1
  410. package/bundles/types/index-cba.d.ts +0 -13
  411. package/bundles/types/index-cba.d.ts.map +0 -1
  412. package/bundles/types/index.d.ts +0 -14
  413. package/bundles/types/index.d.ts.map +0 -1
  414. package/bundles/types/payment-source/builder.d.ts.map +0 -1
  415. package/bundles/types/payment-source/index.d.ts.map +0 -1
  416. package/bundles/types/payment-source-widget/html-payment-source-widget.d.ts.map +0 -1
  417. package/bundles/types/payment-source-widget/index.d.ts.map +0 -1
  418. package/bundles/types/payment-source-widget/interfaces.d.ts.map +0 -1
  419. package/bundles/types/payment-source-widget/payment-source-widget.d.ts.map +0 -1
  420. package/bundles/types/secure-remote-commerce/index.d.ts.map +0 -1
  421. package/bundles/types/secure-remote-commerce/interfaces.d.ts.map +0 -1
  422. package/bundles/types/secure-remote-commerce/providers/src-provider.d.ts.map +0 -1
  423. package/bundles/types/secure-remote-commerce/providers/visa-src/helper.d.ts.map +0 -1
  424. package/bundles/types/secure-remote-commerce/providers/visa-src/index.d.ts.map +0 -1
  425. package/bundles/types/secure-remote-commerce/providers/visa-src/visa-src.d.ts.map +0 -1
  426. package/bundles/types/secure-remote-commerce/providers/visa-src/visa-src.styles.d.ts.map +0 -1
  427. package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts.map +0 -1
  428. package/bundles/types/vault-display-widget/index.d.ts.map +0 -1
  429. package/bundles/types/vault-display-widget/vault-display-widget.d.ts.map +0 -1
  430. package/bundles/types/wallet-buttons/afterpay.wallet-service.d.ts.map +0 -1
  431. package/bundles/types/wallet-buttons/apple.wallet-service.d.ts.map +0 -1
  432. package/bundles/types/wallet-buttons/flypay-v2.wallet-service.d.ts.map +0 -1
  433. package/bundles/types/wallet-buttons/flypay.wallet-service.d.ts.map +0 -1
  434. package/bundles/types/wallet-buttons/google.wallet-service.d.ts.map +0 -1
  435. package/bundles/types/wallet-buttons/index-cba.d.ts +0 -2
  436. package/bundles/types/wallet-buttons/index-cba.d.ts.map +0 -1
  437. package/bundles/types/wallet-buttons/index.d.ts +0 -2
  438. package/bundles/types/wallet-buttons/index.d.ts.map +0 -1
  439. package/bundles/types/wallet-buttons/interfaces.d.ts.map +0 -1
  440. package/bundles/types/wallet-buttons/mastercard.wallet-service.d.ts.map +0 -1
  441. package/bundles/types/wallet-buttons/paypal.wallet-service.d.ts.map +0 -1
  442. package/bundles/types/wallet-buttons/stripe.wallet-service.d.ts.map +0 -1
  443. package/bundles/types/wallet-buttons/wallet-buttons.d.ts +0 -366
  444. package/bundles/types/wallet-buttons/wallet-buttons.d.ts.map +0 -1
  445. package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts.map +0 -1
  446. package/bundles/types/wallet-buttons/wallet-service.d.ts.map +0 -1
  447. package/bundles/types/widget/configuration.d.ts.map +0 -1
  448. package/bundles/types/widget/html-multi-widget.d.ts +0 -266
  449. package/bundles/types/widget/html-multi-widget.d.ts.map +0 -1
  450. package/bundles/types/widget/html-widget.d.ts.map +0 -1
  451. package/bundles/types/widget/index.d.ts.map +0 -1
  452. package/bundles/types/widget/meta.d.ts.map +0 -1
  453. package/bundles/types/widget/multi-widget.d.ts.map +0 -1
  454. package/bundles/types/widget/style.d.ts.map +0 -1
  455. package/bundles/widget.umd.js.d.ts +0 -3163
  456. package/bundles/widget.umd.js.map +0 -1
  457. package/bundles/widget.umd.js.min.d.ts +0 -3163
  458. package/bundles/widget.umd.min.js.map +0 -1
  459. package/docs/api-canvas3ds.md +0 -158
  460. package/docs/api-checkout-button.md +0 -912
  461. package/docs/api-examples.md +0 -65
  462. package/docs/api-ps-widget.md +0 -585
  463. package/docs/api-vault-display.md +0 -94
  464. package/docs/api-widget.md +0 -2444
  465. package/docs/api-wrapper.md +0 -78
  466. package/docs/canvas3ds-examples.md +0 -242
  467. package/docs/cba-header.md +0 -13
  468. package/docs/cba-license.md +0 -2
  469. package/docs/checkout-examples.md +0 -248
  470. package/docs/header.md +0 -15
  471. package/docs/html/layout.html +0 -78
  472. package/docs/html/marked.js +0 -23
  473. package/docs/html/style.css +0 -365
  474. package/docs/install/npm.content.md +0 -16
  475. package/docs/install/npm.example.md +0 -24
  476. package/docs/install/umd.content.md +0 -20
  477. package/docs/install/umd.example.md +0 -6
  478. package/docs/install.md +0 -43
  479. package/docs/install.readme.t.md +0 -17
  480. package/docs/install.slate.t.md +0 -17
  481. package/docs/license.md +0 -2
  482. package/docs/partials/header.hbs +0 -3
  483. package/docs/ps-examples.md +0 -129
  484. package/docs/secure-remote-commerce-examples.md +0 -258
  485. package/docs/secure-remote-commerce.md +0 -265
  486. package/docs/vault-display-example.md +0 -132
  487. package/docs/wallet-buttons-examples.md +0 -580
  488. package/docs/wallet-buttons.md +0 -424
  489. package/docs/wallet-cba-buttons-examples.md +0 -388
  490. package/docs/widget-examples.md +0 -134
@@ -0,0 +1,422 @@
1
+ import { MultiWidget } from "./multi-widget";
2
+ import { Container } from "../components/container";
3
+ import { IFrame } from "../components/iframe";
4
+ import { IFrameEvent, EVENT } from "../components/iframe-event";
5
+ import { Trigger, TRIGGER } from "../components/trigger";
6
+ import { Event as EventHelper } from "../helper/event";
7
+ import { FormInterceptor } from "../components/form-Interceptor";
8
+ import { ELEMENT, FORM_FIELD, STYLE, TEXT } from '../components/param';
9
+ import { ObjectHelper } from "../helper/object";
10
+ /**
11
+ * Interface of data from validation event.
12
+ *
13
+ * @interface IFormValidation
14
+ *
15
+ * @param {string} event The name of the event.
16
+ * @param {string} message_source A system variable that identifies the event source.
17
+ * @param {string} purpose A system variable that states the purpose of the event.
18
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
19
+ * @param {boolean} [form_valid] Indicates wether or not the form is valid.
20
+ * @param {Array<string>} [invalid_fields] Names of form fields with invalid data.
21
+ * @param {Array<string>} [invalid_showed_fields] Names of invalid form fields which are already displaying the error.
22
+ * @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.
23
+ * See list of available [Generic Vallidators]{@link GENERIC_VALIDATORS} and [Card Validators]{@link CARD_VALIDATORS},
24
+ */
25
+ /**
26
+ * Contains basic information associated with the event and additional meta data
27
+ * specific to the event. E.g., card info, gateway info, etc.
28
+ *
29
+ * @interface IEventMetaData
30
+ *
31
+ * @param {string} event The name of the event.
32
+ * @param {string} purpose A system variable that states the purpose of the event.
33
+ * @param {string} message_source A system variable that identifies the event source.
34
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
35
+ * @param {string} configuration_token Token received from our API with widget data
36
+ * @param {string} type Payment type 'card', 'bank_account'
37
+ * @param {string} gateway_type Gateway type
38
+ * @param {string} [card_number_last4] Last 4 digit of your card
39
+ * @param {string} [card_scheme] Card scheme, e.g., (Visa, Mastercard and American Express (AmEx))
40
+ * @param {number} [card_number_length] Card number length
41
+ * @param {string} [account_name] Bank account account name
42
+ * @param {string} [account_number] Bank account account number
43
+ * */
44
+ /**
45
+ * Interface of data from event.
46
+ * @interface IEventAfterLoadData
47
+ *
48
+ * @param {string} event The name of the event.
49
+ * @param {string} purpose A system variable that states the purpose of the event.
50
+ * @param {string} message_source A system variable that identifies the event source.
51
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
52
+ * */
53
+ /**
54
+ * Interface of data from event.
55
+ * @interface IEventFinishData
56
+ *
57
+ * @param {string} event The name of the event.
58
+ * @param {string} purpose A system variable that states the purpose of the event.
59
+ * @param {string} message_source A system variable that identifies the event source.
60
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
61
+ * @param {string} payment_source One time token. Result from this endpoint [API docs](https://docs.paydock.com/#tokens)
62
+ * */
63
+ /**
64
+ * List of available event's name
65
+ * @const EVENT
66
+ *
67
+ * @type {object}
68
+ * @param {string} AFTER_LOAD=afterLoad
69
+ * @param {string} SUBMIT=submit
70
+ * @param {string} FINISH=finish
71
+ * @param {string} VALIDATION=validation
72
+ * @param {string} VALIDATION_ERROR=validationError
73
+ * @param {string} SYSTEM_ERROR=systemError
74
+ * @param {string} META_CHANGE=metaChange
75
+ * @param {string} RESIZE=resize
76
+ */
77
+ /**
78
+ * List of available event's name
79
+ * @const VAULT_DISPLAY_EVENT
80
+ *
81
+ * @type {object}
82
+ * @param {string} AFTER_LOAD=afterLoad
83
+ * @param {string} SYSTEM_ERROR=system_error
84
+ * @param {string} CVV_SECURE_CODE_REQUESTED=cvv_secure_code_requested
85
+ * @param {string} CARD_NUMBER_SECURE_CODE_REQUESTED=card_number_secure_code_requested
86
+ * @param {string} ACCESS_FORBIDDEN=access_forbidden
87
+ * @param {string} SESSION_EXPIRED=systemError
88
+ * @param {string} SYSTEM_ERROR=session_expired
89
+ * @param {string} OPERATION_FORBIDDEN=operation_forbidden
90
+ */
91
+ /**
92
+ * Class HtmlMultiWidget include method for working with html
93
+ * @constructor
94
+ * @extends MultiWidget
95
+ *
96
+ * @param {string} selector - Selector of html element. Container for widget
97
+ * @param {string} publicKey - PayDock users public key
98
+ * @param {(Configuration | string | Configuration[] | string[])} conf - exemplar[s] Configuration class OR configuration token
99
+ * @example
100
+ * var widget = new MultiWidget('#widget', 'publicKey','configurationToken'); // With a pre-created configuration token
101
+ *
102
+ * var widget = new MultiWidget('#widget', 'publicKey',['configurationToken', 'configurationToken2']); // With pre-created configuration tokens
103
+ *
104
+ * var widget = new MultiWidget('#widget', 'publicKey', new Configuration('gatewayId')); With Configuration
105
+ *
106
+ * var widget = new MultiWidget('#widget', 'publicKey',[ With Configurations
107
+ * Configuration(), // default gateway_id,
108
+ * Configuration('not_configured'), // without gateway,
109
+ * Configuration('gatewayId'),
110
+ * Configuration('gatewayId', 'bank_account')
111
+ * ]);
112
+ */
113
+ class HtmlMultiWidget extends MultiWidget {
114
+ /** @constructs */ // constructs added for correct parse classes jsdoc2md
115
+ constructor(selector, publicKey, conf) {
116
+ super(publicKey, conf);
117
+ this.validationData = {};
118
+ this.container = new Container(selector);
119
+ this.iFrame = new IFrame(this.container);
120
+ this.triggerElement = new Trigger(this.iFrame);
121
+ this.event = new IFrameEvent(window);
122
+ }
123
+ /**
124
+ * Loads the widget.
125
+ *
126
+ * Calling this method results in an iframe element being inserted and rendered in the DOM.
127
+ */
128
+ load() {
129
+ this.setStyles(this.container.getStyles(ObjectHelper.values(STYLE)));
130
+ this.setTexts(this.container.getAttr(ObjectHelper.values(TEXT)));
131
+ this.loadIFrameUrl((url) => {
132
+ this.iFrame.load(url, { title: 'Card details' });
133
+ this.afterLoad();
134
+ }, (errors) => {
135
+ console.error('Errors when creating a token[s, widget will not be load:');
136
+ for (let index in errors) {
137
+ if (errors.hasOwnProperty(index))
138
+ console.error(`--- | ${errors[index]}`);
139
+ }
140
+ });
141
+ }
142
+ /**
143
+ * Registers a form validation callback for validation events.
144
+ */
145
+ afterLoad() {
146
+ this.on(EVENT.VALIDATION, (data) => {
147
+ this.validationData = data;
148
+ });
149
+ }
150
+ on(eventName, cb) {
151
+ if (typeof cb === "function")
152
+ return this.event.on(eventName, this.link.getParams().widget_id, cb);
153
+ return new Promise((resolve) => this.event.on(eventName, this.link.getParams().widget_id, (res) => resolve(res)));
154
+ }
155
+ /**
156
+ * Registers callback that will be invoked for every trigger.
157
+ *
158
+ * @param {'submit_form' | 'tab'} triggers - The Widget element identifier that caused the trigger.
159
+ * @param {ITriggerData} data - Data that will be sent to the widget when the trigger occurs.
160
+ */
161
+ trigger(triggerName, data = {}) {
162
+ this.triggerElement.push(triggerName, data);
163
+ }
164
+ /**
165
+ * Gets a reference to the form current validation state.
166
+ *
167
+ * !Warning: do not directly modify the values of the returned object.
168
+ *
169
+ * @return {IFormValidation} Form validation object
170
+ */
171
+ getValidationState() {
172
+ return this.validationData;
173
+ }
174
+ /**
175
+ * Checks if a given form is valid.
176
+ *
177
+ * A form is valid if all form fields are valid.
178
+ *
179
+ * @return {boolean} Indicates wether or not form is valid.
180
+ */
181
+ isValidForm() {
182
+ return !!this.validationData.form_valid;
183
+ }
184
+ /**
185
+ * Using this method you can check if a specific form field is invalid
186
+ *
187
+ * @param {string} field - Field name
188
+ * @return {boolean} Field is invalid
189
+ */
190
+ isInvalidField(field = '') {
191
+ if (!this.validationData.invalid_fields)
192
+ return false;
193
+ return this.validationData.invalid_fields.indexOf(field) !== -1;
194
+ }
195
+ /**
196
+ * Checks if a given form field is displaying an error.
197
+ *
198
+ * @param {string} field - The form field name
199
+ *
200
+ * @return {boolean} Indicates wether or not the Error message is being displayed on the associated field.
201
+ */
202
+ isFieldErrorShowed(field = '') {
203
+ if (!this.validationData.invalid_showed_fields)
204
+ return false;
205
+ return this.validationData.invalid_showed_fields.indexOf(field) !== -1;
206
+ }
207
+ /**
208
+ * Checks if a given form field is valid or invalid by name.
209
+ *
210
+ * @param {string} field - The form field name
211
+ * @param validator - The name of the validator.
212
+ *
213
+ * @return {boolean} Indicates wether or not the field is invalid based on validator intepretation.
214
+ */
215
+ isInvalidFieldByValidator(field = '', validator) {
216
+ const isValid = false; // is not invalid
217
+ if (!this.validationData.validators) {
218
+ return isValid;
219
+ }
220
+ const subjectFields = this.validationData.validators[validator];
221
+ if (!subjectFields) {
222
+ return isValid;
223
+ }
224
+ return subjectFields.indexOf(field) !== -1;
225
+ }
226
+ /**
227
+ * Hides the widget.
228
+ *
229
+ * E.g., use this method to hide the widget after it loads.
230
+ *
231
+ * @param {boolean} [saveSize=false] Wether the original iframe element size should be saved before being hidden.
232
+ */
233
+ hide(saveSize) {
234
+ this.iFrame.hide(saveSize);
235
+ }
236
+ /**
237
+ * Shows the widget.
238
+ *
239
+ * E.g., use this method to show the widget after it was explicitly hidden.
240
+ */
241
+ show() {
242
+ this.iFrame.show();
243
+ }
244
+ /**
245
+ * Reloads the widget.
246
+ */
247
+ reload() {
248
+ this.iFrame.remove();
249
+ this.load();
250
+ }
251
+ /**
252
+ * Hides the specified Widget elements by their identifier.
253
+ *
254
+ * @example
255
+ *
256
+ * ```javascript
257
+ * widget.hideElements(['submit_button', 'email']);
258
+ * ```
259
+ *
260
+ * @param {string[]} elements - List of element which can be hidden [ELEMENT]{@link ELEMENT} || [FORM_FIELD]{@link FORM_FIELD}
261
+ */
262
+ hideElements(elements) {
263
+ let filteredElements = [];
264
+ let supportedElements = ObjectHelper.values(ELEMENT).concat(ObjectHelper.values(FORM_FIELD));
265
+ for (let index in elements) {
266
+ if (!elements.hasOwnProperty(index))
267
+ continue;
268
+ if (supportedElements.indexOf(elements[index]) !== -1)
269
+ filteredElements.push(elements[index]);
270
+ else
271
+ console.warn(`Widget::hideElements: unsupported element ${elements[index]}`);
272
+ }
273
+ if (filteredElements.length)
274
+ this.trigger(TRIGGER.HIDE_ELEMENTS, { elements: filteredElements.join(',') });
275
+ }
276
+ /**
277
+ * Shows the specified Widget elements by their identifier.
278
+ *
279
+ * @example
280
+ *
281
+ * ```javascript
282
+ * widget.showElements(['submit_button', 'email']);
283
+ * ```
284
+ *
285
+ * @param {string[]} elements - List of elements which can be showed [ELEMENT]{@link ELEMENT} || [FORM_FIELD]{@link FORM_FIELD}
286
+ */
287
+ showElements(elements) {
288
+ let filteredElements = [];
289
+ let supportedElements = ObjectHelper.values(ELEMENT).concat(ObjectHelper.values(FORM_FIELD));
290
+ for (let index in elements) {
291
+ if (!elements.hasOwnProperty(index))
292
+ continue;
293
+ if (supportedElements.indexOf(elements[index]) !== -1)
294
+ filteredElements.push(elements[index]);
295
+ else
296
+ console.warn(`Widget::showElements: unsupported element ${elements[index]}`);
297
+ }
298
+ if (filteredElements.length)
299
+ this.trigger(TRIGGER.SHOW_ELEMENTS, { elements: filteredElements.join(',') });
300
+ }
301
+ /**
302
+ * Updates the form field values inside the widget.
303
+ *
304
+ * @example
305
+ *
306
+ * ```javascript
307
+ * widget.updateFormValues({
308
+ * email: 'predefined@email.com',
309
+ * card_name: 'Houston'
310
+ * });
311
+ *```
312
+ *
313
+ * @param {IFormValues} fieldValues - Fields with values
314
+ */
315
+ updateFormValues(fieldValues) {
316
+ for (let key in fieldValues) {
317
+ if (fieldValues.hasOwnProperty(key))
318
+ this.updateFormValue(key, fieldValues[key]);
319
+ }
320
+ }
321
+ /**
322
+ * Updates a single form field values inside the widget by the form field name.
323
+ *
324
+ * @example
325
+ *
326
+ * ```javascript
327
+ * widget.updateFormValue("card_name", "John Doe");
328
+ *```
329
+ *
330
+ * @param {string} key - The form field name
331
+ * @param {string} value - The form field value
332
+ */
333
+ updateFormValue(key, value) {
334
+ if (ObjectHelper.values(FORM_FIELD).indexOf(key) === -1)
335
+ return console.warn(`Widget::setFormValues[s: unsupported field ${key}`);
336
+ if (/\,/.test(value) || /\:/.test(value))
337
+ return console.warn(`Widget::setFormValues[s: ${key} - unsupported symbols (: or ,) in value`);
338
+ this.trigger(TRIGGER.UPDATE_FORM_VALUES, { form_values: `${key}:${value}` });
339
+ }
340
+ /**
341
+ * Inserts the event data (after finish event) onto the input field associated with the provided CSS selector.
342
+ *
343
+ * @param {string} selector - A CSS selector. E.g., ".my-class", "#my-id", or others
344
+ * @param {string} dataType - The data type of IEventData object.
345
+ */
346
+ onFinishInsert(selector, dataType) {
347
+ this.on(EVENT.FINISH, (event) => {
348
+ EventHelper.insertToInput(selector, dataType, event);
349
+ });
350
+ }
351
+ /**
352
+ * Intercepts a form submission and delegates processing to the widget.
353
+ *
354
+ * An simplified example of the process:
355
+ * - User clicks submit button in your form
356
+ * - This implicitly triggers a submission to the widget
357
+ * - The widget submits your form
358
+ *
359
+ * @note The widget's submit button will be hidden.
360
+ *
361
+ * @param {string} selector - css selector of your form
362
+ *
363
+ * @example
364
+ *
365
+ * ```html
366
+ * <body>
367
+ * <form id="myForm">
368
+ * <input name="amount">
369
+ * <button type="submit">Submit</button>
370
+ * </form>
371
+ * <script>
372
+ * widget.interceptSubmitForm('#myForm');
373
+ * </script>
374
+ * </body>
375
+ * ```
376
+ */
377
+ interceptSubmitForm(selector) {
378
+ this.setHiddenElements([ELEMENT.SUBMIT_BUTTON]);
379
+ let formInterceptor = new FormInterceptor(selector);
380
+ formInterceptor.beforeSubmit(() => {
381
+ this.triggerElement.push(TRIGGER.SUBMIT_FORM, {});
382
+ this.event.on(EVENT.FINISH, this.link.getParams().widget_id, () => {
383
+ formInterceptor.continueSubmit();
384
+ });
385
+ });
386
+ }
387
+ /**
388
+ * This method hides a submit button and automatically execute form submit
389
+ */
390
+ useCheckoutAutoSubmit() {
391
+ this.setHiddenElements([ELEMENT.SUBMIT_BUTTON]);
392
+ this.on(EVENT.CHECKOUT_SUCCESS, (data) => {
393
+ this.trigger(TRIGGER.SUBMIT_FORM);
394
+ });
395
+ this.on(EVENT.VALIDATION_ERROR, (data) => {
396
+ this.trigger(TRIGGER.REFRESH_CHECKOUT);
397
+ });
398
+ this.on(EVENT.SYSTEM_ERROR, (data) => {
399
+ this.trigger(TRIGGER.REFRESH_CHECKOUT);
400
+ });
401
+ }
402
+ /**
403
+ * Use this method for resize iFrame according content height
404
+ *
405
+ * @example
406
+ *
407
+ * ```javascript
408
+ * widget.useAutoResize();
409
+ *```
410
+ */
411
+ useAutoResize() {
412
+ this.on(EVENT.RESIZE, (data) => {
413
+ if (this.iFrame.getElement()) {
414
+ this.iFrame.getElement().scrolling = 'no';
415
+ if (data.height)
416
+ this.iFrame.setStyle('height', data.height + 'px');
417
+ }
418
+ });
419
+ }
420
+ }
421
+ export { HtmlMultiWidget };
422
+ //# sourceMappingURL=../../src/lib/widget/html-multi-widget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html-multi-widget.js","sourceRoot":"","sources":["../../widget/html-multi-widget.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAc,KAAK,EAAC,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAgB,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAC,OAAO,EAAE,UAAU,EAAiD,KAAK,EAAE,IAAI,EAAwB,MAAM,qBAAqB,CAAC;AAC3I,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAsB9C;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;;;;;;;;;;KAkBK;AAGL;;;;;;;;KAQK;AAGL;;;;;;;;;KASK;AAGL;;;;;;;;;;;;;GAaG;AAGH;;;;;;;;;;;;;GAaG;AAGH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,eAAgB,SAAQ,WAAW;IAQrC,kBAAkB,CAAC,sDAAsD;IACzE,YAAY,QAAgB,EAAE,SAAiB,EAAE,IAAS;QACtD,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAJjB,mBAAc,GAAoB,EAAE,CAAC;QAK3C,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CA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AAC,CAAC,CAAC;IACP,CAAC;IAGD;;OAEG;IACI,qBAAqB;QACxB,IAAI,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;QAChD,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,IAAgB,EAAE,EAAE;YACjD,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,IAAgB,EAAE,EAAE;YACjD,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,IAAgB,EAAE,EAAE;YAC7C,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;;;;;;OAQG;IACI,aAAa;QAChB,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,IAAoB,EAAE,EAAE;YAC3C,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE;gBAC1B,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,SAAS,GAAG,IAAI,CAAC;gBAC1C,IAAG,IAAI,CAAC,MAAM;oBACV,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;aAC1D;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CAEJ;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -20,7 +20,7 @@ import { IBamboraMeta, IFormElement, IPayPalMeta } from "../components/param";
20
20
  * @param {string} [purpose=payment_source] - Purpose of widget form. Available parameters: ‘payment_source’, ‘card_payment_source_with_cvv’, ‘card_payment_source_without_cvv’
21
21
  */
22
22
  declare class HtmlWidget extends HtmlMultiWidget {
23
- constructor(selector: string, publicKey: string, gatewayID?: string, paymentType?: string, purpose?: string);
23
+ /** @constructs */ constructor(selector: string, publicKey: string, gatewayID?: string, paymentType?: string, purpose?: string);
24
24
  /**
25
25
  * Destination, where customer will receive all successful responses.
26
26
  * Response will contain “data” object with “payment_source” or other parameters, in depending on 'purpose'
@@ -103,4 +103,3 @@ declare class HtmlWidget extends HtmlMultiWidget {
103
103
  setGiftCardScheme(giftCardScheme: any, processingNetwork: any): void;
104
104
  }
105
105
  export { HtmlWidget };
106
- //# sourceMappingURL=html-widget.d.ts.map
@@ -0,0 +1,127 @@
1
+ import { Configuration } from "./configuration";
2
+ import { HtmlMultiWidget } from "./html-multi-widget";
3
+ /**
4
+ * Class Widget include method for working on html and include extended by HtmlMultiWidget methods
5
+ * @constructor
6
+ * @extends HtmlMultiWidget
7
+ * @extends MultiWidget
8
+ *
9
+ * @example
10
+ * var widget = new HtmlWidget('#widget', 'publicKey', 'gatewayID'); // short
11
+ *
12
+ * var widget = new HtmlWidget('#widget', 'publicKey', 'gatewayID', 'bank_account', 'payment_source'); // extend
13
+ *
14
+ * var widget = new HtmlWidget('#widget', 'publicKey', 'not_configured'); // without gateway
15
+ *
16
+ * @param {string} selector - Selector of html element. Container for widget
17
+ * @param {string} publicKey - PayDock users public key
18
+ * @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.
19
+ * @param {string} [paymentType=card] - Type of payment source which shows in widget form. Available parameters : “card”, “bank_account”.
20
+ * @param {string} [purpose=payment_source] - Purpose of widget form. Available parameters: ‘payment_source’, ‘card_payment_source_with_cvv’, ‘card_payment_source_without_cvv’
21
+ */
22
+ class HtmlWidget extends HtmlMultiWidget {
23
+ /** @constructs */ // constructs added for correct parse classes jsdoc2md
24
+ constructor(selector, publicKey, gatewayID = 'default', paymentType, purpose) {
25
+ let conf = new Configuration(gatewayID, paymentType, purpose);
26
+ super(selector, publicKey, conf);
27
+ }
28
+ /**
29
+ * Destination, where customer will receive all successful responses.
30
+ * Response will contain “data” object with “payment_source” or other parameters, in depending on 'purpose'
31
+ *
32
+ * @example
33
+ * widget.setWebHookDestination('http://google.com');
34
+ *
35
+ * @param {string} url - Your endpoint for post request.
36
+ */
37
+ setWebHookDestination(url) {
38
+ this.configs[0].setWebHookDestination(url);
39
+ }
40
+ /**
41
+ * URL to which the Customer will be redirected to after the success finish
42
+ *
43
+ * @example
44
+ * widget.setSuccessRedirectUrl('google.com/search?q=success');
45
+ *
46
+ * @param {string} url
47
+ */
48
+ setSuccessRedirectUrl(url) {
49
+ this.configs[0].setSuccessRedirectUrl(url);
50
+ }
51
+ /**
52
+ * URL to which the Customer will be redirected to if an error is triggered in the process of operation
53
+ *
54
+ * @example
55
+ * widget.setErrorRedirectUrl('google.com/search?q=error');
56
+ *
57
+ * @param {string} url
58
+ */
59
+ setErrorRedirectUrl(url) {
60
+ this.configs[0].setErrorRedirectUrl(url);
61
+ }
62
+ /**
63
+ * Set list with widget form field, which will be shown in form. Also you can set the required validation for these fields
64
+ *
65
+ * @example
66
+ * widget.setFormFields(['phone', 'email', 'first_name*']);
67
+ *
68
+ * @param {string[]} fields - name of fields which can be shown in a widget.
69
+ * 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}
70
+ */
71
+ setFormFields(fields) {
72
+ this.configs[0].setFormFields(fields);
73
+ }
74
+ /**
75
+ * The method to set the full configuration for the all specific form elements (visibility, required, label, placeholder, value)
76
+ * You can also use the other method for the partial configuration like: setFormFields, setFormValues, setFormPlaceholder, setFormLabel
77
+ *
78
+ * @example
79
+ * widget.setFormElements([
80
+ * {
81
+ * field: 'card_name*',
82
+ * placeholder: 'Input your card holder name...',
83
+ * label: 'Card Holder Name',
84
+ * value: 'Houston',
85
+ * },
86
+ * {
87
+ * field: 'email',
88
+ * placeholder: 'Input your email, like test@example.com',
89
+ * label: 'Email for the receipt',
90
+ * value: 'predefined@email.com',
91
+ * },
92
+ * ])
93
+ *
94
+ * @param { Object[] } elements - List of elements
95
+ * @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}
96
+ * @param { string } elements[].placeholder - Set custom placeholders in form fields
97
+ * @param { string } elements[].label - Set a custom labels near the form field
98
+ * @param { string } elements[].value - Set predefined values for the form field
99
+ */
100
+ setFormElements(elements) {
101
+ elements.forEach((element) => this.setFormElement(element));
102
+ }
103
+ setFormElement(element) {
104
+ this.configs[0].setFormFields([element.field]);
105
+ super.setFormElement(Object.assign(Object.assign({}, element), { field: element.field.replace('*', '') }));
106
+ }
107
+ /**
108
+ * The method to set meta information for the checkout page
109
+ *
110
+ * @example
111
+ * config.setMeta({
112
+ brand_name: 'paydock',
113
+ reference: '15',
114
+ email: 'wault@paydock.com'
115
+ });
116
+ *
117
+ * @param {IPayPalMeta | IBamboraMeta} object - data which can be shown on checkout page [IPayPalMeta]{@link IPayPalMeta} [IBamboraMeta]{@link IBamboraMeta}
118
+ */
119
+ setMeta(meta) {
120
+ this.configs[0].setMeta(meta);
121
+ }
122
+ setGiftCardScheme(giftCardScheme, processingNetwork) {
123
+ this.configs[0].setGiftCardSchemeData(giftCardScheme, processingNetwork);
124
+ }
125
+ }
126
+ export { HtmlWidget };
127
+ //# sourceMappingURL=../../src/lib/widget/html-widget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html-widget.js","sourceRoot":"","sources":["../../widget/html-widget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAItD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UA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,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,IAAE,CAAC;IAC5E,CAAC;IAED;;;;;;;;;;;OAWG;IACI,OAAO,CAAC,IAAgC;QAC3C,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAGM,iBAAiB,CAAC,cAAc,EAAE,iBAAiB;QACtD,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAE,cAAc,EAAE,iBAAiB,CAAE,CAAC;IAC/E,CAAC;CACJ;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -2,7 +2,7 @@ export { MultiWidget } from './multi-widget';
2
2
  export { HtmlMultiWidget } from './html-multi-widget';
3
3
  export { HtmlWidget } from './html-widget';
4
4
  export { Configuration, PAYMENT_TYPE, PURPOSE } from './configuration';
5
- export { STYLABLE_ELEMENT, type IElementStyleInput, STYLABLE_ELEMENT_STATE } from './style';
5
+ export { STYLABLE_ELEMENT, IElementStyleInput, STYLABLE_ELEMENT_STATE } from './style';
6
6
  /**
7
7
  * Interface for PayPal checkout meta information
8
8
  * @interface IPayPalMeta
@@ -129,4 +129,3 @@ export { STYLABLE_ELEMENT, type IElementStyleInput, STYLABLE_ELEMENT_STATE } fro
129
129
  * @param {string} VISA=visa
130
130
  * @param {string} VISA_WHITE=visa_white
131
131
  */
132
- //# sourceMappingURL=index.d.ts.map