@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,193 @@
1
+ import { EventEmitter } from '../helper/event-emitter';
2
+ import { Event as EventHelper } from '../helper/event';
3
+ import { TEMPLATE as LOADER_TEMPLATE, STYLE as LOADER_STYLE } from "./loader";
4
+ import { Browser } from "../helper/browser";
5
+ /**
6
+ *
7
+ * @type {object}
8
+ * @param {string} CLOSE=close
9
+ * @param {string} FOCUS=focus
10
+ */
11
+ export const TRIGGER = {
12
+ CLOSE: 'close',
13
+ FOCUS: 'focus',
14
+ };
15
+ const TEMPLATE = `
16
+ <div class="checkout-container">
17
+ <strong class="checkout-title" data-title>{{title}}</strong>
18
+ <p data-description>{{description}}</p>
19
+ <a href="#" data-continue>Continue</a>
20
+ <a href="#" data-close>Close</a>
21
+ </div>
22
+ `;
23
+ const STYLES = `
24
+ .hide-continue-button [data-continue] {
25
+ display: none;
26
+ }
27
+
28
+ .checkout-overlay .cs-loader-inner {
29
+ color: #ddd;
30
+ }
31
+
32
+ .checkout-overlay {
33
+ position: fixed;
34
+ top: 0;
35
+ left: 0;
36
+ right: 0;
37
+ bottom: 0;
38
+ background: rgba(0,0,0, 0.5);
39
+ text-align: center;
40
+ color: #fff;
41
+ opacity: 0;
42
+ }
43
+ .checkout-overlay.display {
44
+ opacity: 1;
45
+ transition: opacity 0.7s ease-out;
46
+ }
47
+ .checkout-overlay a { color: #00f; }
48
+ .checkout-container {
49
+ position: absolute;
50
+ top: 50%;
51
+ left: 0;
52
+ width: 100%;
53
+ margin-top: -{{width}}px;
54
+ }
55
+ .checkout-title {
56
+ font-size: 24px;
57
+ display: block;
58
+ text-transform: uppercase;
59
+ }
60
+ [data-close] {
61
+ position: fixed;
62
+ right: 32px;
63
+ top: 32px;
64
+ width: 32px;
65
+ height: 32px;
66
+ opacity: 0.3;
67
+ overflow: hidden;
68
+ text-indent: -9999px;
69
+ }
70
+ [data-close]:hover { opacity: 1; }
71
+ [data-close]:before, [data-close]:after {
72
+ position: absolute;
73
+ left: 15px;
74
+ content: ' ';
75
+ height: 33px;
76
+ width: 2px;
77
+ background-color: #00f;
78
+ }
79
+ [data-close]:before { transform: rotate(45deg); }
80
+ [data-close]:after { transform: rotate(-45deg); }
81
+ `;
82
+ /**
83
+ * Class Background create overlay for checkout
84
+ *
85
+ * @example
86
+ * var overlay = new Background();
87
+ */
88
+ class Background {
89
+ constructor() {
90
+ this.description = `Don't see the secure checkout browser? We'll help you re-launch the window to complete your purchase`;
91
+ this.title = 'Checkout';
92
+ this.overlay = null;
93
+ this.style = null;
94
+ this.showControl = true;
95
+ this.showLoader = true;
96
+ this.eventEmitter = new EventEmitter();
97
+ }
98
+ initControl() {
99
+ if (this.isInit() || !this.showControl)
100
+ return;
101
+ if (!Browser.isSupportPopUp())
102
+ return this.createLoader();
103
+ this.createTemplate();
104
+ this.createStyles();
105
+ this.eventHandler();
106
+ }
107
+ initLoader() {
108
+ if (this.isInit() || !this.showLoader)
109
+ return;
110
+ this.createStyles();
111
+ this.createLoader();
112
+ }
113
+ eventHandler() {
114
+ let closeButton = document.querySelector('[data-close]');
115
+ let focusButton = document.querySelector('[data-continue]');
116
+ if (closeButton)
117
+ EventHelper.subscribe('click', closeButton, () => this.eventEmitter.emit(TRIGGER.CLOSE, {}));
118
+ if (focusButton)
119
+ EventHelper.subscribe('click', focusButton, () => this.eventEmitter.emit(TRIGGER.FOCUS, {}));
120
+ }
121
+ clear() {
122
+ if (!this.style && !this.overlay)
123
+ return;
124
+ this.style.parentNode.removeChild(this.style);
125
+ this.overlay.parentNode.removeChild(this.overlay);
126
+ this.style = null;
127
+ this.overlay = null;
128
+ }
129
+ createLoader() {
130
+ let body = document.body || document.getElementsByTagName('body')[0];
131
+ this.overlay = document.createElement('div');
132
+ this.overlay.classList.add('checkout-overlay');
133
+ this.overlay.setAttribute('checkout-overlay', ' ');
134
+ this.overlay.innerHTML = LOADER_STYLE + LOADER_TEMPLATE;
135
+ body.appendChild(this.overlay);
136
+ setTimeout(() => {
137
+ if (this.isInit())
138
+ this.overlay.classList.add('display');
139
+ }, 5);
140
+ }
141
+ createTemplate() {
142
+ let body = document.body || document.getElementsByTagName('body')[0];
143
+ let template = String(TEMPLATE);
144
+ template = template.replace('{{description}}', this.description);
145
+ template = template.replace('{{title}}', this.title);
146
+ this.overlay = document.createElement('div');
147
+ this.overlay.classList.add('checkout-overlay');
148
+ this.overlay.setAttribute('checkout-overlay', ' ');
149
+ this.overlay.innerHTML = template;
150
+ body.appendChild(this.overlay);
151
+ setTimeout(() => {
152
+ if (this.isInit())
153
+ this.overlay.classList.add('display');
154
+ }, 5);
155
+ }
156
+ createStyles() {
157
+ let head = document.head || document.getElementsByTagName('head')[0];
158
+ let css = String(STYLES);
159
+ let container = document.querySelector('.checkout-container');
160
+ css = css.replace('{{width}}', container
161
+ ? String(container.offsetHeight / 2)
162
+ : '0');
163
+ this.style = document.createElement('style');
164
+ this.style.type = 'text/css';
165
+ this.style.appendChild(document.createTextNode(css));
166
+ head.appendChild(this.style);
167
+ }
168
+ setBackdropDescription(text) {
169
+ this.description = text;
170
+ }
171
+ setBackdropTitle(text) {
172
+ this.title = text;
173
+ }
174
+ onTrigger(triggerName, cb) {
175
+ this.eventEmitter.subscribe(triggerName, cb);
176
+ }
177
+ isInit() {
178
+ return !!(this.overlay && this.style);
179
+ }
180
+ hideContinueControl() {
181
+ if (!this.isInit())
182
+ return;
183
+ this.overlay.classList.add('hide-continue-button');
184
+ }
185
+ turnOffControl() {
186
+ this.showControl = false;
187
+ }
188
+ turnOffLoader() {
189
+ this.showLoader = false;
190
+ }
191
+ }
192
+ export { Background };
193
+ //# sourceMappingURL=../../src/lib/components/background.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"background.js","sourceRoot":"","sources":["../../components/background.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAC,QAAQ,IAAI,eAAe,EAAE,KAAK,IAAI,YAAY,EAAC,MAAM,UAAU,CAAC;AAC5E,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG;IACnB,KAAK,EAAE,OAAO;IACd,KAAK,EAA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,SAAS,CAAC,YAAY,GAAG,CAAC,CAAC;YACpC,CAAC,CAAC,GAAG,CACR,CAAC;QAEF,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC7C,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;QAErD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAEM,sBAAsB,CAAC,IAAY;QACtC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC5B,CAAC;IAEM,gBAAgB,CAAC,IAAY;QAChC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACtB,CAAC;IAEM,SAAS,CAAC,WAAmB,EAAE,EAAc;QAChD,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IACjD,CAAC;IAEM,MAAM;QACT,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IAEM,mBAAmB;QACtB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACd,OAAO;QAEX,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IACvD,CAAC;IAEM,cAAc;QACjB,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC7B,CAAC;IAEM,aAAa;QAChB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC5B,CAAC;CACJ;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -6,6 +6,6 @@ export declare class Container {
6
6
  on(name: any, cb: (event: MouseEvent) => void): void;
7
7
  getAttr<T>(allowValue: string[]): T | {};
8
8
  getElement(): Element;
9
+ getSelector(): string;
9
10
  private convertConfigs;
10
11
  }
11
- //# sourceMappingURL=container.d.ts.map
@@ -0,0 +1,63 @@
1
+ import { Event } from "../helper/event";
2
+ export class Container {
3
+ constructor(selector) {
4
+ this.selector = selector;
5
+ }
6
+ isExist() {
7
+ return !!(this.getElement());
8
+ }
9
+ getStyles(allowValue) {
10
+ if (!this.isExist())
11
+ return;
12
+ let container = this.getElement();
13
+ let styles = container.getAttribute("widget-style");
14
+ if (!styles)
15
+ return {};
16
+ let containerStyleCollection = styles.split(';');
17
+ if (typeof containerStyleCollection !== 'undefined' && !containerStyleCollection.length)
18
+ return {};
19
+ return this.convertConfigs(containerStyleCollection, allowValue);
20
+ }
21
+ on(name, cb) {
22
+ if (!this.isExist())
23
+ return;
24
+ Event.subscribe(name, this.getElement(), cb);
25
+ }
26
+ getAttr(allowValue) {
27
+ if (!this.isExist())
28
+ return;
29
+ let container = this.getElement();
30
+ let containerTextCollection = [];
31
+ for (let index in allowValue) {
32
+ if (!allowValue.hasOwnProperty(index))
33
+ continue;
34
+ let item = allowValue[index].replace(/_/g, "-");
35
+ let currentConfig = container.getAttribute(item);
36
+ if (currentConfig) {
37
+ containerTextCollection.push(`${allowValue[index]}:${currentConfig}`);
38
+ }
39
+ }
40
+ if (typeof containerTextCollection !== 'undefined' && !containerTextCollection.length)
41
+ return {};
42
+ return this.convertConfigs(containerTextCollection, allowValue);
43
+ }
44
+ getElement() {
45
+ return document.querySelector(this.selector);
46
+ }
47
+ getSelector() {
48
+ return this.selector;
49
+ }
50
+ convertConfigs(params, allowValue) {
51
+ let config = {};
52
+ for (let index in params) {
53
+ if (!params.hasOwnProperty(index))
54
+ continue;
55
+ let style = params[index].split(':');
56
+ let collectionKey = style[0].replace(/-/g, "_").trim();
57
+ if (allowValue.indexOf(collectionKey) !== -1)
58
+ config[collectionKey] = style[1].trim();
59
+ }
60
+ return config;
61
+ }
62
+ }
63
+ //# sourceMappingURL=../../src/lib/components/container.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container.js","sour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+1,4 @@
1
- import { Env } from '../configs/env';
1
+ import { Env } from '../configs/env/env';
2
2
  export interface IDispatcherData {
3
3
  message_source: string;
4
4
  event: string;
@@ -11,4 +11,3 @@ export declare class Dispatcher {
11
11
  on<T extends IDispatcherData>(name: any, cb: (data: T) => void): void;
12
12
  setEnv(env: string, alias?: string): void;
13
13
  }
14
- //# sourceMappingURL=dispatcher.d.ts.map
@@ -0,0 +1,39 @@
1
+ import { Event } from '../helper/event';
2
+ import { Env, WIDGET_URL } from '../configs/env/env';
3
+ const DISPATCHER_LINK = '/dispatcher';
4
+ const DISPATCHER_ELEMENT_ID = 'paydock-dispatcher';
5
+ ;
6
+ export class Dispatcher {
7
+ constructor(messageSource) {
8
+ this.messageSource = messageSource;
9
+ this.env = new Env(WIDGET_URL);
10
+ }
11
+ restartDispatcher() {
12
+ let dispatcher = document.getElementById(DISPATCHER_ELEMENT_ID);
13
+ if (dispatcher && dispatcher.parentNode)
14
+ dispatcher.parentNode.removeChild(dispatcher);
15
+ let iFrame = document.createElement('iframe');
16
+ iFrame.setAttribute('src', this.env.getConf().url + DISPATCHER_LINK);
17
+ iFrame.id = DISPATCHER_ELEMENT_ID;
18
+ iFrame.style.display = 'none';
19
+ document.body.appendChild(iFrame);
20
+ }
21
+ on(name, cb) {
22
+ Event.subscribe('message', window, (event) => {
23
+ let data = null;
24
+ try {
25
+ data = JSON.parse(event.data);
26
+ }
27
+ catch (e) { }
28
+ ;
29
+ if (!data || data.message_source !== this.messageSource || data.event !== name)
30
+ return;
31
+ cb(data);
32
+ });
33
+ }
34
+ setEnv(env, alias) {
35
+ this.env.setEnv(env, alias);
36
+ this.restartDispatcher();
37
+ }
38
+ }
39
+ //# sourceMappingURL=../../src/lib/components/dispatcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../../components/dispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO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K,IAAI;gBAC1E,OAAO;YAEX,EAAE,CAAC,IAAI,CAAC,CAAC;QACb,CAAC,CAAC,CAAC;IAEP,CAAC;IAEM,MAAM,CAAC,GAAW,EAAE,KAAc;QACrC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC5B,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC7B,CAAC;CACJ"}
@@ -1,4 +1,4 @@
1
- export type StylableElements = StylableElement[];
1
+ export declare type StylableElements = StylableElement[];
2
2
  export interface StylableElement {
3
3
  element: string;
4
4
  states: string[];
@@ -14,4 +14,3 @@ export declare class ElementStyle {
14
14
  static encode(element: string, states: string, styles: any): string;
15
15
  static decode(data: string): StyleElement;
16
16
  }
17
- //# sourceMappingURL=element-style.d.ts.map
@@ -0,0 +1,52 @@
1
+ export class ElementStyle {
2
+ static check(stylableElements, element, states, styles) {
3
+ for (let index in stylableElements) {
4
+ if (!stylableElements.hasOwnProperty(index) || stylableElements[index].element !== element)
5
+ continue;
6
+ if (stylableElements[index].states.indexOf(states) === -1 && states)
7
+ return false;
8
+ for (let property in styles) {
9
+ if (!styles.hasOwnProperty(property))
10
+ continue;
11
+ if (stylableElements[index].styles.indexOf(property.replace('-', '_')) === -1)
12
+ return false;
13
+ }
14
+ return true;
15
+ }
16
+ return false;
17
+ }
18
+ static encode(element, states, styles) {
19
+ let encodedStyles = [];
20
+ for (let property in styles) {
21
+ if (styles.hasOwnProperty(property))
22
+ encodedStyles.push(`${property.replace('_', '-')}:${styles[property]}`);
23
+ }
24
+ let encodedStyleBlock = encodedStyles.join(';');
25
+ if (states)
26
+ return `${element}::${states}{${encodedStyleBlock}}`;
27
+ else
28
+ return `${element}{${encodedStyleBlock}}`;
29
+ }
30
+ static decode(data) {
31
+ let state = (data.match('::(.*){') || ['', null])[1];
32
+ let element = (state !== null)
33
+ ? (data.match('(.*)::') || ['', ''])[1].trim()
34
+ : (data.match('(.*){') || ['', ''])[1].trim();
35
+ let body = (data.match('{(.*)}') || ['', ''])[1].split(';');
36
+ let styles = {};
37
+ for (let index in body) {
38
+ if (!body.hasOwnProperty(index))
39
+ continue;
40
+ let style = body[index].split(':');
41
+ if (!style && style.length !== 2)
42
+ continue;
43
+ styles[style[0].trim()] = (style[1] || '').trim();
44
+ }
45
+ return {
46
+ element: element,
47
+ state: state,
48
+ styles: styles,
49
+ };
50
+ }
51
+ }
52
+ //# sourceMappingURL=../../src/lib/components/element-style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-style.js","sourceRoot":"","sources":["../../components/element-style.ts"],"names":[],"mappings":"AAgBA,MAAM,OAAO,YAAY;IAEd,MAAM,CAAC,KAAK,CAAC,gBAAkC,EAAE,OAAe,EAAE,MAAc,EAAE,MAAW;QAChG,KAAK,IAAI,KAAK,IAAI,gBAAgB,EAAE;YAChC,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,gBAAgB,CAAC,KAAK,CAAC,CAAC,OAAO,KAAK,OAAO;gBACtF,SAAS;YAEb,IAAI,gBAAgB,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,MAAM;gBAC/D,OAAO,KAAK,CAAC;YAEjB,KAAK,IAAI,QAAQ,IAAI,MAAM,EAAE;gBACzB,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC;oBAChC,SAAS;gBAEb,IAAI,gBAAgB,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;oBACzE,OAAO,KAAK,CAAC;aACpB;YAED,OAAO,IAAI,CAAC;SACf;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAGM,MAAM,CAAC,MAAM,CAAC,OAAe,EAAE,MAAc,EAAE,MAAW;QAC7D,IAAI,aAAa,GAAa,EAAE,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I,CAAC,cAAc,CAAC,KAAK,CAAC;gBAC3B,SAAS;YAEb,IAAI,KAAK,GAAa,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC7C,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;gBAC5B,SAAS;YAEb,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;SACrD;QAED,OAAO;YACH,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,MAAM;SACjB,CAAA;IACL,CAAC;CACJ"}
@@ -12,4 +12,3 @@ export declare enum FLYPAY_EVENT {
12
12
  export declare class FlypayIframeEvent extends IFrameEvent {
13
13
  on<T>(eventName: string, widgetId: string, cb: (data: T) => void): void;
14
14
  }
15
- //# sourceMappingURL=flypay-iframe-event.d.ts.map
@@ -0,0 +1,28 @@
1
+ import { IFrameEvent } from './iframe-event';
2
+ export var FLYPAY_EVENT;
3
+ (function (FLYPAY_EVENT) {
4
+ FLYPAY_EVENT["AFTER_LOAD"] = "after_load";
5
+ FLYPAY_EVENT["UNAVAILABLE"] = "unavailable";
6
+ FLYPAY_EVENT["START_LOADING"] = "start_loading";
7
+ FLYPAY_EVENT["END_LOADING"] = "end_loading";
8
+ FLYPAY_EVENT["UPDATE"] = "update";
9
+ FLYPAY_EVENT["PAYMENT_SUCCESSFUL"] = "payment_successful";
10
+ FLYPAY_EVENT["PAYMENT_IN_REVIEW"] = "payment_in_review";
11
+ FLYPAY_EVENT["PAYMENT_ERROR"] = "payment_error";
12
+ })(FLYPAY_EVENT || (FLYPAY_EVENT = {}));
13
+ export class FlypayIframeEvent extends IFrameEvent {
14
+ on(eventName, widgetId, cb) {
15
+ for (let event in FLYPAY_EVENT) {
16
+ if (!FLYPAY_EVENT.hasOwnProperty(event))
17
+ continue;
18
+ if (eventName === FLYPAY_EVENT[event]) {
19
+ this.listeners.push({
20
+ event: eventName,
21
+ listener: cb,
22
+ widget_id: widgetId,
23
+ });
24
+ }
25
+ }
26
+ }
27
+ }
28
+ //# sourceMappingURL=../../src/lib/components/flypay-iframe-event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flypay-iframe-event.js","sourceRoot":"","sources":["../../components/flypay-iframe-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,CAAN,IAAY,YASX;AATD,WAAY,YAAY;IACpB,yCAAyB,CAAA;IACzB,2CAA2B,CAAA;IAC3B,+CAA+B,CAAA;IAC/B,2CAA2B,CAAA;IAC3B,iCAAiB,CAAA;IACjB,yDAAyC,CAAA;IACzC,uDAAuC,CAAA;IACvC,+CAA+B,CAAA;AACnC,CAAC,EATW,YAAY,KAAZ,YAAY,QASvB;AAED,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IACvC,EAAE,CAAI,SAAiB,EAAE,QAAgB,EAAE,EAAqB;QACnE,KAAK,IAAI,KAAK,IAAI,YAAY,EAAE;YAC5B,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,KAAK,CAAC;gBACnC,SAAS;YAEb,IAAI,SAAS,KAAK,YAAY,CAAC,KAAK,CAAC,EAAE;gBACnC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;oBAChB,KAAK,EAAE,SAAS;oBAChB,QAAQ,EAAE,EAAE;oBACZ,SAAS,EAAE,QAAQ;iBACtB,CAAC,CAAC;aACN;SACJ;IACL,CAAC;CACJ"}
@@ -8,4 +8,3 @@ export declare class FormInterceptor {
8
8
  continueSubmit(): void;
9
9
  private subscribe;
10
10
  }
11
- //# sourceMappingURL=form-interceptor.d.ts.map
@@ -0,0 +1,38 @@
1
+ export class FormInterceptor {
2
+ constructor(selector) {
3
+ this.intercepted = false;
4
+ this.selector = selector;
5
+ }
6
+ getElement() {
7
+ return document.querySelector(this.selector);
8
+ }
9
+ isExist() {
10
+ return !!(this.getElement());
11
+ }
12
+ beforeSubmit(cb) {
13
+ if (!this.isExist())
14
+ return;
15
+ this.subscribe(this.getElement(), (event) => {
16
+ event.preventDefault();
17
+ this.intercepted = true;
18
+ cb.apply(this, []);
19
+ });
20
+ }
21
+ continueSubmit() {
22
+ if (!this.isExist() || !this.intercepted)
23
+ return;
24
+ this.intercepted = false;
25
+ setTimeout(() => {
26
+ this.getElement().submit();
27
+ }, 50);
28
+ }
29
+ subscribe(subject, listener) {
30
+ if (subject.addEventListener) {
31
+ subject.addEventListener("submit", listener);
32
+ }
33
+ else {
34
+ subject.attachEvent("onsubmit", listener);
35
+ }
36
+ }
37
+ }
38
+ //# sourceMappingURL=../../src/lib/components/form-Interceptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-Interceptor.js","sourceRoot":"","sources":["../../components/form-Interceptor.ts"],"names":[],"mappings":"AACA,MAAM,OAAO,eAAe;IAKxB,YAAY,QAAgB;QAFlB,gBAAW,GAAG,KAAK,CAAC;QAG1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAEM,UAAU;QACb,OAAwB,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAClE,CAAC;IAEM,OAAO;QACV,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IACjC,CAAC;IAEM,YAAY,CAAE,EAAc;QAC/B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACf,OAAO;QACX,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,KAAY,EAAE,EAAE;YAC/C,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACP,CAAC;IAEM,cAAc;QACjB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW;YACpC,OAAO;QAEX,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,UAAU,CAAC,GAAE,EAAE;YACX,IAAI,CAAC,UAAU,EAAE,CAAC,MAAM,EAAE,CAAC;QAC/B,CAAC,EAAE,EAAE,CAAC,CAAC;IACX,CAAC;IAIO,SAAS,CAAC,OAAwB,EAAE,QAAgC;QACxE,IAAI,OAAO,CAAC,gBAAgB,EAAE;YAC1B,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;SAChD;aAAM;YACG,OAAQ,CAAC,WAAW,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;SACpD;IACL,CAAC;CACJ"}
@@ -11,4 +11,3 @@ export declare abstract class HttpCore {
11
11
  protected parser(text: any, status: number, cb: SuccessCb, errorCb: ErrorCb): void;
12
12
  protected abstract getLink(): string;
13
13
  }
14
- //# sourceMappingURL=http-core.d.ts.map
@@ -0,0 +1,57 @@
1
+ import { AccessToken } from '../helper/access-token';
2
+ import { API_URL, Env } from '../configs/env/env';
3
+ import { SDK } from '../configs/sdk';
4
+ export class HttpCore {
5
+ constructor() {
6
+ this.env = new Env(API_URL);
7
+ }
8
+ setEnv(env, alias) {
9
+ this.env.setEnv(env, alias);
10
+ }
11
+ getEnv() {
12
+ return this.env.getEnv();
13
+ }
14
+ getUrl() {
15
+ return this.env.getConf().url + this.getLink();
16
+ }
17
+ create(accessToken, data, cb, errorCb) {
18
+ let request = new XMLHttpRequest();
19
+ request.onload = () => {
20
+ this.parser(request.responseText, request.status, cb, errorCb);
21
+ };
22
+ request.open('POST', this.getUrl(), true);
23
+ request.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');
24
+ request.setRequestHeader(AccessToken.getAccessHeaderNameByToken(accessToken), accessToken);
25
+ if (SDK.version) {
26
+ request.setRequestHeader(SDK.headerKeys.version, SDK.version);
27
+ request.setRequestHeader(SDK.headerKeys.type, SDK.type);
28
+ }
29
+ request.send(JSON.stringify(data));
30
+ }
31
+ get(accessToken, cb, errorCb) {
32
+ let request = new XMLHttpRequest();
33
+ request.onload = () => {
34
+ this.parser(request.responseText, request.status, cb, errorCb);
35
+ };
36
+ request.open('GET', this.getUrl(), true);
37
+ request.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');
38
+ request.setRequestHeader(AccessToken.getAccessHeaderNameByToken(accessToken), accessToken);
39
+ if (SDK.version) {
40
+ request.setRequestHeader(SDK.headerKeys.version, SDK.version);
41
+ request.setRequestHeader(SDK.headerKeys.type, SDK.type);
42
+ }
43
+ request.send();
44
+ }
45
+ parser(text, status, cb, errorCb) {
46
+ let res = {};
47
+ try {
48
+ res = JSON.parse(text);
49
+ }
50
+ catch (e) { }
51
+ if ((status >= 200 && status < 300) || status === 302)
52
+ return cb(res.resource.data, status);
53
+ else
54
+ errorCb(res.error || { message: 'unknown error' }, status);
55
+ }
56
+ }
57
+ //# sourceMappingURL=../../src/lib/components/http-core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-core.js","sourceRoot":"","sources":["../../components/http-core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,GAAG,EAAO,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAKrC,MAAM,OAAgB,QAAQ;IAG1B;QACI,IAAI,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;IAEM,MAAM,CAAC,GAAW,EAAE,KAAc;QACrC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAChC,CAAC;IAEM,MAAM;QACT,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC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,CAAC,CAAA;QAClE,CAAC,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,CAAC;QACzC,OAAO,CAAC,gBAAgB,CAAC,cAAc,EAAE,iCAAiC,CAAC,CAAC;QAC5E,OAAO,CAAC,gBAAgB,CAAC,WAAW,CAAC,0BAA0B,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,CAAC;QAE3F,IAAG,GAAG,CAAC,OAAO,EAAE;YACZ,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;YAC9D,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;SAC3D;QAED,OAAO,CAAC,IAAI,EAAE,CAAC;IACnB,CAAC;IAES,MAAM,CAAC,IAAS,EAAE,MAAc,EAAE,EAAa,EAAE,OAAgB;QACvE,IAAI,GAAG,GAAQ,EAAE,CAAC;QAClB,IAAI;YACA,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SAC1B;QAAC,OAAO,CAAC,EAAE,GAAE;QAEd,IAAI,CAAC,MAAM,IAAI,GAAG,IAAI,MAAM,GAAG,GAAG,CAAC,IAAI,MAAM,KAAK,GAAG;YACjD,OAAO,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;;YAErC,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,EAAC,OAAO,EAAE,eAAe,EAAC,EAAE,MAAM,CAAC,CAAC;IACjE,CAAC;CAGJ"}
@@ -1,27 +1,30 @@
1
+ /**
2
+ * Contains basic information associated with the event.
3
+ *
4
+ * Including event (name), source of the message, purpose and a unique identifier
5
+ * for the event.
6
+ *
7
+ * @interface IEventData
8
+ *
9
+ * @param {string} event The name of the event.
10
+ * @param {string} message_source A system variable that identifies the event source.
11
+ * @param {string} purpose A system variable that states the purpose of the event.
12
+ * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
13
+ */
1
14
  export interface IEventData {
2
15
  event: string;
3
- purpose: string;
4
16
  message_source: string;
5
- ref_id?: string;
17
+ purpose: string;
6
18
  widget_id: string;
7
19
  data?: any;
20
+ ref_id?: string;
8
21
  }
9
- /**
10
- * Interface of data from event.
11
- * @interface IEventData
12
- *
13
- * @param {string} event
14
- * @param {string} purpose
15
- * @param {string} message_source
16
- * @param {string} [ref_id]
17
- * */
18
22
  export declare const EVENT: {
19
23
  AFTER_LOAD: string;
20
24
  SUBMIT: string;
21
25
  FINISH: string;
22
26
  VALIDATION_ERROR: string;
23
27
  SYSTEM_ERROR: string;
24
- /** @deprecated */
25
28
  CHECKOUT_SUCCESS: string;
26
29
  CHECKOUT_READY: string;
27
30
  CHECKOUT_ERROR: string;
@@ -56,4 +59,3 @@ export declare class IFrameEvent {
56
59
  clear(): void;
57
60
  private subscribe;
58
61
  }
59
- //# sourceMappingURL=iframe-event.d.ts.map