@paydock/client-sdk 1.106.1 → 1.107.0-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 (490) hide show
  1. package/README.md +194 -162
  2. package/bundles/index.cjs +10483 -0
  3. package/bundles/index.cjs.d.ts +3206 -0
  4. package/bundles/index.cjs.map +1 -0
  5. package/bundles/index.mjs +10451 -0
  6. package/bundles/index.mjs.d.ts +3206 -0
  7. package/bundles/index.mjs.map +1 -0
  8. package/{lib → bundles/types}/api/api-base.d.ts +2 -1
  9. package/bundles/types/api/api-base.d.ts.map +1 -0
  10. package/{lib → bundles/types}/api/api-charge-internal.d.ts +1 -0
  11. package/bundles/types/api/api-charge-internal.d.ts.map +1 -0
  12. package/{lib → bundles/types}/api/api-charge.d.ts +1 -0
  13. package/bundles/types/api/api-charge.d.ts.map +1 -0
  14. package/{lib → bundles/types}/api/api-internal.d.ts +1 -0
  15. package/bundles/types/api/api-internal.d.ts.map +1 -0
  16. package/{lib → bundles/types}/api/api-service-internal.d.ts +2 -1
  17. package/bundles/types/api/api-service-internal.d.ts.map +1 -0
  18. package/{lib → bundles/types}/api/api.d.ts +1 -0
  19. package/bundles/types/api/api.d.ts.map +1 -0
  20. package/bundles/types/api/index.d.ts +2 -0
  21. package/bundles/types/api/index.d.ts.map +1 -0
  22. package/{lib → bundles/types}/canvas-3ds/canvas-3ds.d.ts +1 -0
  23. package/bundles/types/canvas-3ds/canvas-3ds.d.ts.map +1 -0
  24. package/{lib → bundles/types}/canvas-3ds/index.d.ts +1 -0
  25. package/bundles/types/canvas-3ds/index.d.ts.map +1 -0
  26. package/{lib → bundles/types}/canvas-3ds/services/gpayments-service.d.ts +1 -0
  27. package/bundles/types/canvas-3ds/services/gpayments-service.d.ts.map +1 -0
  28. package/{lib → bundles/types}/canvas-3ds/services/index.d.ts +1 -0
  29. package/bundles/types/canvas-3ds/services/index.d.ts.map +1 -0
  30. package/{lib → bundles/types}/canvas-3ds/services/standalone3ds-service.d.ts +1 -0
  31. package/bundles/types/canvas-3ds/services/standalone3ds-service.d.ts.map +1 -0
  32. package/{lib → bundles/types}/checkout-button/afterpay/afterpay-checkout-button.d.ts +1 -0
  33. package/bundles/types/checkout-button/afterpay/afterpay-checkout-button.d.ts.map +1 -0
  34. package/{lib → bundles/types}/checkout-button/afterpay/afterpay.runner.d.ts +1 -0
  35. package/bundles/types/checkout-button/afterpay/afterpay.runner.d.ts.map +1 -0
  36. package/{lib → bundles/types}/checkout-button/checkout-button.d.ts +1 -0
  37. package/bundles/types/checkout-button/checkout-button.d.ts.map +1 -0
  38. package/{lib → bundles/types}/checkout-button/checkout-button.interface.d.ts +1 -0
  39. package/bundles/types/checkout-button/checkout-button.interface.d.ts.map +1 -0
  40. package/{lib → bundles/types}/checkout-button/checkout-contextual-handler.d.ts +1 -0
  41. package/bundles/types/checkout-button/checkout-contextual-handler.d.ts.map +1 -0
  42. package/{lib → bundles/types}/checkout-button/index.d.ts +2 -1
  43. package/bundles/types/checkout-button/index.d.ts.map +1 -0
  44. package/{lib → bundles/types}/checkout-button/paypal/paypal-checkout-button.d.ts +1 -0
  45. package/bundles/types/checkout-button/paypal/paypal-checkout-button.d.ts.map +1 -0
  46. package/{lib → bundles/types}/checkout-button/paypal/paypal.runner.d.ts +1 -0
  47. package/bundles/types/checkout-button/paypal/paypal.runner.d.ts.map +1 -0
  48. package/{lib → bundles/types}/checkout-button/runner/base.runner.d.ts +4 -3
  49. package/bundles/types/checkout-button/runner/base.runner.d.ts.map +1 -0
  50. package/{lib → bundles/types}/checkout-button/runner/contextual.runner.d.ts +2 -1
  51. package/bundles/types/checkout-button/runner/contextual.runner.d.ts.map +1 -0
  52. package/{lib → bundles/types}/checkout-button/runner/index.d.ts +1 -0
  53. package/bundles/types/checkout-button/runner/index.d.ts.map +1 -0
  54. package/{lib → bundles/types}/checkout-button/runner/popup.runner.d.ts +2 -1
  55. package/bundles/types/checkout-button/runner/popup.runner.d.ts.map +1 -0
  56. package/{lib → bundles/types}/checkout-button/runner/redirect.runner.d.ts +2 -1
  57. package/bundles/types/checkout-button/runner/redirect.runner.d.ts.map +1 -0
  58. package/bundles/types/checkout-button/zipmoney/index.d.ts +4 -0
  59. package/bundles/types/checkout-button/zipmoney/index.d.ts.map +1 -0
  60. package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney-checkout-button.d.ts +1 -0
  61. package/bundles/types/checkout-button/zipmoney/zipmoney-checkout-button.d.ts.map +1 -0
  62. package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney-contextual.runner.d.ts +2 -1
  63. package/bundles/types/checkout-button/zipmoney/zipmoney-contextual.runner.d.ts.map +1 -0
  64. package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney-redirect.runner.d.ts +2 -1
  65. package/bundles/types/checkout-button/zipmoney/zipmoney-redirect.runner.d.ts.map +1 -0
  66. package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney.config.d.ts +1 -0
  67. package/bundles/types/checkout-button/zipmoney/zipmoney.config.d.ts.map +1 -0
  68. package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney.runner.d.ts +2 -1
  69. package/bundles/types/checkout-button/zipmoney/zipmoney.runner.d.ts.map +1 -0
  70. package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney.types.d.ts +1 -0
  71. package/bundles/types/checkout-button/zipmoney/zipmoney.types.d.ts.map +1 -0
  72. package/{lib → bundles/types}/components/ability-guard.d.ts +1 -0
  73. package/bundles/types/components/ability-guard.d.ts.map +1 -0
  74. package/{lib → bundles/types}/components/background.d.ts +1 -0
  75. package/bundles/types/components/background.d.ts.map +1 -0
  76. package/{lib → bundles/types}/components/container.d.ts +1 -0
  77. package/bundles/types/components/container.d.ts.map +1 -0
  78. package/{lib → bundles/types}/components/dispatcher.d.ts +2 -1
  79. package/bundles/types/components/dispatcher.d.ts.map +1 -0
  80. package/{lib → bundles/types}/components/element-style.d.ts +2 -1
  81. package/bundles/types/components/element-style.d.ts.map +1 -0
  82. package/{lib → bundles/types}/components/flypay-iframe-event.d.ts +1 -0
  83. package/bundles/types/components/flypay-iframe-event.d.ts.map +1 -0
  84. package/{lib/components/form-Interceptor.d.ts → bundles/types/components/form-interceptor.d.ts} +1 -0
  85. package/bundles/types/components/form-interceptor.d.ts.map +1 -0
  86. package/{lib → bundles/types}/components/http-core.d.ts +1 -0
  87. package/bundles/types/components/http-core.d.ts.map +1 -0
  88. package/{lib → bundles/types}/components/iframe-event.d.ts +2 -0
  89. package/bundles/types/components/iframe-event.d.ts.map +1 -0
  90. package/{lib → bundles/types}/components/iframe.d.ts +1 -0
  91. package/bundles/types/components/iframe.d.ts.map +1 -0
  92. package/{lib → bundles/types}/components/link.d.ts +2 -1
  93. package/bundles/types/components/link.d.ts.map +1 -0
  94. package/{lib → bundles/types}/components/loader.d.ts +1 -0
  95. package/bundles/types/components/loader.d.ts.map +1 -0
  96. package/{lib → bundles/types}/components/param.d.ts +8 -7
  97. package/bundles/types/components/param.d.ts.map +1 -0
  98. package/{lib → bundles/types}/components/popup.d.ts +1 -0
  99. package/bundles/types/components/popup.d.ts.map +1 -0
  100. package/{lib → bundles/types}/components/storage-dispatcher.d.ts +1 -0
  101. package/bundles/types/components/storage-dispatcher.d.ts.map +1 -0
  102. package/{lib → bundles/types}/components/trigger.d.ts +1 -0
  103. package/bundles/types/components/trigger.d.ts.map +1 -0
  104. package/{lib → bundles/types}/components/vault-display-iframe-event.d.ts +1 -0
  105. package/bundles/types/components/vault-display-iframe-event.d.ts.map +1 -0
  106. package/{lib → bundles/types}/components/wallet-background.d.ts +3 -1
  107. package/bundles/types/components/wallet-background.d.ts.map +1 -0
  108. package/{lib → bundles/types}/components/wallet-trigger.d.ts +1 -0
  109. package/bundles/types/components/wallet-trigger.d.ts.map +1 -0
  110. package/bundles/types/configs/env/environment.cba.d.ts +29 -0
  111. package/bundles/types/configs/env/environment.cba.d.ts.map +1 -0
  112. package/bundles/types/configs/env/environment.interface.d.ts +12 -0
  113. package/bundles/types/configs/env/environment.interface.d.ts.map +1 -0
  114. package/{lib/configs/env/env.d.ts → bundles/types/configs/env/environment.paydock.d.ts} +5 -8
  115. package/bundles/types/configs/env/environment.paydock.d.ts.map +1 -0
  116. package/bundles/types/configs/env/index.d.ts +3 -0
  117. package/bundles/types/configs/env/index.d.ts.map +1 -0
  118. package/{lib → bundles/types}/configs/sdk.d.ts +3 -2
  119. package/bundles/types/configs/sdk.d.ts.map +1 -0
  120. package/{lib → bundles/types}/constants/validators.d.ts +3 -2
  121. package/bundles/types/constants/validators.d.ts.map +1 -0
  122. package/{lib → bundles/types}/external-checkout/builder.d.ts +1 -0
  123. package/bundles/types/external-checkout/builder.d.ts.map +1 -0
  124. package/{lib → bundles/types}/external-checkout/checker.d.ts +1 -0
  125. package/bundles/types/external-checkout/checker.d.ts.map +1 -0
  126. package/bundles/types/external-checkout/index.d.ts +3 -0
  127. package/bundles/types/external-checkout/index.d.ts.map +1 -0
  128. package/{lib → bundles/types}/helper/access-token.d.ts +1 -0
  129. package/bundles/types/helper/access-token.d.ts.map +1 -0
  130. package/{lib → bundles/types}/helper/browser.d.ts +1 -0
  131. package/bundles/types/helper/browser.d.ts.map +1 -0
  132. package/bundles/types/helper/element-id.d.ts +5 -0
  133. package/bundles/types/helper/element-id.d.ts.map +1 -0
  134. package/{lib → bundles/types}/helper/event-emitter.d.ts +1 -0
  135. package/bundles/types/helper/event-emitter.d.ts.map +1 -0
  136. package/{lib → bundles/types}/helper/event.d.ts +1 -0
  137. package/bundles/types/helper/event.d.ts.map +1 -0
  138. package/{lib → bundles/types}/helper/ms.d.ts +1 -0
  139. package/bundles/types/helper/ms.d.ts.map +1 -0
  140. package/{lib → bundles/types}/helper/object.d.ts +1 -0
  141. package/bundles/types/helper/object.d.ts.map +1 -0
  142. package/{lib → bundles/types}/helper/url.d.ts +1 -0
  143. package/bundles/types/helper/url.d.ts.map +1 -0
  144. package/{lib → bundles/types}/helper/uuid.d.ts +1 -0
  145. package/bundles/types/helper/uuid.d.ts.map +1 -0
  146. package/bundles/types/index-cba.d.ts +13 -0
  147. package/bundles/types/index-cba.d.ts.map +1 -0
  148. package/bundles/types/index.d.ts +14 -0
  149. package/bundles/types/index.d.ts.map +1 -0
  150. package/{lib → bundles/types}/payment-source/builder.d.ts +1 -0
  151. package/bundles/types/payment-source/builder.d.ts.map +1 -0
  152. package/{lib → bundles/types}/payment-source/index.d.ts +1 -0
  153. package/bundles/types/payment-source/index.d.ts.map +1 -0
  154. package/{lib → bundles/types}/payment-source-widget/html-payment-source-widget.d.ts +1 -0
  155. package/bundles/types/payment-source-widget/html-payment-source-widget.d.ts.map +1 -0
  156. package/{lib → bundles/types}/payment-source-widget/index.d.ts +1 -0
  157. package/bundles/types/payment-source-widget/index.d.ts.map +1 -0
  158. package/{lib → bundles/types}/payment-source-widget/interfaces.d.ts +1 -0
  159. package/bundles/types/payment-source-widget/interfaces.d.ts.map +1 -0
  160. package/{lib → bundles/types}/payment-source-widget/payment-source-widget.d.ts +1 -0
  161. package/bundles/types/payment-source-widget/payment-source-widget.d.ts.map +1 -0
  162. package/bundles/types/secure-remote-commerce/click-to-pay-secure-remote-commerce.d.ts +31 -0
  163. package/bundles/types/secure-remote-commerce/click-to-pay-secure-remote-commerce.d.ts.map +1 -0
  164. package/{lib → bundles/types}/secure-remote-commerce/index.d.ts +5 -4
  165. package/bundles/types/secure-remote-commerce/index.d.ts.map +1 -0
  166. package/{lib → bundles/types}/secure-remote-commerce/interfaces.d.ts +10 -9
  167. package/bundles/types/secure-remote-commerce/interfaces.d.ts.map +1 -0
  168. package/bundles/types/secure-remote-commerce/providers/mastercard-src/index.d.ts +2 -0
  169. package/bundles/types/secure-remote-commerce/providers/mastercard-src/index.d.ts.map +1 -0
  170. package/{lib → bundles/types}/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts +5 -4
  171. package/bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts.map +1 -0
  172. package/{lib → bundles/types}/secure-remote-commerce/providers/src-provider.d.ts +1 -0
  173. package/bundles/types/secure-remote-commerce/providers/src-provider.d.ts.map +1 -0
  174. package/{lib → bundles/types}/secure-remote-commerce/secure-remote-commerce.d.ts +4 -3
  175. package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts.map +1 -0
  176. package/{lib → bundles/types}/vault-display-widget/index.d.ts +1 -0
  177. package/bundles/types/vault-display-widget/index.d.ts.map +1 -0
  178. package/{lib → bundles/types}/vault-display-widget/vault-display-widget.d.ts +1 -0
  179. package/bundles/types/vault-display-widget/vault-display-widget.d.ts.map +1 -0
  180. package/{lib → bundles/types}/wallet-buttons/afterpay.wallet-service.d.ts +1 -0
  181. package/bundles/types/wallet-buttons/afterpay.wallet-service.d.ts.map +1 -0
  182. package/{lib → bundles/types}/wallet-buttons/apple.wallet-service.d.ts +1 -0
  183. package/bundles/types/wallet-buttons/apple.wallet-service.d.ts.map +1 -0
  184. package/{lib → bundles/types}/wallet-buttons/flypay-v2.wallet-service.d.ts +2 -1
  185. package/bundles/types/wallet-buttons/flypay-v2.wallet-service.d.ts.map +1 -0
  186. package/{lib → bundles/types}/wallet-buttons/flypay.wallet-service.d.ts +1 -0
  187. package/bundles/types/wallet-buttons/flypay.wallet-service.d.ts.map +1 -0
  188. package/{lib → bundles/types}/wallet-buttons/google.wallet-service.d.ts +1 -0
  189. package/bundles/types/wallet-buttons/google.wallet-service.d.ts.map +1 -0
  190. package/bundles/types/wallet-buttons/helpers/flypay-v2.helper.d.ts +6 -0
  191. package/bundles/types/wallet-buttons/helpers/flypay-v2.helper.d.ts.map +1 -0
  192. package/bundles/types/wallet-buttons/index-cba.d.ts +2 -0
  193. package/bundles/types/wallet-buttons/index-cba.d.ts.map +1 -0
  194. package/{lib → bundles/types}/wallet-buttons/index.d.ts +1 -0
  195. package/bundles/types/wallet-buttons/index.d.ts.map +1 -0
  196. package/{lib → bundles/types}/wallet-buttons/interfaces.d.ts +1 -0
  197. package/bundles/types/wallet-buttons/interfaces.d.ts.map +1 -0
  198. package/{lib → bundles/types}/wallet-buttons/mastercard.wallet-service.d.ts +1 -0
  199. package/bundles/types/wallet-buttons/mastercard.wallet-service.d.ts.map +1 -0
  200. package/{lib → bundles/types}/wallet-buttons/paypal.wallet-service.d.ts +1 -0
  201. package/bundles/types/wallet-buttons/paypal.wallet-service.d.ts.map +1 -0
  202. package/{lib → bundles/types}/wallet-buttons/stripe.wallet-service.d.ts +1 -0
  203. package/bundles/types/wallet-buttons/stripe.wallet-service.d.ts.map +1 -0
  204. package/{lib → bundles/types}/wallet-buttons/wallet-buttons.d.ts +1 -0
  205. package/bundles/types/wallet-buttons/wallet-buttons.d.ts.map +1 -0
  206. package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts +330 -0
  207. package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts.map +1 -0
  208. package/{lib → bundles/types}/wallet-buttons/wallet-service.d.ts +1 -0
  209. package/bundles/types/wallet-buttons/wallet-service.d.ts.map +1 -0
  210. package/{lib → bundles/types}/widget/configuration.d.ts +2 -1
  211. package/bundles/types/widget/configuration.d.ts.map +1 -0
  212. package/{lib → bundles/types}/widget/html-multi-widget.d.ts +4 -3
  213. package/bundles/types/widget/html-multi-widget.d.ts.map +1 -0
  214. package/{lib → bundles/types}/widget/html-widget.d.ts +1 -0
  215. package/bundles/types/widget/html-widget.d.ts.map +1 -0
  216. package/{lib → bundles/types}/widget/index.d.ts +2 -1
  217. package/bundles/types/widget/index.d.ts.map +1 -0
  218. package/{lib → bundles/types}/widget/meta.d.ts +1 -0
  219. package/bundles/types/widget/meta.d.ts.map +1 -0
  220. package/{lib → bundles/types}/widget/multi-widget.d.ts +2 -1
  221. package/bundles/types/widget/multi-widget.d.ts.map +1 -0
  222. package/{lib → bundles/types}/widget/style.d.ts +1 -0
  223. package/bundles/types/widget/style.d.ts.map +1 -0
  224. package/bundles/widget.umd.js +6755 -6894
  225. package/bundles/widget.umd.js.d.ts +3206 -0
  226. package/bundles/widget.umd.js.map +1 -0
  227. package/bundles/widget.umd.js.min.d.ts +3206 -0
  228. package/bundles/widget.umd.min.js +2 -1
  229. package/bundles/widget.umd.min.js.map +1 -0
  230. package/docs/api-canvas3ds.md +158 -0
  231. package/docs/api-checkout-button.md +912 -0
  232. package/docs/api-examples.md +65 -0
  233. package/docs/api-ps-widget.md +585 -0
  234. package/docs/api-vault-display.md +94 -0
  235. package/docs/api-widget.md +2499 -0
  236. package/docs/api-wrapper.md +78 -0
  237. package/docs/canvas3ds-examples.md +242 -0
  238. package/docs/cba-header.md +13 -0
  239. package/docs/cba-license.md +2 -0
  240. package/docs/checkout-examples.md +248 -0
  241. package/docs/click-to-pay-examples.md +231 -0
  242. package/docs/click-to-pay.md +336 -0
  243. package/docs/header.md +15 -0
  244. package/docs/html/layout.html +78 -0
  245. package/docs/html/marked.js +23 -0
  246. package/docs/html/style.css +365 -0
  247. package/docs/install/npm.content.md +16 -0
  248. package/docs/install/npm.example.md +24 -0
  249. package/docs/install/umd.content.md +20 -0
  250. package/docs/install/umd.example.md +6 -0
  251. package/docs/install.md +43 -0
  252. package/docs/install.readme.t.md +17 -0
  253. package/docs/install.slate.t.md +17 -0
  254. package/docs/license.md +2 -0
  255. package/docs/partials/header.hbs +3 -0
  256. package/docs/ps-examples.md +129 -0
  257. package/docs/vault-display-example.md +132 -0
  258. package/docs/wallet-buttons-examples.md +609 -0
  259. package/docs/wallet-buttons.md +619 -0
  260. package/docs/wallet-cba-buttons-examples.md +388 -0
  261. package/docs/widget-examples.md +134 -0
  262. package/package.json +164 -42
  263. package/slate.md +141 -106
  264. package/.nvmrc +0 -1
  265. package/api.d.ts +0 -1
  266. package/api.js +0 -1
  267. package/canvas3ds.d.ts +0 -1
  268. package/canvas3ds.js +0 -1
  269. package/checkout-button.d.ts +0 -1
  270. package/checkout-button.js +0 -1
  271. package/inicialization-guide.md +0 -7
  272. package/lib/api/api-base.js +0 -101
  273. package/lib/api/api-base.js.map +0 -1
  274. package/lib/api/api-charge-internal.js +0 -30
  275. package/lib/api/api-charge-internal.js.map +0 -1
  276. package/lib/api/api-charge.js +0 -49
  277. package/lib/api/api-charge.js.map +0 -1
  278. package/lib/api/api-internal.js +0 -13
  279. package/lib/api/api-internal.js.map +0 -1
  280. package/lib/api/api-service-internal.js +0 -19
  281. package/lib/api/api-service-internal.js.map +0 -1
  282. package/lib/api/api.js +0 -62
  283. package/lib/api/api.js.map +0 -1
  284. package/lib/api/index.d.ts +0 -1
  285. package/lib/api/index.js +0 -2
  286. package/lib/api/index.js.map +0 -1
  287. package/lib/canvas-3ds/canvas-3ds.js +0 -157
  288. package/lib/canvas-3ds/canvas-3ds.js.map +0 -1
  289. package/lib/canvas-3ds/index.js +0 -2
  290. package/lib/canvas-3ds/index.js.map +0 -1
  291. package/lib/canvas-3ds/services/gpayments-service.js +0 -181
  292. package/lib/canvas-3ds/services/gpayments-service.js.map +0 -1
  293. package/lib/canvas-3ds/services/index.js +0 -2
  294. package/lib/canvas-3ds/services/index.js.map +0 -1
  295. package/lib/canvas-3ds/services/standalone3ds-service.js +0 -32
  296. package/lib/canvas-3ds/services/standalone3ds-service.js.map +0 -1
  297. package/lib/checkout-button/afterpay/afterpay-checkout-button.js +0 -50
  298. package/lib/checkout-button/afterpay/afterpay-checkout-button.js.map +0 -1
  299. package/lib/checkout-button/afterpay/afterpay.runner.js +0 -41
  300. package/lib/checkout-button/afterpay/afterpay.runner.js.map +0 -1
  301. package/lib/checkout-button/checkout-button.interface.js +0 -45
  302. package/lib/checkout-button/checkout-button.interface.js.map +0 -1
  303. package/lib/checkout-button/checkout-button.js +0 -266
  304. package/lib/checkout-button/checkout-button.js.map +0 -1
  305. package/lib/checkout-button/checkout-contextual-handler.js +0 -75
  306. package/lib/checkout-button/checkout-contextual-handler.js.map +0 -1
  307. package/lib/checkout-button/index.js +0 -85
  308. package/lib/checkout-button/index.js.map +0 -1
  309. package/lib/checkout-button/paypal/paypal-checkout-button.js +0 -25
  310. package/lib/checkout-button/paypal/paypal-checkout-button.js.map +0 -1
  311. package/lib/checkout-button/paypal/paypal.runner.js +0 -14
  312. package/lib/checkout-button/paypal/paypal.runner.js.map +0 -1
  313. package/lib/checkout-button/runner/base.runner.js +0 -13
  314. package/lib/checkout-button/runner/base.runner.js.map +0 -1
  315. package/lib/checkout-button/runner/contextual.runner.js +0 -40
  316. package/lib/checkout-button/runner/contextual.runner.js.map +0 -1
  317. package/lib/checkout-button/runner/index.js +0 -11
  318. package/lib/checkout-button/runner/index.js.map +0 -1
  319. package/lib/checkout-button/runner/popup.runner.js +0 -68
  320. package/lib/checkout-button/runner/popup.runner.js.map +0 -1
  321. package/lib/checkout-button/runner/redirect.runner.js +0 -15
  322. package/lib/checkout-button/runner/redirect.runner.js.map +0 -1
  323. package/lib/checkout-button/zipmoney/zipmoney-checkout-button.js +0 -64
  324. package/lib/checkout-button/zipmoney/zipmoney-checkout-button.js.map +0 -1
  325. package/lib/checkout-button/zipmoney/zipmoney-contextual.runner.js +0 -78
  326. package/lib/checkout-button/zipmoney/zipmoney-contextual.runner.js.map +0 -1
  327. package/lib/checkout-button/zipmoney/zipmoney-redirect.runner.js +0 -49
  328. package/lib/checkout-button/zipmoney/zipmoney-redirect.runner.js.map +0 -1
  329. package/lib/checkout-button/zipmoney/zipmoney.config.js +0 -4
  330. package/lib/checkout-button/zipmoney/zipmoney.config.js.map +0 -1
  331. package/lib/checkout-button/zipmoney/zipmoney.runner.js +0 -23
  332. package/lib/checkout-button/zipmoney/zipmoney.runner.js.map +0 -1
  333. package/lib/checkout-button/zipmoney/zipmoney.types.js +0 -1
  334. package/lib/checkout-button/zipmoney/zipmoney.types.js.map +0 -1
  335. package/lib/components/ability-guard.js +0 -44
  336. package/lib/components/ability-guard.js.map +0 -1
  337. package/lib/components/background.js +0 -193
  338. package/lib/components/background.js.map +0 -1
  339. package/lib/components/container.js +0 -63
  340. package/lib/components/container.js.map +0 -1
  341. package/lib/components/dispatcher.js +0 -39
  342. package/lib/components/dispatcher.js.map +0 -1
  343. package/lib/components/element-style.js +0 -52
  344. package/lib/components/element-style.js.map +0 -1
  345. package/lib/components/flypay-iframe-event.js +0 -28
  346. package/lib/components/flypay-iframe-event.js.map +0 -1
  347. package/lib/components/form-Interceptor.js +0 -38
  348. package/lib/components/form-Interceptor.js.map +0 -1
  349. package/lib/components/http-core.js +0 -57
  350. package/lib/components/http-core.js.map +0 -1
  351. package/lib/components/iframe-event.js +0 -77
  352. package/lib/components/iframe-event.js.map +0 -1
  353. package/lib/components/iframe.js +0 -62
  354. package/lib/components/iframe.js.map +0 -1
  355. package/lib/components/link.js +0 -60
  356. package/lib/components/link.js.map +0 -1
  357. package/lib/components/loader.js +0 -234
  358. package/lib/components/loader.js.map +0 -1
  359. package/lib/components/param.js +0 -147
  360. package/lib/components/param.js.map +0 -1
  361. package/lib/components/popup.js +0 -104
  362. package/lib/components/popup.js.map +0 -1
  363. package/lib/components/storage-dispatcher.js +0 -75
  364. package/lib/components/storage-dispatcher.js.map +0 -1
  365. package/lib/components/trigger.js +0 -49
  366. package/lib/components/trigger.js.map +0 -1
  367. package/lib/components/vault-display-iframe-event.js +0 -27
  368. package/lib/components/vault-display-iframe-event.js.map +0 -1
  369. package/lib/components/wallet-background.js +0 -75
  370. package/lib/components/wallet-background.js.map +0 -1
  371. package/lib/components/wallet-trigger.js +0 -27
  372. package/lib/components/wallet-trigger.js.map +0 -1
  373. package/lib/configs/env/env.js +0 -117
  374. package/lib/configs/env/env.js.map +0 -1
  375. package/lib/configs/sdk.js +0 -16
  376. package/lib/configs/sdk.js.map +0 -1
  377. package/lib/constants/validators.js +0 -42
  378. package/lib/constants/validators.js.map +0 -1
  379. package/lib/external-checkout/builder.js +0 -45
  380. package/lib/external-checkout/builder.js.map +0 -1
  381. package/lib/external-checkout/checker.js +0 -22
  382. package/lib/external-checkout/checker.js.map +0 -1
  383. package/lib/external-checkout/index.d.ts +0 -2
  384. package/lib/external-checkout/index.js +0 -3
  385. package/lib/external-checkout/index.js.map +0 -1
  386. package/lib/helper/access-token.js +0 -44
  387. package/lib/helper/access-token.js.map +0 -1
  388. package/lib/helper/browser.js +0 -79
  389. package/lib/helper/browser.js.map +0 -1
  390. package/lib/helper/event-emitter.js +0 -23
  391. package/lib/helper/event-emitter.js.map +0 -1
  392. package/lib/helper/event.js +0 -23
  393. package/lib/helper/event.js.map +0 -1
  394. package/lib/helper/ms.js +0 -32
  395. package/lib/helper/ms.js.map +0 -1
  396. package/lib/helper/object.js +0 -6
  397. package/lib/helper/object.js.map +0 -1
  398. package/lib/helper/url.js +0 -11
  399. package/lib/helper/url.js.map +0 -1
  400. package/lib/helper/uuid.js +0 -26
  401. package/lib/helper/uuid.js.map +0 -1
  402. package/lib/index.d.ts +0 -15
  403. package/lib/index.js +0 -15
  404. package/lib/index.js.map +0 -1
  405. package/lib/payment-source/builder.js +0 -49
  406. package/lib/payment-source/builder.js.map +0 -1
  407. package/lib/payment-source/index.js +0 -2
  408. package/lib/payment-source/index.js.map +0 -1
  409. package/lib/payment-source-widget/html-payment-source-widget.js +0 -172
  410. package/lib/payment-source-widget/html-payment-source-widget.js.map +0 -1
  411. package/lib/payment-source-widget/index.js +0 -35
  412. package/lib/payment-source-widget/index.js.map +0 -1
  413. package/lib/payment-source-widget/interfaces.js +0 -2
  414. package/lib/payment-source-widget/interfaces.js.map +0 -1
  415. package/lib/payment-source-widget/payment-source-widget.js +0 -142
  416. package/lib/payment-source-widget/payment-source-widget.js.map +0 -1
  417. package/lib/secure-remote-commerce/index.js +0 -103
  418. package/lib/secure-remote-commerce/index.js.map +0 -1
  419. package/lib/secure-remote-commerce/interfaces.js +0 -48
  420. package/lib/secure-remote-commerce/interfaces.js.map +0 -1
  421. package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.d.ts +0 -30
  422. package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.js +0 -40
  423. package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.js.map +0 -1
  424. package/lib/secure-remote-commerce/providers/mastercard-src/index.d.ts +0 -1
  425. package/lib/secure-remote-commerce/providers/mastercard-src/index.js +0 -2
  426. package/lib/secure-remote-commerce/providers/mastercard-src/index.js.map +0 -1
  427. package/lib/secure-remote-commerce/providers/mastercard-src/mastercard-src.js +0 -89
  428. package/lib/secure-remote-commerce/providers/mastercard-src/mastercard-src.js.map +0 -1
  429. package/lib/secure-remote-commerce/providers/src-provider.js +0 -1
  430. package/lib/secure-remote-commerce/providers/src-provider.js.map +0 -1
  431. package/lib/secure-remote-commerce/secure-remote-commerce.js +0 -155
  432. package/lib/secure-remote-commerce/secure-remote-commerce.js.map +0 -1
  433. package/lib/vault-display-widget/index.js +0 -14
  434. package/lib/vault-display-widget/index.js.map +0 -1
  435. package/lib/vault-display-widget/vault-display-widget.js +0 -99
  436. package/lib/vault-display-widget/vault-display-widget.js.map +0 -1
  437. package/lib/wallet-buttons/afterpay.wallet-service.js +0 -152
  438. package/lib/wallet-buttons/afterpay.wallet-service.js.map +0 -1
  439. package/lib/wallet-buttons/apple.wallet-service.js +0 -324
  440. package/lib/wallet-buttons/apple.wallet-service.js.map +0 -1
  441. package/lib/wallet-buttons/flypay-v2.wallet-service.js +0 -163
  442. package/lib/wallet-buttons/flypay-v2.wallet-service.js.map +0 -1
  443. package/lib/wallet-buttons/flypay.wallet-service.js +0 -117
  444. package/lib/wallet-buttons/flypay.wallet-service.js.map +0 -1
  445. package/lib/wallet-buttons/google.wallet-service.js +0 -301
  446. package/lib/wallet-buttons/google.wallet-service.js.map +0 -1
  447. package/lib/wallet-buttons/helpers/flypay-v2.helper.d.ts +0 -3
  448. package/lib/wallet-buttons/helpers/flypay-v2.helper.js +0 -151
  449. package/lib/wallet-buttons/helpers/flypay-v2.helper.js.map +0 -1
  450. package/lib/wallet-buttons/index.js +0 -128
  451. package/lib/wallet-buttons/index.js.map +0 -1
  452. package/lib/wallet-buttons/interfaces.js +0 -1
  453. package/lib/wallet-buttons/interfaces.js.map +0 -1
  454. package/lib/wallet-buttons/mastercard.wallet-service.js +0 -27
  455. package/lib/wallet-buttons/mastercard.wallet-service.js.map +0 -1
  456. package/lib/wallet-buttons/paypal.wallet-service.js +0 -144
  457. package/lib/wallet-buttons/paypal.wallet-service.js.map +0 -1
  458. package/lib/wallet-buttons/stripe.wallet-service.js +0 -100
  459. package/lib/wallet-buttons/stripe.wallet-service.js.map +0 -1
  460. package/lib/wallet-buttons/wallet-buttons.js +0 -479
  461. package/lib/wallet-buttons/wallet-buttons.js.map +0 -1
  462. package/lib/wallet-buttons/wallet-service.js +0 -60
  463. package/lib/wallet-buttons/wallet-service.js.map +0 -1
  464. package/lib/widget/configuration.js +0 -260
  465. package/lib/widget/configuration.js.map +0 -1
  466. package/lib/widget/html-multi-widget.js +0 -422
  467. package/lib/widget/html-multi-widget.js.map +0 -1
  468. package/lib/widget/html-widget.js +0 -127
  469. package/lib/widget/html-widget.js.map +0 -1
  470. package/lib/widget/index.js +0 -132
  471. package/lib/widget/index.js.map +0 -1
  472. package/lib/widget/meta.js +0 -8
  473. package/lib/widget/meta.js.map +0 -1
  474. package/lib/widget/multi-widget.js +0 -437
  475. package/lib/widget/multi-widget.js.map +0 -1
  476. package/lib/widget/style.js +0 -204
  477. package/lib/widget/style.js.map +0 -1
  478. package/payment-source-widget.d.ts +0 -1
  479. package/payment-source-widget.js +0 -1
  480. package/tslint.json +0 -129
  481. package/typings/globals/jasmine/index.d.ts +0 -576
  482. package/typings/globals/jasmine-ajax/index.d.ts +0 -83
  483. package/typings/globals/jquery/index.d.ts +0 -3759
  484. package/typings/index.d.ts +0 -3
  485. package/vault-display-widget.d.ts +0 -1
  486. package/vault-display-widget.js +0 -1
  487. package/vendors/zipmoney.d.ts +0 -18
  488. package/vendors/zipmoney.js +0 -1
  489. package/widget.d.ts +0 -1
  490. package/widget.js +0 -1
@@ -1,260 +0,0 @@
1
- import { AccessToken } from './../helper/access-token';
2
- import { API_URL, Env } from '../configs/env/env';
3
- import { SDK } from '../configs/sdk';
4
- import { ObjectHelper } from '../helper/object';
5
- import { FORM_FIELD, SUPPORTED_CHECKOUT_META_COLLECTION, } from "../components/param";
6
- /**
7
- * List of available payment source types
8
- *
9
- * @type {object}
10
- * @param {string} CARD=card
11
- * @param {string} BANK_ACCOUNT=bank_account
12
- * @param {string} CHECKOUT=checkout
13
- */
14
- export const PAYMENT_TYPE = {
15
- CARD: 'card',
16
- GIFT_CARD: 'gift_card',
17
- BANK_ACCOUNT: 'bank_account',
18
- CHECKOUT: 'checkout',
19
- };
20
- /**
21
- * Purposes
22
- * @type {object}
23
- * @param {string} PAYMENT_SOURCE=payment_source
24
- * @param {string} CARD_PAYMENT_SOURCE_WITH_CVV=card_payment_source_with_cvv
25
- * @param {string} CARD_PAYMENT_SOURCE_WITHOUT_CVV=card_payment_source_without_cvv
26
- * */
27
- export const PURPOSE = {
28
- PAYMENT_SOURCE: 'payment_source',
29
- CARD_PAYMENT_SOURCE_WITH_CVV: 'card_payment_source_with_cvv',
30
- CARD_PAYMENT_SOURCE_WITHOUT_CVV: 'card_payment_source_without_cvv',
31
- };
32
- const CONFIGURATION_LINK = '/v1/remote-action/configs';
33
- /**
34
- * Class Configuration include methods for creating configuration token
35
- * @constructor
36
- *
37
- * @example
38
- * var config = new Configuration('gatewayId'); // short
39
- *
40
- * var config = new Configuration('gatewayId', 'bank_account', 'paymentSource'); // extend
41
- *
42
- * var config = new Configuration('not_configured'); // without gateway
43
- *
44
- * @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.
45
- * @param {string} paymentType - Type of payment source which shows in widget form. Available parameters [PAYMENT_TYPE]{@link PAYMENT_TYPE}
46
- * @param {string} purpose - Param which describes payment purpose. By default uses Available parameters [PURPOSE]{@link PURPOSE}
47
- */
48
- class Configuration {
49
- /** @constructs */ // constructs added for correct parse classes jsdoc2md
50
- constructor(gatewayID = 'default', paymentType = PAYMENT_TYPE.CARD, purpose = PURPOSE.PAYMENT_SOURCE) {
51
- if (ObjectHelper.values(PAYMENT_TYPE).indexOf(paymentType) === -1)
52
- throw new Error('unsupported payment type');
53
- else if (paymentType === PAYMENT_TYPE.CHECKOUT)
54
- throw new Error('Payment type "checkout" is deprecated. Use CheckoutButton for this type of payments https://www.npmjs.com/package/@paydock/client-sdk#checkout-button');
55
- if (ObjectHelper.values(PURPOSE).indexOf(purpose) === -1)
56
- throw new Error('unsupported purpose');
57
- this.env = new Env(API_URL);
58
- this.configs = {
59
- purpose: purpose,
60
- meta: {},
61
- dynamic_fields_position: true,
62
- predefined_fields: {
63
- gateway_id: gatewayID,
64
- type: paymentType,
65
- card_scheme: null,
66
- card_processing_network: null,
67
- },
68
- };
69
- }
70
- static createEachToken(accessToken, configs, cb, errorCb = (errors) => { }) {
71
- let tokens = new Array(configs.length);
72
- let errors = [];
73
- let counter = 0;
74
- for (let index in configs) {
75
- if (configs.hasOwnProperty(index))
76
- configs[index].createToken(accessToken, (token) => {
77
- tokens[index] = token;
78
- counter++;
79
- if (configs.length === counter)
80
- Configuration.finishCreatingEachToken(tokens, errors, cb, errorCb);
81
- }, (err) => {
82
- errors.push(`gateway: ${configs[index].getConfigs().predefined_fields.gateway_id} | ${err}`);
83
- counter++;
84
- if (configs.length === counter)
85
- Configuration.finishCreatingEachToken(tokens, errors, cb, errorCb);
86
- });
87
- }
88
- }
89
- static finishCreatingEachToken(tokens, errors, cb, errorCb) {
90
- if (errors.length >= 1)
91
- errorCb(errors);
92
- else
93
- cb(tokens);
94
- }
95
- /**
96
- * Destination, where customer will receive all successful responses.
97
- * Response will contain “data” object with “payment_source” or other parameters, in depending on 'purpose'
98
- *
99
- * @example
100
- * config.setWebHookDestination('http://google.com');
101
- *
102
- * @param {string} url - Your endpoint for post request.
103
- */
104
- setWebHookDestination(url) {
105
- this.configs.webhook_destination = url;
106
- }
107
- /**
108
- * URL to which the Customer will be redirected to after the success finish
109
- *
110
- * @example
111
- * config.setSuccessRedirectUrl('google.com/search?q=success');
112
- *
113
- * @param {string} url
114
- */
115
- setSuccessRedirectUrl(url) {
116
- this.configs.success_redirect_url = url;
117
- }
118
- /**
119
- * URL to which the Customer will be redirected to if an error is triggered in the process of operation
120
- *
121
- * @example
122
- * config.setErrorRedirectUrl('google.com/search?q=error');
123
- *
124
- * @param {string} url
125
- */
126
- setErrorRedirectUrl(url) {
127
- this.configs.error_redirect_url = url;
128
- }
129
- /**
130
- * Set list with widget form field, which will be shown in form. Also you can set the required validation for these fields
131
- *
132
- * @example
133
- * config.setFormFields(['phone', 'email', 'first_name*']);
134
- *
135
- * @param {string[]} fields - name of fields which can be shown in a widget.
136
- * If after a name of a field, you put “*”, this field will be required on client-side.
137
- * (For validation, you can specify any fields, even those that are shown by default: card_number, expiration, etc... ) [FORM_FIELD]{@link FORM_FIELD}
138
- */
139
- setFormFields(fields) {
140
- if (!Array.isArray(this.configs.defined_form_fields))
141
- this.configs.defined_form_fields = [];
142
- for (let index in fields) {
143
- if (!fields.hasOwnProperty(index))
144
- continue;
145
- if (ObjectHelper.values(FORM_FIELD).indexOf(fields[index].replace('*', '')) !== -1)
146
- this.configs.defined_form_fields.push(fields[index]);
147
- else
148
- console.warn(`Configuration::setFormFields: unsupported form field ${fields[index]}`);
149
- }
150
- }
151
- /**
152
- * Method for setting meta information for checkout page
153
- *
154
- * @example
155
- * config.setMeta({
156
- brand_name: 'paydock',
157
- reference: '15',
158
- email: 'wault@paydock.com'
159
- });
160
- *
161
- * @param {IPayPalMeta | IZipmoneyMeta | IAfterpayMeta | IBamboraMeta} object -
162
- * data which can be shown on checkout page [IPayPalMeta]{@link IPayPalMeta} [IZipmoneyMeta]{@link IZipmoneyMeta} [IAfterpayMeta]{@link IAfterpayMeta} [IBamboraMeta]{@link IBamboraMeta}
163
- */
164
- setMeta(meta) {
165
- for (let key in meta) {
166
- if (!meta.hasOwnProperty(key))
167
- continue;
168
- if (SUPPORTED_CHECKOUT_META_COLLECTION.indexOf(key) !== -1)
169
- this.configs.meta[key] = meta[key];
170
- else
171
- console.warn(`Configuration::setMeta: unsupported meta key ${key}`);
172
- }
173
- }
174
- /**
175
- * Current method can change environment. By default environment = sandbox.
176
- * Also we can change domain alias for this environment. By default domain_alias = paydock.com
177
- *
178
- * @example
179
- * config.setEnv('production');
180
- * @param {string} env - sandbox, production
181
- * @param {string} [alias] - Own domain alias
182
- */
183
- setEnv(env, alias) {
184
- this.env.setEnv(env, alias);
185
- }
186
- /**
187
- * Title for tab which can be set instead of default
188
- *
189
- * @example
190
- * config.setLabel('custom label');
191
- *
192
- * @param {string} label - Text label for tab
193
- */
194
- setLabel(label) {
195
- this.configs.label = label;
196
- }
197
- getEnv() {
198
- return this.env.getEnv();
199
- }
200
- /**
201
- * createToken - method which exactly create payment one time token
202
- *
203
- * @example
204
- * config.createToken('582035346f65cdd57ee81192d6e5w65w4e5',
205
- * function (data) {
206
- * console.log(data);
207
- * }, function (error) {
208
- * console.log(error);
209
- * });
210
- *
211
- * @param {string} accessToken - Customer access token or public key which provided for each client
212
- * @param {createToken~requestCallback} cb - The callback that handles the success response.
213
- * @param {createToken~requestCallback} errorCb - The callback that handles the failed response.
214
- */
215
- createToken(accessToken, cb, errorCb = (err) => { }) {
216
- this.send(accessToken, (data, status) => {
217
- if (status >= 200 && status < 300)
218
- return cb(data.resource.data.configuration_token);
219
- if (typeof data.error === "undefined" || typeof data.error.message === "undefined")
220
- errorCb('unknown error');
221
- else
222
- errorCb(data.error.message);
223
- });
224
- }
225
- send(accessToken, cb) {
226
- let request = new XMLHttpRequest();
227
- request.open('POST', this.getUrl(), true);
228
- request.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');
229
- request.setRequestHeader(AccessToken.getAccessHeaderNameByToken(accessToken), accessToken);
230
- if (SDK.version) {
231
- request.setRequestHeader(SDK.headerKeys.version, SDK.version);
232
- request.setRequestHeader(SDK.headerKeys.type, SDK.type);
233
- }
234
- request.send(JSON.stringify(this.getConfigs()));
235
- request.onload = () => {
236
- let res = {};
237
- try {
238
- res = JSON.parse(request.responseText);
239
- }
240
- catch (e) { }
241
- cb(res, request.status);
242
- };
243
- }
244
- getConfigs() {
245
- return this.configs;
246
- }
247
- getUrl() {
248
- return this.env.getConf().url + CONFIGURATION_LINK;
249
- }
250
- setGiftCardSchemeData(giftCardScheme, processingNetwork) {
251
- if (this.configs.predefined_fields.type !== PAYMENT_TYPE.GIFT_CARD)
252
- throw new Error('unsupported payment type');
253
- if (!giftCardScheme || !processingNetwork)
254
- throw new Error('');
255
- this.configs.predefined_fields.card_scheme = giftCardScheme;
256
- this.configs.predefined_fields.card_processing_network = processingNetwork;
257
- }
258
- }
259
- export { Configuration };
260
- //# sourceMappingURL=../../src/lib/widget/configuration.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../widget/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,GAAG,EAAO,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EACH,UAAU,EAA6C,kCAAkC,GAE5F,MAAM,qBAAqB,CAAC;AAG7B;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IACxB,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,WAAW;IACtB,YAAY,EAAE,cAAc;IAC5B,QAAQ,EAAE,UAAU;CACvB,CAAA;AAED;;;;;;KAMK;AACL,MAAM,CAAC,MAAM,OAAO,GAAG;IACnB,cAAc,EAAE,gBAAgB;IAChC,4BAA4B,EAAE,8BAA8B;IAC5D,+BAA+B,EAAE,iCAAiC;CACrE,CAAA;AAID,MAAM,kBAAkB,GAAG,2BAA2B,CAAC;AAsBvD;;;;;;;;;;;;;;GAcG;AACH,MAAM,aAAa;IA6Cf,kBAAkB,CAAC,sDAAsD;IACzE,YAAY,YAAoB,SAAS,EAAE,cAAsB,YAAY,CAAC,IAAI,EAAE,UAAkB,OAAO,CAAC,c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AAO,CAAC,MAAM,GAAG,GAAG,EAAE;YAClB,IAAI,GAAG,GAAQ,EAAE,CAAC;YAClB,IAAI;gBACA,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;aAC1C;YAAC,OAAO,CAAC,EAAE,GAAE;YACd,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAC5B,CAAC,CAAC;IACN,CAAC;IAGM,UAAU;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAGO,MAAM;QACV,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,GAAG,GAAG,kBAAkB,CAAC;IACvD,CAAC;IAEM,qBAAqB,CAAC,cAAc,EAAE,iBAAiB;QAC1D,IAAI,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,KAAK,YAAY,CAAC,SAAS;YAC9D,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAEhD,IAAI,CAAC,cAAc,IAAI,CAAC,iBAAiB;YACrC,MAAM,IAAI,KAAK,CAAC,EAAE,CAAC,CAAC;QAGxB,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,WAAW,GAAG,cAAc,CAAC;QAC5D,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,uBAAuB,GAAG,iBAAiB,CAAC;IAC/E,CAAC;CACJ;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -1,422 +0,0 @@
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