@paydock/client-sdk 1.104.6-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 (494) hide show
  1. package/.nvmrc +1 -0
  2. package/README.md +320 -362
  3. package/api.d.ts +1 -0
  4. package/api.js +1 -0
  5. package/bundles/widget.umd.js +7410 -6717
  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 +1 -3
  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 +0 -1
  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 +0 -1
  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 +0 -1
  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 +0 -1
  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 +0 -1
  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 +0 -1
  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 +0 -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 +0 -4
  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 +3 -5
  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 -10
  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 +0 -1
  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/{bundles/types → lib}/constants/validators.d.ts +2 -3
  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 +0 -1
  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 +0 -1
  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/lib/secure-remote-commerce/index.d.ts +1 -0
  226. package/lib/secure-remote-commerce/index.js +2 -0
  227. package/lib/secure-remote-commerce/index.js.map +1 -0
  228. package/lib/secure-remote-commerce/interfaces.d.ts +71 -0
  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/lib/secure-remote-commerce/providers/visa-src/helper.d.ts +7 -0
  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/lib/secure-remote-commerce/providers/visa-src/index.d.ts +1 -0
  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/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts → lib/secure-remote-commerce/providers/visa-src/visa-src.d.ts} +7 -5
  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/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.d.ts +8 -0
  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/lib/secure-remote-commerce/secure-remote-commerce.d.ts +163 -0
  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 +0 -1
  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 +0 -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 +1 -1
  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 +0 -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/{bundles/types → lib}/wallet-buttons/helpers/flypay-v2.helper.d.ts +0 -1
  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/{bundles/types → lib}/wallet-buttons/index.d.ts +0 -1
  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 +0 -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 → lib}/wallet-buttons/wallet-buttons.d.ts +0 -1
  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 +0 -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 +1 -2
  295. package/lib/widget/configuration.js +260 -0
  296. package/lib/widget/configuration.js.map +1 -0
  297. package/{bundles/types → lib}/widget/html-multi-widget.d.ts +3 -4
  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 +0 -1
  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 +189 -163
  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 -10456
  332. package/bundles/index.cjs.d.ts +0 -3206
  333. package/bundles/index.cjs.map +0 -1
  334. package/bundles/index.mjs +0 -10424
  335. package/bundles/index.mjs.d.ts +0 -3206
  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/constants/validators.d.ts.map +0 -1
  399. package/bundles/types/external-checkout/builder.d.ts.map +0 -1
  400. package/bundles/types/external-checkout/checker.d.ts.map +0 -1
  401. package/bundles/types/external-checkout/index.d.ts +0 -3
  402. package/bundles/types/external-checkout/index.d.ts.map +0 -1
  403. package/bundles/types/helper/access-token.d.ts.map +0 -1
  404. package/bundles/types/helper/browser.d.ts.map +0 -1
  405. package/bundles/types/helper/event-emitter.d.ts.map +0 -1
  406. package/bundles/types/helper/event.d.ts.map +0 -1
  407. package/bundles/types/helper/ms.d.ts.map +0 -1
  408. package/bundles/types/helper/object.d.ts.map +0 -1
  409. package/bundles/types/helper/url.d.ts.map +0 -1
  410. package/bundles/types/helper/uuid.d.ts.map +0 -1
  411. package/bundles/types/index-cba.d.ts +0 -13
  412. package/bundles/types/index-cba.d.ts.map +0 -1
  413. package/bundles/types/index.d.ts +0 -14
  414. package/bundles/types/index.d.ts.map +0 -1
  415. package/bundles/types/payment-source/builder.d.ts.map +0 -1
  416. package/bundles/types/payment-source/index.d.ts.map +0 -1
  417. package/bundles/types/payment-source-widget/html-payment-source-widget.d.ts.map +0 -1
  418. package/bundles/types/payment-source-widget/index.d.ts.map +0 -1
  419. package/bundles/types/payment-source-widget/interfaces.d.ts.map +0 -1
  420. package/bundles/types/payment-source-widget/payment-source-widget.d.ts.map +0 -1
  421. package/bundles/types/secure-remote-commerce/index.d.ts +0 -103
  422. package/bundles/types/secure-remote-commerce/index.d.ts.map +0 -1
  423. package/bundles/types/secure-remote-commerce/interfaces.d.ts +0 -149
  424. package/bundles/types/secure-remote-commerce/interfaces.d.ts.map +0 -1
  425. package/bundles/types/secure-remote-commerce/mastercard-secure-remote-commerce.d.ts +0 -31
  426. package/bundles/types/secure-remote-commerce/mastercard-secure-remote-commerce.d.ts.map +0 -1
  427. package/bundles/types/secure-remote-commerce/providers/mastercard-src/index.d.ts +0 -2
  428. package/bundles/types/secure-remote-commerce/providers/mastercard-src/index.d.ts.map +0 -1
  429. package/bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts.map +0 -1
  430. package/bundles/types/secure-remote-commerce/providers/src-provider.d.ts.map +0 -1
  431. package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts +0 -86
  432. package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts.map +0 -1
  433. package/bundles/types/vault-display-widget/index.d.ts.map +0 -1
  434. package/bundles/types/vault-display-widget/vault-display-widget.d.ts.map +0 -1
  435. package/bundles/types/wallet-buttons/afterpay.wallet-service.d.ts.map +0 -1
  436. package/bundles/types/wallet-buttons/apple.wallet-service.d.ts.map +0 -1
  437. package/bundles/types/wallet-buttons/flypay-v2.wallet-service.d.ts.map +0 -1
  438. package/bundles/types/wallet-buttons/flypay.wallet-service.d.ts.map +0 -1
  439. package/bundles/types/wallet-buttons/google.wallet-service.d.ts.map +0 -1
  440. package/bundles/types/wallet-buttons/helpers/flypay-v2.helper.d.ts.map +0 -1
  441. package/bundles/types/wallet-buttons/index-cba.d.ts +0 -2
  442. package/bundles/types/wallet-buttons/index-cba.d.ts.map +0 -1
  443. package/bundles/types/wallet-buttons/index.d.ts.map +0 -1
  444. package/bundles/types/wallet-buttons/interfaces.d.ts.map +0 -1
  445. package/bundles/types/wallet-buttons/mastercard.wallet-service.d.ts.map +0 -1
  446. package/bundles/types/wallet-buttons/paypal.wallet-service.d.ts.map +0 -1
  447. package/bundles/types/wallet-buttons/stripe.wallet-service.d.ts.map +0 -1
  448. package/bundles/types/wallet-buttons/wallet-buttons.d.ts.map +0 -1
  449. package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts +0 -330
  450. package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts.map +0 -1
  451. package/bundles/types/wallet-buttons/wallet-service.d.ts.map +0 -1
  452. package/bundles/types/widget/configuration.d.ts.map +0 -1
  453. package/bundles/types/widget/html-multi-widget.d.ts.map +0 -1
  454. package/bundles/types/widget/html-widget.d.ts.map +0 -1
  455. package/bundles/types/widget/index.d.ts.map +0 -1
  456. package/bundles/types/widget/meta.d.ts.map +0 -1
  457. package/bundles/types/widget/multi-widget.d.ts.map +0 -1
  458. package/bundles/types/widget/style.d.ts.map +0 -1
  459. package/bundles/widget.umd.js.d.ts +0 -3206
  460. package/bundles/widget.umd.js.map +0 -1
  461. package/bundles/widget.umd.js.min.d.ts +0 -3206
  462. package/bundles/widget.umd.min.js.map +0 -1
  463. package/docs/api-canvas3ds.md +0 -158
  464. package/docs/api-checkout-button.md +0 -912
  465. package/docs/api-examples.md +0 -65
  466. package/docs/api-ps-widget.md +0 -585
  467. package/docs/api-vault-display.md +0 -94
  468. package/docs/api-widget.md +0 -2499
  469. package/docs/api-wrapper.md +0 -78
  470. package/docs/canvas3ds-examples.md +0 -242
  471. package/docs/cba-header.md +0 -13
  472. package/docs/cba-license.md +0 -2
  473. package/docs/checkout-examples.md +0 -248
  474. package/docs/header.md +0 -15
  475. package/docs/html/layout.html +0 -78
  476. package/docs/html/marked.js +0 -23
  477. package/docs/html/style.css +0 -365
  478. package/docs/install/npm.content.md +0 -16
  479. package/docs/install/npm.example.md +0 -24
  480. package/docs/install/umd.content.md +0 -20
  481. package/docs/install/umd.example.md +0 -6
  482. package/docs/install.md +0 -43
  483. package/docs/install.readme.t.md +0 -17
  484. package/docs/install.slate.t.md +0 -17
  485. package/docs/license.md +0 -2
  486. package/docs/partials/header.hbs +0 -3
  487. package/docs/ps-examples.md +0 -129
  488. package/docs/secure-remote-commerce-examples.md +0 -232
  489. package/docs/secure-remote-commerce.md +0 -336
  490. package/docs/vault-display-example.md +0 -132
  491. package/docs/wallet-buttons-examples.md +0 -609
  492. package/docs/wallet-buttons.md +0 -619
  493. package/docs/wallet-cba-buttons-examples.md +0 -388
  494. package/docs/widget-examples.md +0 -134
@@ -0,0 +1,60 @@
1
+ import { DEFAULT_ENV } from '../configs/env/env';
2
+ import { EventEmitter } from "../helper/event-emitter";
3
+ import { ObjectHelper } from "../helper/object";
4
+ export const WALLET_EVENT = {
5
+ UNAVAILABLE: 'unavailable',
6
+ UPDATE: 'update',
7
+ PAYMENT_METHOD_SELECTED: 'payment_method_selected',
8
+ PAYMENT_SUCCESS: 'payment_success',
9
+ PAYMENT_IN_REVIEW: 'payment_in_review',
10
+ PAYMENT_ERROR: 'payment_error',
11
+ CALLBACK: 'callback',
12
+ AUTH_TOKENS_CHANGED: 'auth_tokens_changed',
13
+ BUTTON_CLICK: 'button_click',
14
+ CHECKOUT_OPEN: 'checkout_open',
15
+ CHECKOUT_CLOSE: 'checkout_close',
16
+ };
17
+ export class WalletService {
18
+ constructor(publicKey, meta) {
19
+ this.publicKey = publicKey;
20
+ this.meta = meta;
21
+ this.env = DEFAULT_ENV;
22
+ this.eventEmitter = new EventEmitter();
23
+ this.initializeChildWallets();
24
+ }
25
+ initializeChildWallets() {
26
+ this.childWallets = [];
27
+ }
28
+ getGatewayName() {
29
+ // required for Google Pay direct integrations
30
+ throw new Error("Method not implemented");
31
+ }
32
+ setEnv(env) {
33
+ this.env = env;
34
+ return this;
35
+ }
36
+ load(container) {
37
+ this.childWallets.forEach((child) => child.load(container));
38
+ return;
39
+ }
40
+ update(data) {
41
+ // do nothing unless current wallet service overrides this method;
42
+ return;
43
+ }
44
+ enable() {
45
+ // do nothing unless current wallet service overrides this method;
46
+ return;
47
+ }
48
+ disable() {
49
+ // do nothing unless current wallet service overrides this method;
50
+ return;
51
+ }
52
+ on(eventName, cb) {
53
+ if (ObjectHelper.values(WALLET_EVENT).indexOf(eventName) === -1)
54
+ throw (new Error("invalid wallet event"));
55
+ if (typeof cb === 'function')
56
+ return this.eventEmitter.subscribe(eventName, cb);
57
+ return new Promise((resolve) => this.eventEmitter.subscribe(eventName, (res) => resolve(res)));
58
+ }
59
+ }
60
+ //# sourceMappingURL=../../src/lib/wallet-buttons/wallet-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wallet-service.js","sourceRoot":"","sources":["../../wallet-buttons/wallet-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAY,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAwEhD,MAAM,CAAC,MAAM,YAAY,GAAG;IACxB,WAAW,EAAE,aAAa;IAC1B,MAAM,EAAE,QAAQ;IAChB,uBAAuB,EAAE,yBAAyB;IAClD,eAAe,EAAE,iBAAiB;IAClC,iBAAiB,EAAE,mBAAmB;IACtC,aAAa,EAAE,eAAe;IAC9B,QAAQ,EAAE,UAAU;IACpB,mBAAmB,EAAE,qBAAqB;IAC1C,YAAY,EAAE,cAAc;IAC5B,aAAa,EAAE,eAAe;IAC9B,cAAc,EAAE,gBAAgB;CACnC,CAAA;AAuCD,MAAM,OAAgB,aAAa;IAK/B,YAAsB,SAAiB,EAAY,IAAwB;QAArD,cAAS,GAAT,SAAS,CAAQ;QAAY,SAAI,GAAJ,IAAI,CAAoB;QAJjE,QAAG,GAAG,WAAW,CAAC;QAKxB,IAAI,CAAC,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;QACvC,IAAI,CAAC,sBAAsB,EAAE,CAAC;IAClC,CAAC;IAES,sBAAsB;QAC5B,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;IAC3B,CAAC;IAES,cAAc;QACpB,8CAA8C;QAC9C,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC9C,CAAC;IAEM,MAAM,CAAC,GAAW;QACrB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,IAAI,CAAC,SAAoB;QAC5B,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;QAC5D,OAAO;IACX,CAAC;IAEM,MAAM,CAAC,IAA0B;QACpC,kEAAkE;QAClE,OAAO;IACX,CAAC;IAEM,MAAM;QACT,kEAAkE;QAClE,OAAO;IACX,CAAC;IAEM,OAAO;QACV,kEAAkE;QAClE,OAAO;IACX,CAAC;IAEM,EAAE,CAAC,SAAiB,EAAE,EAAwF;QACjH,IAAI,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YAC3D,MAAK,CAAC,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC;QAE7C,IAAI,OAAO,EAAE,KAAK,UAAU;YACxB,OAAO,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;QAEtD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACnG,CAAC;CACJ"}
@@ -1,4 +1,4 @@
1
- import { type IAfterpayMeta, type IBamboraMeta, type IPayPalMeta, type IZipmoneyMeta } from "../components/param";
1
+ import { IPayPalMeta, IZipmoneyMeta, IAfterpayMeta, IBamboraMeta } from "../components/param";
2
2
  /**
3
3
  * List of available payment source types
4
4
  *
@@ -158,4 +158,3 @@ declare class Configuration {
158
158
  setGiftCardSchemeData(giftCardScheme: any, processingNetwork: any): void;
159
159
  }
160
160
  export { Configuration };
161
- //# sourceMappingURL=configuration.d.ts.map
@@ -0,0 +1,260 @@
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
@@ -0,0 +1 @@
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;A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AAO,EAAE,aAAa,EAAE,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import { MultiWidget } from "./multi-widget";
2
2
  import { Container } from "../components/container";
3
3
  import { IFrame } from "../components/iframe";
4
- import { IFrameEvent, type IEventData } from "../components/iframe-event";
5
- import { Trigger, type ITriggerData } from "../components/trigger";
6
- import { type IFormValidation, type IFormValues, type ValidatorFieldsMapKey } from '../components/param';
4
+ import { IFrameEvent, IEventData } from "../components/iframe-event";
5
+ import { Trigger, ITriggerData } from "../components/trigger";
6
+ import { IFormValidation, IFormValues, ValidatorFieldsMapKey } from '../components/param';
7
7
  export interface IEventMetaData extends IEventData {
8
8
  configuration_token: string;
9
9
  type: string;
@@ -334,4 +334,3 @@ declare class HtmlMultiWidget extends MultiWidget {
334
334
  useAutoResize(): void;
335
335
  }
336
336
  export { HtmlMultiWidget };
337
- //# sourceMappingURL=html-multi-widget.d.ts.map